Copter: add get_angle_targets_for_reporting

This returns the current earth frame roll, pitch and yaw targets which
can depend upon the flight mode
This commit is contained in:
Randy Mackay 2014-02-03 22:03:43 +09:00 committed by Andrew Tridgell
parent 1acd33e290
commit d579325e2a

View File

@ -276,3 +276,15 @@ print_flight_mode(AP_HAL::BetterStream *port, uint8_t mode)
break; break;
} }
} }
// get_angle_targets_for_reporting() - returns 3d vector of roll, pitch and yaw target angles for logging and reporting to GCS
static void get_angle_targets_for_reporting(Vector3f& targets)
{
if (control_mode == ACRO) {
targets.x = 0;
targets.y = 0;
targets.y = 0;
}else{
targets = attitude_control.angle_ef_targets();
}
}