FlightTaskManual: fix for the sideways oscillations in fast foward flight when using the vehicle yaw estimate

This commit is contained in:
Matthias Grob
2018-04-05 07:30:12 +02:00
committed by Beat Küng
parent 089ebcbfa4
commit 2b6e356c91
2 changed files with 12 additions and 1 deletions
@@ -145,6 +145,17 @@ bool FlightTaskManual::update()
return true;
}
float FlightTaskManual::_get_input_frame_yaw()
{
/* using constant yaw angle from setpoint here to prevent sideways oscillation in fast forward flight */
if (PX4_ISFINITE(_hold_yaw)) {
return _hold_yaw;
} else {
return _yaw;
}
}
void FlightTaskManual::_updateYaw()
{
const float yaw_speed = _sticks(3) * math::radians(_man_yaw_max.get());
@@ -67,7 +67,7 @@ protected:
bool _evaluateSticks();
bool _sticks_data_required = true; /**< let sibling task define if it depends on stick data */
float _get_input_frame_yaw() { return _yaw; }
float _get_input_frame_yaw();
virtual void _scaleVelocity(matrix::Vector3f &velocity);
control::BlockParamFloat _z_vel_max_up; /**< maximal vertical velocity when flying upwards with the stick */