sensor_correction.msg rename {gyro,accel,baro}_select to match uORB convention

This commit is contained in:
Beat Küng
2017-01-17 13:31:05 +01:00
committed by Lorenz Meier
parent 7326fea142
commit 0765ed552c
4 changed files with 9 additions and 9 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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;
}
}
+3 -3
View File
@@ -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];