Publishing at a required frequency
Hi,
I need to publish a CAN message to a topic at 10ms frequency. For this, I have created a timer and I am publishing from the timercallback function. This seems to be consuming lot of CPU resources. Is there a better way of implementing this? I am using ROS kinetic on Ubuntu 16.04
thanks
You need to provide alot more information. What client library? How large is the message? Is the CPU time spent on the ROS/Timer or the CAN operations? Please provide the code in question so we understand what's happening, etc.
I am using socketcan_bridge package. The message is 8 bytes of data being sent to sent_message topic of socketcan_bridge. I think CPU time is spent on physical CAN related operations as I do not have this issue when I am running on vcan0. This could be socketcan or CAN controller issue, but is there a way I can work around this in ROS?