From 0765ed552c2b3d558a99df4c05c57061ad2dfb6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 17 Jan 2017 13:31:05 +0100 Subject: [PATCH] sensor_correction.msg rename {gyro,accel,baro}_select to match uORB convention --- msg/sensor_correction.msg | 6 +++--- msg/sensor_mag.msg | 2 +- src/modules/mc_att_control/mc_att_control_main.cpp | 4 ++-- src/modules/sensors/voted_sensors_update.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/msg/sensor_correction.msg b/msg/sensor_correction.msg index 2ea31e54f0..44f29f968a 100644 --- a/msg/sensor_correction.msg +++ b/msg/sensor_correction.msg @@ -17,6 +17,6 @@ float32[3] accel_scale # accelerometer XYZ scale factors in the sensor frame float32 baro_offset # barometric pressure offsets in the sensor frame in m/s/s float32 baro_scale # barometric pressure scale factors in the sensor frame -uint8 gyro_select # gyro uORB index for the voted sensor -uint8 accel_select # accelerometer uORB index for the voted sensor -uint8 baro_select # barometric pressure uORB index for the voted sensor +uint8 selected_gyro_instance # gyro uORB topic instance for the voted sensor +uint8 selected_accel_instance # accelerometer uORB topic instance for the voted sensor +uint8 selected_baro_instance # barometric pressure uORB topic instance for the voted sensor diff --git a/msg/sensor_mag.msg b/msg/sensor_mag.msg index 662ebdbb79..c41cd47d42 100644 --- a/msg/sensor_mag.msg +++ b/msg/sensor_mag.msg @@ -10,4 +10,4 @@ int16 x_raw int16 y_raw int16 z_raw -uint32 device_id +uint32 device_id # unique device ID for the sensor that does not change between power cycles diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 8b360ac724..f0979950ee 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -828,8 +828,8 @@ MulticopterAttitudeControl::sensor_correction_poll() } /* update the latest gyro selection */ - if (_sensor_correction.gyro_select <= sizeof(_sensor_gyro_sub) / sizeof(_sensor_gyro_sub[0])) { - _selected_gyro = _sensor_correction.gyro_select; + if (_sensor_correction.selected_gyro_instance <= sizeof(_sensor_gyro_sub) / sizeof(_sensor_gyro_sub[0])) { + _selected_gyro = _sensor_correction.selected_gyro_instance; } } diff --git a/src/modules/sensors/voted_sensors_update.cpp b/src/modules/sensors/voted_sensors_update.cpp index 4e61406786..f26250c01d 100644 --- a/src/modules/sensors/voted_sensors_update.cpp +++ b/src/modules/sensors/voted_sensors_update.cpp @@ -542,7 +542,7 @@ void VotedSensorsUpdate::accel_poll(struct sensor_combined_s &raw) if (best_index >= 0) { raw.accelerometer_integral_dt = _last_sensor_data[best_index].accelerometer_integral_dt; _accel.last_best_vote = (uint8_t)best_index; - _corrections.accel_select = (uint8_t)best_index; + _corrections.selected_accel_instance = (uint8_t)best_index; for (unsigned axis_index = 0; axis_index < 3; axis_index++) { raw.accelerometer_m_s2[axis_index] = _last_sensor_data[best_index].accelerometer_m_s2[axis_index]; @@ -679,7 +679,7 @@ void VotedSensorsUpdate::gyro_poll(struct sensor_combined_s &raw) raw.gyro_integral_dt = _last_sensor_data[best_index].gyro_integral_dt; raw.timestamp = _last_sensor_data[best_index].timestamp; _gyro.last_best_vote = (uint8_t)best_index; - _corrections.gyro_select = (uint8_t)best_index; + _corrections.selected_gyro_instance = (uint8_t)best_index; for (unsigned axis_index = 0; axis_index < 3; axis_index++) { raw.gyro_rad[axis_index] = _last_sensor_data[best_index].gyro_rad[axis_index]; @@ -803,7 +803,7 @@ void VotedSensorsUpdate::baro_poll(struct sensor_combined_s &raw) raw.baro_temp_celcius = _last_sensor_data[best_index].baro_temp_celcius; _last_best_baro_pressure = _last_baro_pressure[best_index]; _baro.last_best_vote = (uint8_t)best_index; - _corrections.baro_select = (uint8_t)best_index; + _corrections.selected_baro_instance = (uint8_t)best_index; _corrections.baro_offset = _baro_offset[best_index]; _corrections.baro_scale = _baro_scale[best_index];