sensors: allow up to 4 accels, gyros, and baros and add configurable rotations for accel & gyro

This commit is contained in:
Daniel Agar
2020-10-08 19:01:44 -04:00
committed by GitHub
parent 28956e0399
commit eecf2e7a1e
47 changed files with 2881 additions and 1163 deletions
@@ -98,6 +98,10 @@ void VehicleAirData::SensorCorrectionsUpdate(bool force)
case 2:
_thermal_offset[baro_index] = corrections.baro_offset_2;
break;
case 3:
_thermal_offset[baro_index] = corrections.baro_offset_3;
break;
}
}
}
@@ -71,7 +71,7 @@ private:
void ParametersUpdate();
void SensorCorrectionsUpdate(bool force = false);
static constexpr int MAX_SENSOR_COUNT = 3;
static constexpr int MAX_SENSOR_COUNT = 4;
uORB::Publication<vehicle_air_data_s> _vehicle_air_data_pub{ORB_ID(vehicle_air_data)};
@@ -81,7 +81,8 @@ private:
uORB::SubscriptionCallbackWorkItem _sensor_sub[MAX_SENSOR_COUNT] {
{this, ORB_ID(sensor_baro), 0},
{this, ORB_ID(sensor_baro), 1},
{this, ORB_ID(sensor_baro), 2}
{this, ORB_ID(sensor_baro), 2},
{this, ORB_ID(sensor_baro), 3},
};
perf_counter_t _cycle_perf{perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")};