Multiple robots' Arduinos connected to same roscore through rosserial server
Dear all,
I am currently working on a project developing a system containing 8 mobile robots which all must communicate over the same ROS master. The robots all have a Teensy 3.5 which performs motor and on-board LED control as well as listen to some simple detector switch sensors with a controlled loop time of 20ms. The Teensys are connected to their host robot's Raspberry Pi 3B+ via a wired connection through the hardware UART as is necessary for rosserial connections with Teensy boards. As is needed for the project, the robots all subscribe to the same ROS topics as one another (in both the code aboard the Teensy as well as a few nodes run on the Pi), but only one robot will "react" and perform the actions if needed through some relatively simple status control communicated over a ROS topic and through python codes run on the Pis which perform the higher-level tasks.
I have been using rosserial_python
to establish my rosserial connection between the Teensy and the Pi, however am experiencing many rosserial disconnects, namely "Lost sync with device, restarting..."
. Sometimes the robot is able to re-establish the rosserial connection, able to recover and continue to operate as needed, however sometimes one of or multiple of the robots will never automatically re-establish the rosserial connection and require a full upload of their Arduino code again before they can reconnect to the rosserial node which is not a possibility for this project.
From this, I have identified that rosserial_python
is most likely the cause of the rosserial instability. Because of this, I have attempted to use rosserial_server
instead, as this is said to be more robust. However, I am having issues running the rosserial_server
launch file with multiple robots connected to the same roscore. To be clear, when running roslaunch rosserial_server serial.launch
on one robot I am able to establish a rosserial connection and the robot operates how it should, however when running the launch file on a second robot, the launch file of the first robot is automatically closed. ie. the launch file closes with all processes on machine have died, roslaunch will exit. shutting down processing monitor...
Avoiding such an error was achievable in rosserial_python
by simply changing the name of the node in the "serial_node.py" file, however doing similar in the files that the rosserial_server
node uses is not stopping the launch file of the first robot from exiting. I have performed catkin_make
after making changes to my serial_node
files to ensure the changes are saved.
So, my question is: how can I use rosserial_server
to establish rosserial connections between the Arduino and PC of multiple robots connected to the same roscore master?
I am using ROS kinetic version 1.12.14 and each of the Raspberry Pi's use Raspbian. The computer running roscore is a Linux Ubuntu 16.04 desktop PC.
Any help would be greatly appreciated.
Thanks.
somewhat off-topic, but important to clarify I believe: you are not setting up multiple robots to connect to the same roscore master.
The Master is not involved in communication between nodes, or at least, not in the actual communication. It only serves as a "phonebook" (or DNS if you are familiar with how that works).
The only job the Master has it to tell nodes where they can find others. After that, it just sits there.
See also wiki/Master.
Thank you, that is a much better explanation of what roscore actually does. I am intertwining performing communication and setting up the communications which, as you say, roscore is only really responsible for setting up communications.