Hi all,
So I am looking to update some prior work that I had got working in 2022.2.1 to work in the latest version. One of the main things I am having issue with is the IMU being published to ROS which is not performing consistently and, more critically, seems to be publishing the same timestamp multiple times.
I need IMU publishing at 100 Hz so I followed advice here and set Min Simulation Frame Rate to 100 as well as the Physics Scene Time per second to 100 and then setting the rosparam of use_sim_time to true.
In version 2022.2.1 I got publishing outputs as shown below
user@machine:~$ rostopic hz /sim_imu
subscribed to [/sim_imu]
WARNING: may be using simulated time
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00267s window: 57
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00297s window: 114
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00266s window: 170
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00282s window: 227
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00252s window: 284
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00243s window: 341
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00224s window: 398
average rate: 100.000
min: 0.000s max: 0.020s std dev: 0.00210s window: 455
However when I switch to 2023.1.0-hotfix.1 I get the following
user@machine:~$ rostopic hz /sim_imu
subscribed to [/sim_imu]
WARNING: may be using simulated time
average rate: 101.923
min: 0.000s max: 0.020s std dev: 0.00237s window: 54
average rate: 100.952
min: 0.000s max: 0.020s std dev: 0.00168s window: 107
average rate: 101.266
min: 0.000s max: 0.020s std dev: 0.00158s window: 161
average rate: 100.948
min: 0.000s max: 0.020s std dev: 0.00137s window: 214
average rate: 101.136
min: 0.000s max: 0.020s std dev: 0.00136s window: 268
average rate: 100.946
min: 0.000s max: 0.020s std dev: 0.00125s window: 321
average rate: 101.084
min: 0.000s max: 0.020s std dev: 0.00126s window: 374
This on it’s face doesn’t seem like a huge issue but the simulator is also producing repeated timestamps for some of the published messages. The repeated timestamps doesn’t seem to happen with excessive frequently but it happens enough to cause some of my downstream processes issues where they didn’t before. Example of repeat as found with rostopic echo below. Any thoughts or advice as to what’s going on here and/or how to fix it?
seq: 704
stamp:
secs: 23
nsecs: 179999482
frame_id: "sim_imu"
orientation:
x: 4.899531802493584e-08
y: 3.500635727959889e-07
z: -3.0476334700324514e-07
w: 1.0
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 0.0
y: 0.0
z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: -6.861246674816357e-06
y: 9.603061243979027e-07
z: 9.800000190734863
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
header:
seq: 705
stamp:
secs: 23
nsecs: 179999482
frame_id: "sim_imu"
orientation:
x: 4.899531802493584e-08
y: 3.500635727959889e-07
z: -3.0476334700324514e-07
w: 1.0
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: 0.0
y: 0.0
z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: -6.861246674816357e-06
y: 9.603061243979027e-07
z: 9.800000190734863
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]