Rosserial queue size X buffer size

asked 2020-03-07 04:29:35 -0500

dpetrini gravatar image

updated 2020-03-11 18:05:56 -0500


I am using Rosserial for arduino lib for ESP32 microcontroller. I am running rosserial lib default and made small modifications to run in this microcontroller, like changing baud rate to 230400 as it is more powerful. I also increased buffersize to values higher than 512 bytes default, to 1024 or even higher like 8092.

The question is, I am sending Odom and IMU messages to a host (raspi) that calculates robot_pose_ekf and send odom_combined to ESP32 so that I can use the filtered x,y,theta to drive the robot.

Frequencies to send: Odom(~5Hz) IMU (10Hz) - I can see both are ok relatively constant (rostopic hz in host).

But the received message (robot_pose_ekf/odom_combined) when i measure the callbacks frequency (I try to read them asap) I see variable rate from ~5 Hz until 20Hz (although in the host I see in rostopic hz around 20Hz as configured in launch file) . Also the value of Yaw received in ESP32 seems not good . I think I am losing many samples.

Question is: I increased buffer size in rosserial client side. But does it mean that I get more messages in queue to be read as soon as I can? Or even if I increase BUFFER SIZE it is not related to QUEUE SIZE and I always get one sample that is overwritten when other samples arrives, meaning that queue size is only 1 ?

edit retag flag offensive close merge delete