Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

zero latency publishing of sensor data

Hi !

I have a sensor producing data at high but variable frequency, i.e. random times between two incoming data point. I have a callback function (independent from ROS) that gets called when there is incoming sensor data. I'd like that function to publish the data into a a ROS topic immediately as it receives with no latency.

I found no example for this, the available examples are using some Node with fixed "spin" rate, that gets called by rclcpp.spin() and checking for already received data that they publish then. However this solution introduces latency on the receiver side, since data could have arrived before the spin()'s callback is called.

Is there an easy way to implement the above functionality in C++ ROS2 Eloquent ?

thanks, G