mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 02:03:34 +08:00
HelicopterCoaxial: handle yaw saturation
This had to be done for the integrators to work at all.
This commit is contained in:
+6
-6
@@ -116,13 +116,13 @@ void ActuatorEffectivenessHelicopterCoaxial::updateSetpoint(const matrix::Vector
|
|||||||
actuator_sp(0) = throttle - yaw; // Clockwise
|
actuator_sp(0) = throttle - yaw; // Clockwise
|
||||||
actuator_sp(1) = throttle + yaw; // Counter-clockwise
|
actuator_sp(1) = throttle + yaw; // Counter-clockwise
|
||||||
|
|
||||||
// Saturation check for yaw TODO check saturation
|
// Saturation check for yaw
|
||||||
// if (actuator_sp(1) < actuator_min(1)) {
|
if ((actuator_sp(0) < actuator_min(0)) || (actuator_sp(1) > actuator_max(1))) {
|
||||||
// setSaturationFlag(_geometry.yaw_sign, _saturation_flags.yaw_neg, _saturation_flags.yaw_pos);
|
setSaturationFlag(1.f, _saturation_flags.yaw_neg, _saturation_flags.yaw_pos);
|
||||||
|
|
||||||
// } else if (actuator_sp(1) > actuator_max(1)) {
|
} else if ((actuator_sp(0) > actuator_max(0)) || (actuator_sp(1) < actuator_min(1))) {
|
||||||
// setSaturationFlag(_geometry.yaw_sign, _saturation_flags.yaw_pos, _saturation_flags.yaw_neg);
|
setSaturationFlag(1.f, _saturation_flags.yaw_pos, _saturation_flags.yaw_neg);
|
||||||
// }
|
}
|
||||||
|
|
||||||
for (int i = 0; i < _geometry.num_swash_plate_servos; i++) {
|
for (int i = 0; i < _geometry.num_swash_plate_servos; i++) {
|
||||||
float roll_coeff = sinf(_geometry.swash_plate_servos[i].angle) * _geometry.swash_plate_servos[i].arm_length;
|
float roll_coeff = sinf(_geometry.swash_plate_servos[i].angle) * _geometry.swash_plate_servos[i].arm_length;
|
||||||
|
|||||||
Reference in New Issue
Block a user