RS232 Queue System in ROS
Using ROS Kinetic and primarily python. I have a driver that subscribes to several topics including /cmd_vel and a bunch of other commands which interact with a control board via RS232.
One problem I have is if multiple commands are sent at the same time, it can break the communication stream (two messages sent/received at the same time in the buffer).
I fixed it by adding a “busy” boolean state, but this only works for 2 function (i.e. when one function runs, boolean state busy = TRUE, so the other function does not run and waits for busy = FALSE. however, when there a 3 functions, 2 of them are waiting and can sometimes trigger at the same instead of busy =FALSE)
In ROS is there a way to QUEUE function calls that are initiated by subcribers? for example if I have 5 subscribers each being triggered at a defined rate, how do I queue these commands so the RS232 communication with the control board is done one-at-a-time