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

Ros Networking

asked 2017-05-22 10:05:00 -0500

polin gravatar image

updated 2017-05-25 03:28:04 -0500

gvdhoorn gravatar image

My setup:

export ROS_HOSTNAME=alpa
export ROS_MASTER_URI=http://alpha:11311

export ROS_HOSTNAME=betha
export ROS_MASTER_URI=http://alpha:11311

I ran turtlesim_node on the first machine and the turtle_teleop_key on the second machine. i have already launch the roscore on the Master machine, the turtlesim and turtle_teleop_key launch well but i dont have the remote when I tooch the key to move the turtle.

someone has an idea ?

thanks


Edit: any hostname is attach at one Ip adress different. when i ping r2d2 on c3po i have the exchange. The connection between the 2 ros is good because I can start the master and the processes start on each pc starts without error but not the control

i want to do with the teleop_key

export ROS_HOSTNAME=r2d2 
export ROS_MASTER_URI=http://c3po:11311.

I run turtlesim in this machine

export ROS_HOSTNAME=c3po 
export ROS_MASTER_URI=http://c3po:11311

in this one I ran firts roscore and turtle_teleop_key, all ran well but no romote of turtlesim by turtle_teleop_key.

help please

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-05-22 10:20:49 -0500

gvdhoorn gravatar image

updated 2017-05-25 03:49:14 -0500

Please see wiki/ROS/MultipleMachines.

You only run a single master, so both ROS_MASTER_URI variables should point to the same IP (ie: the one running your roscore).

Additionally: the value of ROS_HOSTNAME is used by ROS nodes to identify who is 'talking' to them. But localhost is a special hostname, that will (should?) always resolve to the local machine (at 127.0.0.1). It is therefore not usable to configure a distributed (ie: networked) ROS nodegraph.

Make sure to use either globally resolvable hostnames or don't set ROS_HOSTNAME, but set ROS_IP to the IP of the network interface that you use to connect both computers to the same network.


Edit: the first version of your question used localhost everywhere, the second c3po and r2d2 and your last version now uses alpha and betha. Can you confirm that those hostnames actually resolve to IPs? The values you set for ROS_HOSTNAME have to actually be existing hosts on your network, you cannot just make something up.

On alpha, what is the output of ping betha (or on c3po, what is the output of r2d2)?


export ROS_HOSTNAME=r2d2 
export ROS_MASTER_URI=http://c3po:11311

Edit 2: just making sure: you are exporting those variables in all terminals that you start ROS programs in? Or do you have those export lines added to your .bashrc?

If you haven't, add the export lines to your .bashrc on both machines (for now, at least). Close all terminals.

Now on c3po:

  • open a new terminal: start roscore in it
  • open a new terminal: run the following:

    rostopic pub -r1 /chatter std_msgs/String "something"
    

Now on r2d2:

  • open a new terminal: run the following:

    rostopic echo /chatter
    

you should now see rostopic printing "something" once per second.

To make sure everything us working, do the reverse (so start rostopic pub -r1 .. on r2d2 and rostopic echo .. on c3po).

If you don't get any output from rostopic echo .. on r2d2, your network setup is not correct. In that case, try a rosnode ping /rosout on r2d2.

edit flag offensive delete link more

Comments

See the change - export ROS_HOSTNAME=r2d2 export ROS_MASTER_URI=http://c3po:11311. I run turtlesim in this machine - export ROS_HOSTNAME=c3po export ROS_MASTER_URI=http://c3po:11311 in this on I ran roscore and turtle_teleop_key , all ran well but no romote of turtlesim by turtle_teleop_ke

polin gravatar image polin  ( 2017-05-23 04:05:30 -0500 )edit

Please edit (add, not overwrite) your original question with this new information. The comments are not really suited for these things.

Also: please clarify what you mean with "all ran well".

gvdhoorn gravatar image gvdhoorn  ( 2017-05-23 04:07:50 -0500 )edit

Question Tools

Stats

Asked: 2017-05-22 10:05:00 -0500

Seen: 457 times

Last updated: May 25 '17