Buscar este blog

Mostrando entradas con la etiqueta sicklms. Mostrar todas las entradas
Mostrando entradas con la etiqueta sicklms. Mostrar todas las entradas

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;
  }
 
 


 



 

viernes, 23 de julio de 2010

Running the sicklms node and rviz

The sscrovers_laser_pub package is based on the sicktoolbox_wrapper package.

Renato made a modification to the sicklms node which consisted on applying a delay of 22 seconds to it since it is approximately the time that the physical laser takes to power up properly.
I had to modify the ssc_laser.vcg file since with the original one the readings of the laser weren't displayed on rviz. What I did was to check the topics published by and subscribed to the rviz and sicklms nodes.

The changes I made are in lines 5 and 22. Instead of /laser topic I placed /base_scan topic. This worked honestly thanks to a process of trial and error.
In order to run the rviz and sicklms nodes I followed these steps:

1. Run a core

$ roscore

2. Configure the laser port
$ sudo chmod a+rw /dev/ttyUSB1
$ ls -l /dev/ttyUSB1

And s
omething like this should be displayed:

crw-rw-rw- 1 root dialout 166, 0 2009-10-27 14:18 /dev/ttyUSB1

3. Run the sicklms node

$ roscore
$ roscd sscrovers_laser_pub
$ cd bin
$ ./sicklms _port:=/dev/ttyUSB1 _baud:=38400
Connection must be achieved:

Requesting measured value data stream...
Data stream started!

4. Start rviz

$ roscd rviz
$ ./bin/rviz -d `rospack find sscrovers_laser_pub`/ssc_laser.vcg


5. Check the communication among nodes through specific topics

$ rxgraph