0
$\begingroup$

Rosanswers logo

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


Originally posted by mariyaz on ROS Answers with karma: 1 on 2019-09-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by ahendrix with karma: 47576 on 2019-09-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by mariyaz on 2019-09-13:
Yup that was the issue. It's been a long day haha! Thank you!

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.