Open mich1342 opened 8 months ago
Does it increase if after reaching AGENT_CONNECTED
you just run rclc_executor_spin_some
without checking EXECUTE_EVERY_N_MS(200, state = (RMW_RET_OK == rmw_uros_ping_agent(100, 1)) ? AGENT_CONNECTED : AGENT_DISCONNECTED;);
?
Hi @pablogs9
Thank you for your reply, will try on that. One thing that bothers me is if I publish only Int32 message it could reach the 50Hz publishing frequency. Will let you know soon after did a trial.
Best Regards
Michael
Hi @pablogs9 ,
Just tried that and the publish frequency increase by a little ~0.7-1 Hz
What if you do not make a imu__update
inside the timer?
Hi @pablogs9 ,
I tried to call the imu__update()
function at the end of my main loop and still got ~25 Hz frequency.
Is the timer callback being called at 50 Hz if you keep it empty of operations?
Yes, If I remove all of the IMU / Odom related code and leave it as the auto reconnect examples publishing incremental integers, it runs at 50Hz.
Does it improves if you publish the IMU in best effort?
It increased to ~28 Hz
How big is your payload?
It's only a standard IMU message (sensor_msgs/msg/Imu). Not sure how to check the payload. The data looks like this:
header:
stamp:
sec: 0
nanosec: 0
frame_id: imu_link
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 0.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: -0.03832031413912773
y: 0.4981640838086605
z: -9.848320733755827
linear_acceleration_covariance:
- 1.0e-05
- 0.0
- 0.0
- 0.0
- 1.0e-05
- 0.0
- 0.0
- 0.0
- 1.0e-05
---
So probably it is related to message size, since when you publish smaller messages you increase the rate.
Issue template
Steps to reproduce the issue
I attach GY-85 IMU module to ESP32 and try to publish the IMU data using I2D Dev Library.
Expected behavior
I expect to get 50Hz data rate (Checked using RQT Topic Monitor)
Actual behavior
I get only 25 Hz of data rate
Additional information
As addition, I have tried to publish empty IMU data (commenting all IMU code so that it is not reading anything) and just inputting constant hardcoded value. I still got 25 Hz of data rate only.