Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Exporting ROS MASTER URI in shell script

I am trying to export ROS_MASTER_URI from a shell script and then launch roscore. In my .sh file I have:

roxterm --tab -e $SHELL -c "cd $CATKIN_WS; $srcdevel; export ROS_MASTER_URI='http://locahost:1234'; roscore -p 1234"

When I do this, however, I get the following error in the roscore tab:

WARNING: ROS_MASTER_URI [http://locahost:1234] host is not set to this machine.

When I echo the ROS_MASTER_URI in this tab, it says that it is localhost:1234, which is correct. When I manually execute these commands, it works correctly and roscore launches without any issues. I am not sure why it does not work when launched from a bash file. It seems as if exporting the ROS MASTER URI only works if it is run directly in the terminal, and not through a bash file. This can't really be the case, though, can it??

Exporting ROS MASTER URI in shell script

I am trying to export ROS_MASTER_URI from a shell script and then launch roscore. In my .sh file I have:

roxterm --tab -e $SHELL -c "cd $CATKIN_WS; $srcdevel; export ROS_MASTER_URI='http://locahost:1234'; roscore -p 1234"

When I do this, however, I get the following error in the roscore tab:

WARNING: ROS_MASTER_URI [http://locahost:1234] host is not set to this machine.

When I echo the ROS_MASTER_URI in this tab, it says that it is localhost:1234, which is correct. When I manually execute these commands, it works correctly and roscore launches without any issues. I am not sure why it does not work when launched from a bash file. It seems as if exporting the ROS MASTER URI only works if it is run directly in the terminal, and not through a bash file. This can't really be the case, though, can it??