Skip to content

Commit

Permalink
GCS_MAVLink: correct define around use of ins singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jun 21, 2023
1 parent 55227bc commit a2ecaf7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libraries/GCS_MAVLink/GCS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,12 @@ void GCS::update_sensor_status_flags()
control_sensors_enabled = 0;
control_sensors_health = 0;

#if AP_AHRS_ENABLED
AP_AHRS &ahrs = AP::ahrs();
#if AP_INERTIALSENSOR_ENABLED
const AP_InertialSensor &ins = AP::ins();
#endif

#if AP_AHRS_ENABLED && AP_INERTIALSENSOR_ENABLED
AP_AHRS &ahrs = AP::ahrs();

control_sensors_present |= MAV_SYS_STATUS_AHRS;
if (ahrs.initialised()) {
Expand Down Expand Up @@ -206,7 +209,7 @@ void GCS::update_sensor_status_flags()
}
#endif

#if AP_AHRS_ENABLED
#if AP_INERTIALSENSOR_ENABLED
control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_GYRO;
control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_ACCEL;
if (!ins.calibrating()) {
Expand Down

0 comments on commit a2ecaf7

Please sign in to comment.