mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 17:28:54 +08:00
commander : warn if excess accels are connected
This commit is contained in:
committed by
Lorenz Meier
parent
d177ccc9a7
commit
52f1718bb8
@@ -466,9 +466,17 @@ calibrate_return do_accel_calibration_measurements(orb_advert_t *mavlink_log_pub
|
||||
|
||||
// We should not try to subscribe if the topic doesn't actually exist and can be counted.
|
||||
const unsigned accel_count = orb_group_count(ORB_ID(sensor_accel));
|
||||
|
||||
// Warn that we will not calibrate more than max_accels accelerometers
|
||||
if (accel_count > max_accel_sens) {
|
||||
calibration_log_critical(mavlink_log_pub, "[cal] Detected %u accels, but will calibrate only %u", accel_count, max_accel_sens);
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < accel_count; i++) {
|
||||
worker_data.subs[i] = orb_subscribe_multi(ORB_ID(sensor_accel), i);
|
||||
|
||||
if (worker_data.subs[i] < 0) {
|
||||
calibration_log_critical(mavlink_log_pub, "[cal] Accel #%u not found, abort", i);
|
||||
result = calibrate_return_error;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user