Publishing at a required frequency

asked 2019-12-18 12:20:22 -0500

prj1508 gravatar image

updated 2019-12-18 17:06:52 -0500

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

edit retag flag offensive close merge delete

Comments

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.

stevemacenski gravatar image stevemacenski  ( 2019-12-18 12:56:30 -0500 )edit

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?

prj1508 gravatar image prj1508  ( 2019-12-18 13:09:36 -0500 )edit