Unable to run simultaneous rosserial publisher and subscriber
I'm working through the rosserial_embeddedlinux tutorials: https://wiki.ros.org/rosserial_embedd...
Both the publisher and subscriber tutorials work as described in isolation.
For the publisher: I can run rosrun rosserial_python serial_node.py tcp
, run the HelloROS
publisher example, run rostopic echo chatter
, and see the expected output on the host.
For the subscriber: I can run rosrun rosserial_python serial_node.py tcp
, run the ExampleSubscriber
subscriber example, run rostopic pub chatter std_msgs/String -1 -- "Hello Embedded Linux"
, and see the expected output printed by the subscriber node.
When I try to run them together though (as described by the subscriber tutorial). I am not successful.
Whichever executable I start first (publisher or subscriber) connects to the rosserial_python server and behaves as expected. When I try to start the other executable, it doesn't connect to the server. If I kill the first application while the second is still running, the second one automatically connects to the rosserial_python server and then behaves as expected.
I assume there is some resource conflict here, but I don't understand the setup well enough to diagnose and correct it. The two executables connect from different ports (though they both connect to the server on port 11411).
I am also running everything on the same host machine (i.e., roscore, rosserial_python server, publisher, and subscriber). It's running Ubuntu 18.04. This may be my problem, but as each executable worked individually, it seemed easier to continue with the tutorials on my host machine before moving the embedded executables to a separate device which may be harder to debug.