mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_Vehicle: get_osd_attitude_rad takes ahrs semaphore
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user