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.

miércoles, 16 de febrero de 2011

Camera calibration

Today I ran the cameracalibrator configuration file. I had to make some modifications to it due to the node I am using to communicate with the camera.


First, I verified that the camera's topics were being published.

$rostopic list


/usb_cam/camera_info
/usb_cam/image_raw



I then modified the node in the cameracalibrator.py file:

In line 128 instead of camera node we place usb_cam node:

        self.set_camera_info_service = rospy.ServiceProxy("%s/set_camera_info" % rospy.remap_name("camera"), sensor_msgs.srv.SetCameraInfo)

        self.set_camera_info_service = rospy.ServiceProxy("%s/set_camera_info" % rospy.remap_name("usb_cam"), sensor_msgs.srv.SetCameraInfo)






In line 100 as well:

            for svcname in ["camera", "left_camera", "right_camera"]:
            

            for svcname in ["usb_cam", "left_camera", "right_camera"]:


Now, in order to run the cameracalibrator node we must specify the topics we are using:


$rosrun camera_calibration cameracalibrator.py --size 6x4 --square 0.0508 image:=/usb_cam/image_raw camera:=/usb_cam

Here is a screenshot of the program's functionality:


 

lunes, 14 de febrero de 2011

Error message with Genius webcam

I was provided a new webcam to work with. It is a Genius Slim 1322AF. When trying to run usb_cam node (on dev/video1) I get the following error message:

VIDIOC_S_FMT error 22, Invalid argument


I have tested it on Ubuntu's Cheese Webcam Booth application and it works fine so I don't think the problem lays on the driver.

I am very tired... and haven't found any satisfying answer on linux forums so I'm just going to ask someone on ROS' mailing list.

jueves, 3 de febrero de 2011

Running usb_cam node

I have created a launch file with the help from this guide: http://www.princeton.edu/~ctralie/Projects/DukeDusty2/Tutorial/
Note: /dev/video0 is the device of the integrated webcam of my laptop and /dev/video1 is the device of the Logitech Quickcam I am currently using.

When running this launch file with the /dev/video0 device I can successfully visualize video on rviz. However, a status error is displayed:

CameraInfo/P resuted in an invalid  position calculation (nans or infs)

According to ROS users, I should calibrate my camera in order to avoid this error. I had no idea on how to do so until I found this tutorial:

http://www.ros.org/wiki/camera_calibration/Tutorials/MonocularCalibration. I hope this does the trick.









miércoles, 2 de febrero de 2011

Reconfiguring sicklms node

Well, after reinstalling everything in my computer and losing all my backup data (I dropped my external hard drive ¬¬), I have ROS running again.

I had some issues while configuring the sicklms node. I downloaded the original code from a ROS repository and the following error was being displayed:

A scan was probably missed. The last scan was 0.10704 seconds ago. sicklms.

I sent my inquiry to the mailing list and this was the answer.

"See https://code.ros.org/trac/ros-pkg/ticket/4673 for a ticket about that warning. How is your SICK connected to the computer? RS232 or RS422? With or without a USB->Serial adapter? At what rate should you be getting scans from the LIDAR as currently configured? 10Hz?

Is the SICK driver set to less than one degree of angular resolution? I only see this warning with my LMS291's when they are set to 0.5 degree angle increments. With 1 degree increments the warning is not output."
 
So I downloaded the code that the SSC Rovers team uses for the sicklms and it, i fact, had some differences with the degree angle increments. 
 
  }
  if (inverted) {
    scan_msg.angle_min = M_PI/2;
    scan_msg.angle_max = -M_PI/2;
  } else {
    scan_msg.angle_min = -M_PI/2;
    scan_msg.angle_max = M_PI/2;
  }
  scan_msg.angle_increment = (scan_msg.angle_max - scan_msg.angle_min) / (double)(num_values-1);
  scan_msg.scan_time = scan_time;
  scan_msg.time_increment = scan_time / (double)(num_values-1);
  scan_msg.range_min = 0;
  if (scale == 0.01) {
    scan_msg.range_max = 81;
  }
  else if (scale == 0.001) {
    scan_msg.range_max = 8.1;
  }
 
 


 



 

miércoles, 12 de enero de 2011

usb_cam and rviz compilation

While I am waiting for the Logitech Pro 9000 camera to arrive I am provisionally working with an IBM webcam.

Today I installed and compiled the usb_cam package created by bosch.

The repository was taken from the following source: https://bosch-ros-pkg.svn.sourceforge.net/svnroot/bosch-ros-pkg/trunk/stacks/bosch_drivers/usb_cam

And the only trouble I went through during compilation was the following message: mkdir: cannot create directory `build': Permission denied

This problem was solved by changing the permissions of the directory using chmod as follows:

$ sudo chmod ugo+rwx usb_cam

Aftewards, I tested rviz's execution (since I am using a new laptop because my own is going through some BIOS dilemmas... long story...). And while i was compiling I got the following error:

Caught exception while loading: OGRE EXCEPTION(7:InternalErrorException)

It was easily solved by installing some of the missing packages of my video card:

$ nvidia-cg-toolkit-installer --install

I am currently trying to recover the configuration of my laptop without losing any data in order to continue with my navigation tasks. Meanwhile I am starting to make some tests with the mentioned camera.