mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 05:10:34 +08:00
move initial sensor priority to parameters and purge ORB_PRIORITY
- CAL_ACCx_EN -> CAL_ACCx_PRIO - CAL_GYROx_EN -> CAL_GYROx_PRIO - CAL_MAGx_EN -> CAL_MAGx_PRIO
This commit is contained in:
@@ -212,9 +212,6 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
|
||||
gyro_worker_data_t worker_data{};
|
||||
worker_data.mavlink_log_pub = mavlink_log_pub;
|
||||
|
||||
ORB_PRIO device_prio_max = ORB_PRIO_UNINITIALIZED;
|
||||
int32_t device_id_primary = 0;
|
||||
|
||||
// We should not try to subscribe if the topic doesn't actually exist and can be counted.
|
||||
const unsigned orb_gyro_count = orb_group_count(ORB_ID(sensor_gyro));
|
||||
|
||||
@@ -232,14 +229,6 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
|
||||
|
||||
if (gyro_sub.advertised() && (gyro_sub.get().device_id != 0) && (gyro_sub.get().timestamp > 0)) {
|
||||
worker_data.calibrations[cur_gyro].set_device_id(gyro_sub.get().device_id);
|
||||
|
||||
// Get priority
|
||||
const ORB_PRIO prio = gyro_sub.get_priority();
|
||||
|
||||
if (prio > device_prio_max) {
|
||||
device_prio_max = prio;
|
||||
device_id_primary = gyro_sub.get().device_id;
|
||||
}
|
||||
}
|
||||
|
||||
// reset calibration index to match uORB numbering
|
||||
@@ -317,8 +306,6 @@ int do_gyro_calibration(orb_advert_t *mavlink_log_pub)
|
||||
calibration.ParametersSave();
|
||||
}
|
||||
|
||||
param_set_no_notification(param_find("CAL_GYRO_PRIME"), &device_id_primary);
|
||||
|
||||
if (failed) {
|
||||
calibration_log_critical(mavlink_log_pub, "ERROR: failed to set offset params");
|
||||
res = PX4_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user