ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have similar situation and solved it this way:

  • Several nodes writing to a topic /serialport and a node that sends the messages out serial port.
  • One node that reads messages in from the serial port, decodes and puts data onto the appropriate topic so the relevant node gets it's answer.

In my case, the controller (LPC1769) will send an answer back when it has it and can take other commands in the meantime so no need to hold the port while waiting for response. In this way, I can keep the port running near max capacity. I treat the serial port output 100% separate from the input and have no mutexes or other controls. This is similar to the way gvdhoorn proposed except I use two nodes to access the HW. Maybe this helps you. One weakness of this method is that ROS could spam the controller to the point that messages get dropped. That hasn't been an issue yet though. Input buffer on controller is large.