AP_InertialSensor: added SITL device IDs

This commit is contained in:
Andrew Tridgell 2018-06-27 13:31:23 +10:00
parent 823c4523b3
commit 5f8b57ba19
2 changed files with 6 additions and 2 deletions

View File

@ -105,6 +105,7 @@ public:
DEVTYPE_INS_ICM20789 = 0x27,
DEVTYPE_INS_ICM20689 = 0x28,
DEVTYPE_INS_BMI055 = 0x29,
DEVTYPE_SITL = 0x2A,
};
protected:

View File

@ -37,8 +37,11 @@ bool AP_InertialSensor_SITL::init_sensor(void)
// grab the used instances
for (uint8_t i=0; i<INS_SITL_INSTANCES; i++) {
gyro_instance[i] = _imu.register_gyro(gyro_sample_hz[i], i);
accel_instance[i] = _imu.register_accel(accel_sample_hz[i], i);
gyro_instance[i] = _imu.register_gyro(gyro_sample_hz[i],
AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_SITL, i, 1, DEVTYPE_SITL));
accel_instance[i] = _imu.register_accel(accel_sample_hz[i],
AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_SITL, i, 2, DEVTYPE_SITL));
}
hal.scheduler->register_timer_process(FUNCTOR_BIND_MEMBER(&AP_InertialSensor_SITL::timer_update, void));