Plane: fixes from review

thanks Francisco
This commit is contained in:
Andrew Tridgell 2017-07-12 18:10:22 +10:00
parent 76818c1ff4
commit c20ea87ef8
2 changed files with 4 additions and 5 deletions

View File

@ -1186,7 +1186,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Param: MANUAL_RCMASK
// @DisplayName: Manual R/C pass-through mask
// @Description: Mask of R/C channels to pass directly to corresponding output channel when in MANUAL mode. When in any more except MANUAL the channels selected with this option behave normally. This parameter is designed to allow for complex mixing strategies to be used for MANUAL flight using transmitter based mixing. Note that when this option is used you need to be very careful with pre-flight checks to ensure that the output is correct both in MANUAL and non-MANUAL modes.
// @Description: Mask of R/C channels to pass directly to corresponding output channel when in MANUAL mode. When in any mode except MANUAL the channels selected with this option behave normally. This parameter is designed to allow for complex mixing strategies to be used for MANUAL flight using transmitter based mixing. Note that when this option is used you need to be very careful with pre-flight checks to ensure that the output is correct both in MANUAL and non-MANUAL modes.
// @Bitmask: 0:Chan1,1:Chan2,2:Chan3,3:Chan4,4:Chan5,5:Chan6,6:Chan7,7:Chan8,8:Chan9,9:Chan10,10:Chan11,11:Chan12,12:Chan13,13:Chan14,14:Chan15,15:Chan16
// @User: Advanced
AP_GROUPINFO("MANUAL_RCMASK", 10, ParametersG2, manual_rc_mask, 0),
@ -1425,8 +1425,7 @@ void Plane::convert_mixers(void)
SRV_Channel *chan = SRV_Channels::srv_channel(i);
if (chan->get_function() == SRV_Channel::k_aileron_with_input) {
chan->function_set_and_save(SRV_Channel::k_aileron);
}
if (chan->get_function() == SRV_Channel::k_elevator_with_input) {
} else if (chan->get_function() == SRV_Channel::k_elevator_with_input) {
chan->function_set_and_save(SRV_Channel::k_elevator);
}
}

View File

@ -61,8 +61,8 @@ bool Plane::mix_one_channel(char *&buf, uint16_t &buf_size, uint8_t out_chan, ui
return false;
}
int32_t out_min = limit*(outch->get_trim() - outch->get_output_min()) / (1500 - PX4_LIM_RC_MIN);
int32_t out_max = limit*(outch->get_output_max() - outch->get_trim()) / (PX4_LIM_RC_MAX - 1500);
int32_t out_min = limit*(outch_trim - outch->get_output_min()) / (1500 - PX4_LIM_RC_MIN);
int32_t out_max = limit*(outch->get_output_max() - outch_trim) / (PX4_LIM_RC_MAX - 1500);
int32_t out_trim = limit*(outch_trim - 1500) / ((PX4_LIM_RC_MAX - PX4_LIM_RC_MIN) / 2);
int32_t in_mul = inch->get_reverse() == outch->get_reversed()?1:-1;