Messages not received on master when the talker runs from startup
Hi, I have a detection node acting as a talker (det_talker.py
) on one Ubuntu 16.04 machine and another node acting as a listener (det_listener.py
). I intend to run the listener on master (an Ubuntu 14.04 machine) to receive the messages being sent from the talker. When I run the talker from a terminal followed by the listener on the master, I can see the messages being received on the master.
However, when I run the same talker node by putting the necessary commands for sourcing the setup.bash file as well as configuring the IP for the master in a bash script and run this script from startup (by adding the script in Startup Applications), I cannot see any messages on the master.
Configuration on the machine with the talker node:
- ROS_MASTER_URI = http://ubuntu14_ip:11311
- ROS_IP = ubuntu16_ip
Configuration on the machine which acts as master:
- ROS_MASTER_URI = http://ubuntu14_ip:11311
- ROS_IP = ubuntu14_ip
I have tried changing the ROS_IP on master to ubuntu16_ip but the result is still the same. The script I am using to run the detection node from system startup looks like follows:
#!/bin/bash
cd /home/rahul
export ROS_MASTER_URI = http://ubuntu14_ip:11311
source ./catkin_ws/devel/setup.bash
cd catkin_ws
rosrun detection_node det_talker.py
I have tried running this bash script from a terminal; it runs successfully and I can see the messages on master when I run the det_listener.py node. Only when I run it from startup, there are no messages (the node does run, however).
Furthermore, I can see on the master that the node is running because it shows the node when I run rosnode list
and rostopic list
commands. I should also mention that Ubuntu 16 has Kinetic and Ubuntu 14 is running an Indigo version of ROS. The reason why I think different versions should not pose a problem because I can indeed get the messages when executing the node from terminal.
My question is how do I get the messages to be received on the master by running the talker from startup. Thanks.
Edit: A cross-post on SO is here.