AP_Vehicle: get_osd_attitude_rad takes ahrs semaphore

This commit is contained in:
Iampete1
2026-08-25 15:41:49 +01:00
committed by Peter Hall
parent 8e5b9c49cf
commit 92910a733b
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -1020,9 +1020,12 @@ void AP_Vehicle::publish_osd_info()
}
#endif
void AP_Vehicle::get_osd_attitude_rad(float &roll, float &pitch, float &yaw) const
void AP_Vehicle::get_osd_attitude_rad(float &roll, float &pitch, float &yaw)
{
#if AP_AHRS_ENABLED
// Take semaphore as this can be called from a thread
WITH_SEMAPHORE(ahrs.get_semaphore());
roll = ahrs.get_roll_rad();
pitch = ahrs.get_pitch_rad();
yaw = ahrs.get_yaw_rad();
+1 -1
View File
@@ -313,7 +313,7 @@ public:
virtual bool get_pan_tilt_norm(float &pan_norm, float &tilt_norm) const { return false; }
// Returns roll, pitch, and yaw for OSD Horizon, Plane overrides to correct for VTOL view and fixed wing PTCH_TRIM_DEG
virtual void get_osd_attitude_rad(float &roll, float &pitch, float &yaw) const;
virtual void get_osd_attitude_rad(float &roll, float &pitch, float &yaw);
/*
get the target earth-frame angular velocities in rad/s (Z-axis component used by some gimbals)