Helicopter: use absolute value for yaw compensation from collective pitch

This commit is contained in:
Matthias Grob 2022-08-09 13:18:40 +02:00 committed by Beat Küng
parent 608ab9ff9c
commit 554d965a2d
No known key found for this signature in database
GPG Key ID: 866DB5F0E24821BB
1 changed files with 2 additions and 2 deletions

View File

@ -137,8 +137,8 @@ void ActuatorEffectivenessHelicopter::updateSetpoint(const matrix::Vector<float,
float pitch_cmd = control_sp(ControlAxis::PITCH);
actuator_sp(0) = throttle;
actuator_sp(1) = control_sp(ControlAxis::YAW) + collective_pitch * _geometry.yaw_collective_pitch_scale;
actuator_sp(1) = control_sp(ControlAxis::YAW)
+ fabsf(collective_pitch) * _geometry.yaw_collective_pitch_scale;
for (int i = 0; i < _geometry.num_swash_plate_servos; i++) {
actuator_sp(_first_swash_plate_servo_index + i) = collective_pitch