0
$\begingroup$

Rosanswers logo

Hi Everyone,

I am trying to understand the velodyne_driver code where I found the following:

// get model name, validate string, determine packet rate
private_nh.param("model", config_.model, std::string("64E"));
double packet_rate;                   // packet frequency (Hz)
if (config_.model == "64E")
  {
    packet_rate = 2600.0;
  }
else if (config_.model == "32E")
  {
    packet_rate = 1808.0;
  }
else
  {
    ROS_ERROR_STREAM("unknown Velodyne LIDAR model: " << config_.model);
    packet_rate = 2600.0;
  }

I did not know why the packet rate is 2600 so I checked the Velodyne HDL-64E manual and it writes:

Data Packet Construction

The HDL-64E S2 outputs UDP Ethernet packets. Each packet contains a data payload of 1206 bytes that consists of 12 blocks of 100-byte firing data followed by six bytes at the end of each packet that contains a spin counter and firmware version information. Each packet can be for either the upper or lower laser banks (called “laser blocks”) - each bank contains 32 lasers.

The packet format is as follows:

  • 2 bytes of header info. This header indicates whether the packet is for the upper block or the lower block. The upper block will have a header of 0xEEFF and the lower block will have a header of 0xDDFF.
  • 2 bytes of rotational info. This is an integer between 0 and
  1. Divide this number by 100 to get degrees from 0.
  • 32 laser returns broken into 3 bytes each. Each return contains two bytes of distance information in .2 centimeter [2mm] increments, and one byte of intensity information (0 – 255, with 255 being the most intense return). A zero distance value within the data packet indicates there are no returns up to 120 meters, the maximum range of the device.

This:

The HDL-64E S2 can spin at rates ranging from 300 RPM (5 Hz) to 900 RPM (15 Hz). The default is 600 RPM (10 Hz). Note that changing the spin rate does not change the data rate - the unit will send out the same number of packets (at a rate of 1.3 million data points per second) regardless of spin rate. The image resolution will increase or decrease depending on rotation speed.

And also this:

20,833 points per second, per laser x 64 = 1,333,312 total points per second therefore, the HDL-64E S2 generates greater than 1.3 million points per second.

So, according the the manual:

  • Each packet contains a data payload of 1206 bytes that consists of 12 blocks of 100-byte firing data
  • Each firing data contains 32 laser returns
  • In 1 second the device generates 1 333 312 points.

It means 1 packet contains 384 laser returns therefore the packet rate should be about 3472.

Do I misunderstand something?

Update: Thanks joq! I read both the 64E and the 64E S2 manuals and you are right, they generate different number of point per second. The 64E one generates 1 000 000 points per second meanwhile the 64E S2 generates the mentioned 1 333 312 points per second.

In case of 64E's 1 000 000 points the calculated packet rate is 2604.16 which is almost what you measured.

I checked the 64E S2's 3472.16 packet rate with our device data and it works well.

If you do not mind I would like to create the patch. I am new in ROS and github and I would like to practice.


Originally posted by Gabor Meszaros on ROS Answers with karma: 65 on 2013-07-14

Post score: 2


Original comments

Comment by joq on 2013-07-17:
Thanks for the bug report, I created a github issue for it: https://github.com/ros-drivers/velodyne/issues/11

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The 64E rate is an experimental result with our non-S2 device. I don't have access to an S2. Can you confirm the numbers above with it? If necessary we can add another model designation for the S2.

Update: a patch would be great. I think it'll be straightforward, so you can concentrate on the github mechanics. Just ask, if you need help.

The only other 64E S2 user I've heard from was a couple of years ago. He provided a patch for his angles configuration extensions. Since you have access to an S2, we should set up a unit test of some kind. Perhaps you can supply the angles configuration for your device. The velodyne_pointcloud/params/utexas_64e.yaml is for our older, non-S2 device.

Update2: for anyone using an earlier version of the driver without this fix, here is a work-around for the 64E S2 or S2.1:

$ rosrun velodyne_driver velodyne_node _npackets:=384 _rpm:=600

EDIT: corrected npackets typo (was 348)


Originally posted by joq with karma: 25443 on 2013-07-16

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Gabor Meszaros on 2013-07-17:
Sure, I can give it to you. I have a question about the patch, but I will ask it on the issue's github page. Thank you!

Comment by joq on 2013-07-18:
Good. To keep this from breaking again in the future I'd like a short (~20MB) PCAP dump file from your device. That way I can create a unit test like the existing ones for 32E and our old 64E.

Comment by pengpeng on 2016-05-09:
I find the same quesiton in Velodyne HDL32-E,the horizontal resolution is 0.16 degree,so the package rate is 1875, but I want to know where can I modify the paramter, I have install the driver,Shoud I change the code,then catkin_make by myself?

Comment by joq on 2016-05-09:
The current master uses 1808 for the 32e packet rate. If you believe that is wrong, please open an issue. We can discuss it there.

Comment by joq on 2016-05-09:
You can override the packet rate by explicitly setting the npackets parameter to whatever you like.

Comment by pengpeng on 2016-05-09:
Thank you for your reply,I change the npackets to 1875,But I still can't get a circle,some sectors still had't data,moreover,I compared with the data from the veloview ,I found it had some difference,Can you tell me why

Comment by teddyort on 2016-12-06:
@joq I believe there is a small typo in your workaround

rosrun velodyne_driver velodyne_node _npackets:=348 _rpm:=600

should read

rosrun velodyne_driver velodyne_node _npackets:=384 _rpm:=600

Comment by joq on 2016-12-06:
Thanks! So, noted.

$\endgroup$

Your Answer

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