0
$\begingroup$

Rosanswers logo

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


Originally posted by polin on ROS Answers with karma: 1 on 2017-05-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2017-05-22

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by polin on 2017-05-23:
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

Comment by gvdhoorn on 2017-05-23:
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".

$\endgroup$

Your Answer

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