mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 13:51:36 +08:00
Simulated drivers: Use fake device IDs
This commit is contained in:
@@ -680,8 +680,8 @@ BAROSIM::collect()
|
|||||||
report.altitude = raw_baro.altitude;
|
report.altitude = raw_baro.altitude;
|
||||||
report.temperature = raw_baro.temperature;
|
report.temperature = raw_baro.temperature;
|
||||||
|
|
||||||
/* TODO get device ID for sensor */
|
/* fake device ID */
|
||||||
report.device_id = 0;
|
report.device_id = 478459;
|
||||||
|
|
||||||
/* publish it */
|
/* publish it */
|
||||||
if (!(m_pub_blocked)) {
|
if (!(m_pub_blocked)) {
|
||||||
|
|||||||
@@ -1107,8 +1107,8 @@ GYROSIM::_measure()
|
|||||||
arb.y_integral = aval_integrated(1);
|
arb.y_integral = aval_integrated(1);
|
||||||
arb.z_integral = aval_integrated(2);
|
arb.z_integral = aval_integrated(2);
|
||||||
|
|
||||||
/* Return orb instance as a surrogate device ID */
|
/* fake device ID */
|
||||||
arb.device_id = _accel_orb_class_instance;
|
arb.device_id = 6789478;
|
||||||
|
|
||||||
grb.x_raw = (int16_t)(mpu_report.gyro_x / _gyro_range_scale);
|
grb.x_raw = (int16_t)(mpu_report.gyro_x / _gyro_range_scale);
|
||||||
grb.y_raw = (int16_t)(mpu_report.gyro_y / _gyro_range_scale);
|
grb.y_raw = (int16_t)(mpu_report.gyro_y / _gyro_range_scale);
|
||||||
@@ -1132,8 +1132,8 @@ GYROSIM::_measure()
|
|||||||
grb.y_integral = gval_integrated(1);
|
grb.y_integral = gval_integrated(1);
|
||||||
grb.z_integral = gval_integrated(2);
|
grb.z_integral = gval_integrated(2);
|
||||||
|
|
||||||
/* Return orb instance as a surrogate device ID */
|
/* fake device ID */
|
||||||
grb.device_id = _gyro->_gyro_orb_class_instance;
|
grb.device_id = 3467548;
|
||||||
|
|
||||||
_accel_reports->force(&arb);
|
_accel_reports->force(&arb);
|
||||||
_gyro_reports->force(&grb);
|
_gyro_reports->force(&grb);
|
||||||
@@ -1312,7 +1312,7 @@ start(enum Rotation rotation)
|
|||||||
fail:
|
fail:
|
||||||
|
|
||||||
if (*g_dev_ptr != nullptr) {
|
if (*g_dev_ptr != nullptr) {
|
||||||
delete(*g_dev_ptr);
|
delete *g_dev_ptr;
|
||||||
*g_dev_ptr = nullptr;
|
*g_dev_ptr = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user