mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 04:53:34 +08:00
actuator outputs: always add reverse range param
and remove the possibility to set min > max to reverse. Initially the idea was to add the checkbox on the UI side, to avoid adding another param, but I don't think I'll go through the extra effort on the QGC side.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
module_name: PWM Output
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
output_groups:
|
||||
- param_prefix: PWM_MAIN
|
||||
channel_label: 'Channel'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module_name: '${PWM_MAIN_OR_AUX}'
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
output_groups:
|
||||
- generator: pwm
|
||||
param_prefix: '${PWM_MAIN_OR_AUX}'
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
module_name: HIL
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
show_subgroups_if: 'SYS_HITL>0'
|
||||
output_groups:
|
||||
- param_prefix: HIL_ACT
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
module_name: SIM
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
output_groups:
|
||||
- param_prefix: PWM_MAIN
|
||||
channel_label: Channel
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module_name: PWM MAIN
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
output_groups:
|
||||
- generator: pwm
|
||||
param_prefix: PWM_MAIN
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module_name: UAVCAN
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
show_subgroups_if: 'UAVCAN_ENABLE>=3'
|
||||
config_parameters:
|
||||
- param: 'UAVCAN_ENABLE'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
module_name: UAVCANv1
|
||||
actuator_output:
|
||||
add_reverse_range_param: true
|
||||
output_groups:
|
||||
- param_prefix: UCAN1_ESC
|
||||
channel_label: 'ESC'
|
||||
|
||||
@@ -193,8 +193,6 @@ void MixingOutput::updateParams()
|
||||
|
||||
bool function_changed = false;
|
||||
|
||||
_reverse_output_mask = 0;
|
||||
|
||||
for (unsigned i = 0; i < _max_num_outputs; i++) {
|
||||
int32_t val;
|
||||
|
||||
@@ -219,7 +217,6 @@ void MixingOutput::updateParams()
|
||||
}
|
||||
|
||||
if (_min_value[i] > _max_value[i]) {
|
||||
_reverse_output_mask |= 1 << i;
|
||||
uint16_t tmp = _min_value[i];
|
||||
_min_value[i] = _max_value[i];
|
||||
_max_value[i] = tmp;
|
||||
@@ -230,10 +227,11 @@ void MixingOutput::updateParams()
|
||||
}
|
||||
}
|
||||
|
||||
_reverse_output_mask = 0;
|
||||
int32_t rev_range_param;
|
||||
|
||||
if (_param_handle_rev_range != PARAM_INVALID && param_get(_param_handle_rev_range, &rev_range_param) == 0) {
|
||||
_reverse_output_mask |= rev_range_param;
|
||||
_reverse_output_mask = rev_range_param;
|
||||
}
|
||||
|
||||
if (function_changed) {
|
||||
|
||||
Reference in New Issue
Block a user