Ask Your Question
0

Exporting ROS MASTER URI in shell script

asked 2019-09-13 10:11:54 -0600

mariyaz gravatar image

updated 2019-09-13 11:52:41 -0600

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??

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-13 11:49:24 -0600

ahendrix gravatar image

Could this just be a typo in your shell script? locahost (missing l) instead of localhost?

edit flag offensive delete link more

Comments

Yup that was the issue. It's been a long day haha! Thank you!

mariyaz gravatar imagemariyaz ( 2019-09-13 11:54:23 -0600 )edit

@mariyaz: please accept the answer by @ahendrix by clicking on the checkmark left of the answer (underneath the down-arrow and the 1).

gvdhoorn gravatar imagegvdhoorn ( 2019-09-14 05:29:33 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-09-13 10:11:54 -0600

Seen: 44 times

Last updated: Sep 13