Browse Source

Rover: move setting of compass sys_status bits up

master
Peter Barker 6 years ago committed by Andrew Tridgell
parent
commit
482bb27fe3
  1. 9
      APMrover2/GCS_Rover.cpp

9
APMrover2/GCS_Rover.cpp

@ -23,10 +23,6 @@ bool GCS_Rover::supersimple_input_active() const
void GCS_Rover::update_vehicle_sensor_status_flags(void) void GCS_Rover::update_vehicle_sensor_status_flags(void)
{ {
// first what sensors/controllers we have // first what sensors/controllers we have
if (AP::compass().enabled()) {
control_sensors_present |= MAV_SYS_STATUS_SENSOR_3D_MAG;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_3D_MAG;
}
const AP_GPS &gps = AP::gps(); const AP_GPS &gps = AP::gps();
if (gps.status() > AP_GPS::NO_GPS) { if (gps.status() > AP_GPS::NO_GPS) {
control_sensors_present |= MAV_SYS_STATUS_SENSOR_GPS; control_sensors_present |= MAV_SYS_STATUS_SENSOR_GPS;
@ -62,11 +58,6 @@ void GCS_Rover::update_vehicle_sensor_status_flags(void)
control_sensors_health |= MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL; // X/Y position control control_sensors_health |= MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL; // X/Y position control
} }
AP_AHRS &ahrs = AP::ahrs();
if (AP::compass().enabled() && AP::compass().healthy(0) && ahrs.use_compass()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_3D_MAG;
}
if (gps.is_healthy()) { if (gps.is_healthy()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_GPS; control_sensors_health |= MAV_SYS_STATUS_SENSOR_GPS;
} }

Loading…
Cancel
Save