/joint_states topic and publish rate
I want to read the joint states of a robot from the /joint_states
topic, preferably at 1kHz. The problem is that when I increase the publishing rate X of the joint controller above 100Hz, a subscriber to /joint_states
receives messages at X Hz for 1-2 seconds and then the rate changes. The joint_states
topic seems to give me packets of messages in a smaller frequency.
For instance, I have 1Khz publish rate. For the first half a second I have 1 msg every 1 ms. After that half a second I receive 20 msgs together every 20ms.
I have visualized this issue with rosbag
and it seems to be repeatable in multiple machines. Also the timing and the behaviour is exactly the same every time.
I have tried to subscribe to /joint_states topic running the Shadow's robot hand and the KUKA LWR4+ ROS packages from here: https://github.com/CentroEPiaggio/kuk... either in real robots or simulated with gazebo, and the same issue is persistent, so I don't thing is something depended on the robot.
Has anyone else noticed this behaviour? It seems like a buffer is full or something locks a mutex during the real-time publishing of the joint state controller.
I am having the same issue, packets of messages show up every 20 ms. The total number of messages corresponds with the publish rate that I have set, but no matter what I change the messages show up in packets. If I change the real time rate that Gazebo runs at it makes no difference, still every 20 ms of simulation time. I am also trying to publish at 1 kHz, though I had also tried 2 kHz with no effect. I will for now drop down to 100 Hz and see if that at least gets me messages every 10 ms.