sensors/vehicle_imu: fix gyro clipping publication

The IMU topic is not zeroed, and the clipping information was not
copied, so this field ended up being garbage.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes 2024-01-10 04:20:40 +13:00 committed by GitHub
parent 9156c5c065
commit 88b3316409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -647,6 +647,7 @@ bool VehicleIMU::Publish()
imu.gyro_device_id = _gyro_calibration.device_id();
delta_angle_corrected.copyTo(imu.delta_angle);
delta_velocity_corrected.copyTo(imu.delta_velocity);
imu.delta_angle_clipping = _delta_angle_clipping;
imu.delta_velocity_clipping = _delta_velocity_clipping;
imu.accel_calibration_count = _accel_calibration.calibration_count();
imu.gyro_calibration_count = _gyro_calibration.calibration_count();
@ -654,6 +655,7 @@ bool VehicleIMU::Publish()
_vehicle_imu_pub.publish(imu);
// reset clip counts
_delta_angle_clipping = 0;
_delta_velocity_clipping = 0;
// record gyro publication latency and integrated samples