Browse Source

Plane: bodyframe roll log target attitude bugfix

master
Mark Whitehorn 6 years ago committed by Andrew Tridgell
parent
commit
e8adbba2fc
  1. 8
      ArduPlane/Log.cpp

8
ArduPlane/Log.cpp

@ -19,8 +19,12 @@ void Plane::Log_Write_Attitude(void) @@ -19,8 +19,12 @@ void Plane::Log_Write_Attitude(void)
if (quadplane.tailsitter_active() || quadplane.in_vtol_mode()) {
// we need the attitude targets from the AC_AttitudeControl controller, as they
// account for the acceleration limits
targets = quadplane.attitude_control->get_att_target_euler_cd();
// account for the acceleration limits.
// Also, for bodyframe roll input types, _attitude_target_euler_angle is not maintained
// since Euler angles are not used and it is a waste of cpu to compute them at the loop rate.
// Get them from the quaternion instead:
quadplane.attitude_control->get_attitude_target_quat().to_euler(targets.x, targets.y, targets.z);
targets *= degrees(100.0f);
logger.Write_AttitudeView(*quadplane.ahrs_view, targets);
} else {
logger.Write_Attitude(ahrs, targets);

Loading…
Cancel
Save