mgschwan / blensor

Blender Sensor Simulation
www.blensor.org
Other
180 stars 47 forks source link

Adding VLP-16 to blendodyne #21

Open Galto2000 opened 6 years ago

Galto2000 commented 6 years ago

Hello

I'd like to add a VLP-16 to blendodyne. I understand I can use "generic LIDAR" to simulate a VLP-16, but I have been looking at the code and I think it would be a good exercise for myself (I am a C++ programmer just learning up on Python and bpy) to add it as another sensor supported by blendodyne.

Can you perhaps please give me a high level layout on what files and what portions I need to edit for adding the VLP-16 to blendodyne and perhaps some relevant pointers/advice/caveats, etc... if applicable?

Thank you in advance and also thank you for this great tool!

Galto

mgschwan commented 6 years ago

Dear Galto,

thank you for your message. Support is always welcome.

Adding the VLP-16 does not really require you to implement a whole new sensor, because it is probably very similar to the HDL-32 and HDL-64

Adding it would require you to store an array for the 16 vertical angles (like laser_angles and laser_angles_32), add a new element to the models array, and all the code that makes the distinction between the different types of velodyne sensors.

Take a look at blendodyne.py and search for 32e2 to see where you need to add code to support another sensor.

If you need advice, just let me know

Michael

Galto2000 commented 6 years ago

Thanks Michael

Is there a particular reason why the laser angles appear to be staggered ?

For example the angles for the HDL-32 don't appear to be in a nice successive order, but instead appear to be interleaved pairs of two series (-30.67, -29.33, ...,-10.67) and (-9.33, -8.00, ... 10.67)

laser_angles_32 = [-30.67, -9.33, -29.33, -8.00, -28.00, -6.66, -26.66,
                   -5.33, -25.33, -4.00, -24.00, -2.67, -22.67, -1.33,
                   -21.33, 0.00, -20.00, 1.33, -18.67, 2.67, -17.33,
                   4.00, -16.00, 5.33, -14.67, 6.67, -13.33, 8.00,
                   -12.00, 9.33, -10.67, 10.67]

Thanks

Galto

Galto2000 commented 6 years ago

Got the answer - these are the firing orders

http://velodynelidar.com/docs/manuals/63-9113%20HDL-32E%20manual_Rev%20H_Sept.pdf