0
$\begingroup$

Rosanswers logo

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


Originally posted by mzouros on ROS Answers with karma: 3 on 2020-12-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2020-12-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by mzouros on 2020-12-23:
Tutorial says so. I just forced edited the rc file as you proposed. Seems to work. Thanks!

Comment by gvdhoorn on 2020-12-24:
Which tutorial?

Comment by mzouros on 2020-12-24:
ROS/NetworkSetup - 2.2. Single Machine Configuration http://wiki.ros.org/ROS/NetworkSetup

Comment by gvdhoorn on 2020-12-24:
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.

$\endgroup$

Your Answer

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