velodyne icon indicating copy to clipboard operation
velodyne copied to clipboard

Testing and Support for Dual-Return Mode

Open JWhitleyWork opened this issue 6 years ago • 9 comments

Dual-return mode does not seem to be properly implemented (as mentioned by #109 and shown by the problems enabling it causes in #193). This is a reminder item to eventually add full, working support for dual-return mode to the driver.

JWhitleyWork avatar Dec 05 '18 23:12 JWhitleyWork

@JWhitleyAStuff I'd like to look into this, but it is unclear to me how this would be implemented such that it works correctly for all lidar models. Any pointers?

andre-nguyen avatar Dec 20 '18 17:12 andre-nguyen

This isn't by any means the only way but, if I was handling this, I would do the following:

  • Create a launch file parameter called "dual_return_mode" with true/false values.
  • Modify the packet_rate values for each sensor in velodyne_driver in driver.cc if the above launch parameter is true.
    • For the HDL-64E S3, see page 50 of this document: https://velodynelidar.com/lidar/products/manual/HDL-64E%20S3%20manual.pdf
    • For the HDL-64E S2 and S2.1, see page 37 of this document: https://www.velodynelidar.com/lidar/products/manual/63-HDL64E%20S2%20Manual_Rev%20D_2011_web.pdf
    • For the VLP-32C, see page 50 of this document: https://velodynelidar.com/docs/manuals/63-9325%20REV%20B%20MANUAL,USERS,VLP-32.pdf
    • For the HDL-32E, see page 54 of this document: https://velodynelidar.com/docs/manuals/63-9113%20REV%20M%20MANUAL,USERS,HDL32E.pdf
    • For the VLP-16, see page 50 of this document: https://velodynelidar.com/docs/manuals/63-9243%20REV%20D%20MANUAL,USERS,VLP-16.pdf
  • At line 94 of transform.cc in the velodyne_pointcloud, unpack() gets called. When in dual return mode, you'll essentially need to manage two VPointCloud objects here and alternately populate them using unpack. You should them be able to publish them to two different topics (I suggest velodyne_points_strongest and velodyne_points_last).

Here are some documents that should help with understanding the modifications to the data structures in dual return mode:

https://velodynelidar.com/docs/notes/63-9277%20Rev%20B%20HDL-32E%20Application%20Note%20-%20Packet%20Structure%20&%20Timing%20Definition.pdf (see the page "Data Block Structure in Dual Return Mode")

https://velodynelidar.com/docs/manuals/63-HDL64ES3%20REV%20J%20MANUAL,USERS%20AND%20PROGRAM%20GUIDE,HDL-64E%20S3.pdf (see Dual Returns on page 15)

https://velodynelidar.com/docs/manuals/63-9243%20REV%20D%20MANUAL,USERS,VLP-16.pdf (see page 57)

I hope this helps. Please let me know if you have further questions.

Note: I just realized that the packet_rate value for the HDL 64E S3 is incorrect in the driver. It's currently configured for the dual-return mode value. It should default to the single-return-mode value.

JWhitleyWork avatar Dec 20 '18 20:12 JWhitleyWork

@JWhitleyAStuff Excellent pointers, I can definitely look into the VLP16 part as that's what I have on hand, we'll see later for the others.

andre-nguyen avatar Dec 20 '18 23:12 andre-nguyen

Questions:

  1. Right now we have a single /points topic and you would like to split it into the /strongest and /latest topics. Should we check the factory bytes and publish to one of the other topic or should we base ourselves on the ros param? I'm thinking ideally, we should use the factory bytes as it will end up being more user friendly.
  2. The manual mentions "If only one return was detected, the data will be identical in the even|odd block pairs (0|1, 2|3, 4|5, 6|7, 8|9, 10|11)" Should we check for this to not double publish points?

andre-nguyen avatar Dec 21 '18 22:12 andre-nguyen

  1. The downside to this method is that you won't know until you receive the first couple of blocks which means the topics won't be available until after that. You could do this and publish all three with /points containing all of them and the other two just containing those types. Doesn't matter much to me. Either way is fine.
  2. I would publish the double points on both topics because, if someone is only using one of the topics as their points source, they will be missing those returns.

JWhitleyWork avatar Dec 22 '18 17:12 JWhitleyWork

Is this resolved ? I just realized there is no option for dual-return in the parameter of the driver, OR will it be resolved if I just change the packet to the correct number if using dual return ?

sorry to bump an old thread

w4rlock999 avatar Jun 30 '20 10:06 w4rlock999

@w4rlock999 Unfortunately, no. There was a start on it but the developer was waiting on me to provide PCAP files from several sensors and I ended up leaving the job where I had access to them in order to test it. Would you be interested in working on the feature?

JWhitleyWork avatar Jul 28 '20 03:07 JWhitleyWork

Are the changes in #208 still relevant for supporting dual return, or has master changed too much?

I have access to a VLP-16 at work, and we are thinking about experimenting with dual return.

FSund avatar Oct 04 '22 06:10 FSund

I'm going to take a guess that you might be able to reuse the stuff in rawdata.cc but everything else would have to be rewritten.

andre-nguyen avatar Oct 04 '22 15:10 andre-nguyen