Buscar este blog

miércoles, 9 de marzo de 2011

Verifying network connection with Player/Stage

1. This is the cfg file that includes the p2os driver:


driver
(
name "p2os"
provides ["position2d:0" "power:0" "sonar:0"]
port "/dev/ttyUSB0"
safe 1
)

2. I first connected Pio to lola and verified the functionality of both the cfg file and the playerjoy interface. Everyting worked fine.

$ robot-player pio.cfg
$ robot-playerjoy

3. I then ran the playerjoy interface on XPS including lola's IP and the port to which player listens (6665). And once again, everything worked just fine.

(on XPS) $ robot-playerjoy 10.48.56.34:6665

4. I then inverted roles and ran the cfg file on XPS. I verified playerjoy's functionality both in XPS and lola and the following error message was being displayed:

create and bind socket():bind() failed; socket not created.: Adress already in use player.

5. By reading forums I figures out that perhaps the problem had to do with the firewall so I enabled in ins XPS and enables access of both hosts to port 6665.

On XPS (10.48.61.241) which had the problem:

$sudo ufw enable
$sudo ufw alow proto tcp from 10.48.61.241 port 6665.
That solved the problem
 
6. Now I have to figure out if ROS' issues have to do with the firewall as well, but I am not sure
in which default port does it listens. It is perhaps 11311 

martes, 8 de marzo de 2011

Running ROS on multiple machines


I am working with two computers: lola and XPS with known IP adresses.
In order for them to identify each other as hosts I indicated their IP adresses on etc/hosts:

10.48.56.34 lola
10.48.61.241 XPS

1. First, they need to ping each other.

On lola:

$ssh lola
$ping XPS

Something like this appears:

PING XPS (10.48.61.241) 56(84) bytes of data.
64 bytes from XPS (10.48.61.241): icmp_seq=1 ttl=64 time=4.35 ms
64 bytes from XPS (10.48.61.241): icmp_seq=2 ttl=64 time=4.79 ms
64 bytes from XPS (10.48.61.241): icmp_seq=3 ttl=64 time=3.65 ms
And then on XPS

$ssh XPS
$ping lola

"ping only checks that ICMP packets can get between the machines, with isn't enough. You need to make sure that you can communicate over all ports.
In lieu of a complete check, you can use netcat to try communicating over an arbitrarily selected port. Be sure to pick a port greater than 1024; ports below 1024 require superuser privileges."

3. I use netcat in order to verify that port 3333 allows communication.

 On lola:

$ nc -l 3333

Then on XPS

$ nc lola 3333

This setups a rustic chat room between computers that works just fine.
 However, when I try inverting the roles of the computers, communication isn't achieved.


That should be causing the unsuccessful running of roscore on XPS. 

II. In spite of knowing something isn't really ok with the network connection of my computers I proceed with the instructions of Getting Started with P2OS which actually worked fine for me before I reinstalled Ubuntu and ROS in lola.

1. I have decided XPS is going to be directly connected to my Pioneer, therefore, lola will be running the master.


2. On lola's setup.sh I comment the line: 

#if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi

And include the following lines:

export ROS_MASTER_URI=http://lola:11311
export ROS_MASTER_IP=http://lola

3. On XPS' setup.sh I comment the same line and include

export ROS_MASTER_URI=http://lola:11311

4. I run roscore on lola and display rxgraph on both computers. /rosout is displayed which seems to indicate roscore is running successfully on them both.

5. I run RosAria node on XPS (which is connected to Pio) and connection is succesfully established.

6. I then run my teleoperation node on lola and while verifying node connection on rxgraph I get the following error:

 ERROR: Communication with node[http://XPS:58281/] failed!

7. Actually,  when I run rxgraph on XPS every single node  and topic seems to be working fine, but in lola RosAria node is enclosed in two red circles which I read indicates connection isn't being fully established.