DeeperGTAV icon indicating copy to clipboard operation
DeeperGTAV copied to clipboard

Is there a way to generate a depth (or disparity) map based on the Lidar data?

Open yipengm opened this issue 6 years ago • 1 comments

I am new to auto-driving. I am confused of the Lidar output here:

For example: I copy the Lidar definition in dataset.py [3,False,100.0,1200,60.0,300.0,20.85.0,115.0]

(3D scaled Cone, laser max range:100, sample number:1200, left_limit:60.0, right_limit:300, vertical sample number:20, vertical upper degree:85 vertical under degree:115 )

First I am a little confused about the angle definition:

"left_limit:60.0, right_limit:300"

Does it mean the range is from 60 to 360 degrees? (I feel a little strange because 300 degree is a reflex angle)

If I want to achieve the range within following, what parameter set should I use? img_0027

and what I get is a 1-D array with 1200 elements which also confused me: I think normally the lidar output should be the 3d coordinate per sample point. What's the meaning of the value?

yipengm avatar Oct 14 '18 05:10 yipengm

  1. About 3D points: I only need lidar ranges instead of coordinates in my previous work. Therefore it outputs ranges. Certainly it can output the 3d coordinate per sample point. In lidar.cpp row 512:
range = sqrt((endCoord.x - _curPos.x) * (endCoord.x - _curPos.x) +
	(endCoord.y - _curPos.y) * (endCoord.y - _curPos.y) +
		(endCoord.z - _curPos.z) * (endCoord.z - _curPos.z));

The endCoord is what you need. I save each range in float *_pointClouds. If you want to save 3D points in it, you may need expand float *_pointClouds with malloc, which is an 1-D array. 2. About degree: Horizontal angle: The forwad is 0°;The left is range from 0° to 179.999... °; The right is range from 180° to 359.999...°. Vertical angle: The forward is 90°; The upper is range from 0° to 89.999...°; The under is range from 90° to 180.0°. 3. About your configuration: Hor: left_lim=60, right_lim=300; Ver: upper_lim=85, under_lim=115; The picture you draw is what the default parameter means. You can alter the False in 2rd param with True. Each lidar point will show in the game.

gdpinchina avatar Oct 15 '18 02:10 gdpinchina