Copter: add range finder status to extended status msg

This commit is contained in:
Randy Mackay 2015-04-17 16:06:05 +09:00
parent 245e46205a
commit 3719ea53e4
1 changed files with 10 additions and 0 deletions

View File

@ -245,6 +245,16 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan)
}
#endif
#if CONFIG_SONAR == ENABLED
if (sonar.num_sensors() > 0) {
control_sensors_present |= MAV_SYS_STATUS_SENSOR_LASER_POSITION;
control_sensors_enabled |= MAV_SYS_STATUS_SENSOR_LASER_POSITION;
if (sonar.has_data()) {
control_sensors_health |= MAV_SYS_STATUS_SENSOR_LASER_POSITION;
}
}
#endif
if (!ap.initialised || ins.calibrating()) {
// while initialising the gyros and accels are not enabled
control_sensors_enabled &= ~(MAV_SYS_STATUS_SENSOR_3D_GYRO | MAV_SYS_STATUS_SENSOR_3D_ACCEL);