ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

export ROS_HOSTNAME, ROS_MASTER_URI configuration problem

asked 2020-12-23 12:12:55 -0600

mzouros gravatar image

updated 2022-04-30 13:34:36 -0600

lucasw gravatar image

Hello all,

I was trying all day to figure out why my cmd won't accept my arrow keys as input for the turtlesim example. At first I though there was some configuration problem with the shell I use (zsh). After experimenting a little I noticed that I need to export ROS_HOSTNAME and ROS_MASTER_URI in all 3 tabs I need to run the turtlsime example. So in each tab I go like:

  1. export ROS_HOSTNAME=localhost --- export ROS_MASTER_URI=http://localhost:11311 --- roscore
  2. export ROS_HOSTNAME=localhost --- export ROS_MASTER_URI=http://localhost:11311 --- rosrun turtlesim turtlesim_node
  3. export ROS_HOSTNAME=localhost --- export ROS_MASTER_URI=http://localhost:11311 --- rosrun turtlesim turtle_teleop_key

Only then my cmd will accept my arrow keys as input and I will see the turtle moving. Any idea what I am doing wrong? Is there a way I can avoid this? Like run it once, even if I need to restart my PC?

Thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-23 14:06:19 -0600

gvdhoorn gravatar image

I'm not sure why you need to set ROS_HOSTNAME to localhost, but to avoid having to set these environment variables manually, add them to whichever file your shell loads/parses/sources when you start/log into a new shell.

edit flag offensive delete link more

Comments

Tutorial says so. I just forced edited the rc file as you proposed. Seems to work. Thanks!

mzouros gravatar image mzouros  ( 2020-12-23 15:19:24 -0600 )edit

Which tutorial?

gvdhoorn gravatar image gvdhoorn  ( 2020-12-24 02:22:16 -0600 )edit

ROS/NetworkSetup - 2.2. Single Machine Configuration http://wiki.ros.org/ROS/NetworkSetup

mzouros gravatar image mzouros  ( 2020-12-24 03:52:45 -0600 )edit

I would not expect that to be necessary for a single machine setup.

I would recommend you try running things without setting those variables, and then see whether things work. If things don't work without those variables, that would point to a potential issue with your network configuration.

gvdhoorn gravatar image gvdhoorn  ( 2020-12-24 07:07:51 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-12-23 12:12:55 -0600

Seen: 574 times

Last updated: Dec 23 '20