mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-10-06 09:02:52 +08:00
feat(CAN):Add option to center the UAVCAN servo (#28423)
This commit is contained in:
@@ -114,6 +114,7 @@ actuator_output:
|
||||
standard_params:
|
||||
disarmed: { min: 0, max: 1000, default: 500 }
|
||||
min: { min: 0, max: 1000, default: 0 }
|
||||
center: { min: 0, max: 1000 }
|
||||
max: { min: 0, max: 1000, default: 1000 }
|
||||
failsafe: { min: 0, max: 1000 }
|
||||
num_channels: *max_num_uavcan_servos
|
||||
|
||||
@@ -555,8 +555,8 @@ float MixingOutput::output_limit_calc_single(int i, float value) const
|
||||
|| (_function_assignment[i] >= OutputFunction::Gimbal_Roll
|
||||
&& _function_assignment[i] <= OutputFunction::Gimbal_Yaw))
|
||||
&& _param_handles[i].center != PARAM_INVALID
|
||||
&& _center_value[i] >= 800
|
||||
&& _center_value[i] <= 2200) {
|
||||
&& _center_value[i] >= _min_value[i]
|
||||
&& _center_value[i] <= _max_value[i]) {
|
||||
output = math::interpolateNXY(value, {-1.f, 0.f, 1.f}, {(float)_min_value[i], (float)_center_value[i], (float)_max_value[i]});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user