Ask Your Question
0

Turtlebot, Raspberry and Wifi [closed]

asked 2015-07-21 03:52:52 -0500

Ariel gravatar image

updated 2015-07-21 04:16:26 -0500

Hello,

I have a turtlebot which will be running ROS and I also have a Raspberry which has also ROS running. The connection between both of them is with a static IP for the RPI and an ethernet cable. So far so good, I launched roscore in the turtlebot and some launch files in the RPI an it works like it should. The problem is that I would need to access some topics launched in the RPI from another laptop over wifi. So the problem is, if I set the ROS_MASTER_URI with the ethernet of the turtlebot in the RPI, how can I access ROS from the laptop over wifi if I don't use the wifi's IP address as ROS_MASTER_URI?

Maybe this helps a bit:

RPI: Static IP=192.168.7.1 On the turtlebot I have a new ethernet connection (192.168.7.2) and this way I can ssh to the turtlebot to launch my ROS nodes. Therefore, I set ROS_MASTER_URI=http://192.168.7.2 on both turtlebot and RPI. (Ethernet IP).

The issue is that I want to get the topics from another laptop over wifi, as the robot will be moving.....How should ROS_MASTER_URI be configured?

Thanks for any tips!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Ariel
close date 2015-12-09 10:48:28.751680

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-21 04:30:28 -0500

mgruhler gravatar image

updated 2015-07-21 06:55:24 -0500

You need to set the ROS_MASTER_URI to the IP of the PC running the (single) roscore. So if the roscore is running on the turtlebot it should be

ROS_MASTER_URI=http://192.168.7.2:11311

(and don't forget the Port!). And obviously, if the roscore is running on the RPI, set it to this IP.


Update

For general networking problems, there is a good guide line available on the ROS wiki. Check out especially the section on name resolution

edit flag offensive delete link more

Comments

Yes, that's what I did. But I have also the wifi's IP on the turtlebot which is 140.169.147.85 and that would be that one that I should set to ROS_MASTER_URI on the other laptop........I tried that and I get "unable to comunicate to master"

Ariel gravatar imageAriel ( 2015-07-21 04:43:41 -0500 )edit

No, because the roscore is still running on the turtlebot or the RPI, not on the Wifi. (is this a router or an ad-hoc connection to the wifi of the turtlebot?) If you connect to the wifi, can you ping the PC where the roscore is running? Otherwise you might have to add some routes/port-forwards

mgruhler gravatar imagemgruhler ( 2015-07-21 05:30:33 -0500 )edit

The wifi is a router (or access point....not sure.....it's a huge network). From the 'other' laptop I can ping the turtlebot (they are both connected to the wifi). Should I add a static route in the turtlebot, from the ethernet to the wifi? Is that even possible?

Ariel gravatar imageAriel ( 2015-07-21 06:41:53 -0500 )edit

So, from the Laptop from which you want to connect to the roscore you can ping the turtlebot over Wifi? So just set the ROS_MASTER_URI to the respective IP of the PC where the roscore is running. You might however have to set the ROS_IP as well. See updated answer.

mgruhler gravatar imagemgruhler ( 2015-07-21 06:53:42 -0500 )edit

Ok, the problem was the wifi. I switched to another one and ROS_MASTER_URI on the 'other' laptop with the turtlebot's wlan0 IP I can do rostopic list and works. But anyhow, how can I ping directly from the 'other' laptop to the RPI?

Ariel gravatar imageAriel ( 2015-07-21 07:34:29 -0500 )edit
0

answered 2015-11-20 14:39:31 -0500

spottybadrabbit gravatar image

Try this:

README on getting RVIS to work over multiple computers

A common task is to SSH into the robot's computer and run RVIZ to get the laser output and other visualization. Running RVIZ directly on the remote computer will not work due to the way RVIZ is implemented. The workaround is to run RVIZ locally. To do this we need to set the local computer to locate the remote MASTER NODE in order to display the right information.

Assume: IP: 192.168.1.0 // remote computer (robot) IP: 192.168.1.1 // local computer (host)

* ssh into remote computer * 1. ssh -X erratic@192.168.1.0

At the remote terminal: 2. export ROS_MASTER_URI=http://192.168.1.0:11311 //this ensures that we do not use localhost, but the real IP address as master node

  1. export ROS_IP=192.168.1.0 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)

  2. roscore

At the local terminal: 1. export ROS_MASTER_URI=http://192.168.1.0:11311 //tells local computer to look for the remote here

  1. export ROS_IP=192.168.1.1 //this ensures that ROS knows that we cannot use hostname directly (due to DHCP firewall issues)

  2. rosrun rviz rviz // fires up rviz on local computer. It will attach to the master node of the remote computer

* to check, open a remote terminal * 1. rxgraph

** Note, everytime a new terminal is open on the local/remote computer, we have to call the 2 exports commands. To make this permanent, edit the ~/.bashrc file: 1. sudo gedit ~/.bashrc //add the two export commands at the end of the file.

  1. source ~/.bashrc //and restart terminal
edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-07-21 03:52:52 -0500

Seen: 865 times

Last updated: Jul 21 '15