Packet rate of Velodyne HDL-64E in velodyne_driver [closed]
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
- 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 ...
Thanks for the bug report, I created a github issue for it: https://github.com/ros-drivers/velodyne/issues/11