Asynchronous I/O (UDP, serial) in component

asked 2020-10-22 11:34:37 -0500

oysstu gravatar image

This question is related to the use of asynchronous I/O, e.g. sockets or serial comms through Boost ASIO, but in a composable node. The use-case is a node which publishes a topic based on a serial/udp/tcp input, where this node can both be used in a single-threaded executor in order to avoid memory copies or in a standalone thread.

Obviously, this can be implemented through polling by creating a timer which checks for incoming data. Is it possible to somehow integrate asynchronous I/O with the ROS2 event loop (thus leveraging epoll for event notifications), though? I've looked into spin_until_future_complete, waitables, and custom executors, as possible solutions, but haven't found a clear solution yet.

edit retag flag offensive close merge delete