|
|
|
@ -689,4 +689,19 @@ bool Plane::get_target_location(Location& target_loc)
@@ -689,4 +689,19 @@ bool Plane::get_target_location(Location& target_loc)
|
|
|
|
|
} |
|
|
|
|
#endif // ENABLE_SCRIPTING
|
|
|
|
|
|
|
|
|
|
#if OSD_ENABLED |
|
|
|
|
// correct AHRS pitch for TRIM_PITCH_CD in non-VTOL modes, and return VTOL view in VTOL
|
|
|
|
|
void Plane::get_osd_roll_pitch_rad(float &roll, float &pitch) const |
|
|
|
|
{ |
|
|
|
|
pitch = ahrs.pitch; |
|
|
|
|
roll = ahrs.roll; |
|
|
|
|
if (!quadplane.show_vtol_view()) { // correct for TRIM_PITCH_CD
|
|
|
|
|
pitch -= g.pitch_trim_cd * 0.01 * DEG_TO_RAD; |
|
|
|
|
} else { |
|
|
|
|
pitch = quadplane.ahrs_view->pitch; |
|
|
|
|
roll = quadplane.ahrs_view->roll; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
AP_HAL_MAIN_CALLBACKS(&plane); |
|
|
|
|