mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 12:38:33 -04:00
AP_InertialSensor: added SITL device IDs
This commit is contained in:
parent
823c4523b3
commit
5f8b57ba19
@ -105,6 +105,7 @@ public:
|
|||||||
DEVTYPE_INS_ICM20789 = 0x27,
|
DEVTYPE_INS_ICM20789 = 0x27,
|
||||||
DEVTYPE_INS_ICM20689 = 0x28,
|
DEVTYPE_INS_ICM20689 = 0x28,
|
||||||
DEVTYPE_INS_BMI055 = 0x29,
|
DEVTYPE_INS_BMI055 = 0x29,
|
||||||
|
DEVTYPE_SITL = 0x2A,
|
||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -37,8 +37,11 @@ bool AP_InertialSensor_SITL::init_sensor(void)
|
|||||||
|
|
||||||
// grab the used instances
|
// grab the used instances
|
||||||
for (uint8_t i=0; i<INS_SITL_INSTANCES; i++) {
|
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));
|
hal.scheduler->register_timer_process(FUNCTOR_BIND_MEMBER(&AP_InertialSensor_SITL::timer_update, void));
|
||||||
|
Loading…
Reference in New Issue
Block a user