How to wait for I/O event? example: received CAN message
Hello,
I am writing a node that receives CAN messages and translates them in custom ROS messages.
It is a LifeCycleNode and inside the on_configuration
function i create a CAN socket and set it up.
The thing that i do not understand is: where should i put the read()
function. Or should I use a non-blockin function?
I found this as a refernce: https://github.com/ROS4SPACE/ros2can_... But I do not know Asio and I do not know if this is the only correct way to do that. THank you in advance.
(I am using Dashing on a Yocto-compiled image on ARM 64bit)
In the title I meant writing "CAN frame", not "CAN format"
there is an edit button right below the title. You are allow to change it ;-)
Thank you for the hint
For now, I solved it by creating a new thread inside on_activate() and let it wait for the read() call.