heethesh / lidar_camera_calibration

Light-weight camera LiDAR calibration package for ROS using OpenCV and PCL (PnP + LM optimization)
BSD 3-Clause "New" or "Revised" License
528 stars 117 forks source link

point cloud tab only show a few points (Ouster LiDAR) #26

Closed snakehaihai closed 3 years ago

snakehaihai commented 3 years ago

Hi thanks for the work I`ve read through all the posts and solved some of the bugs such as the color issues. mpl versions issue > 2.0

I`m using os 1 ldiar with 10hz rate and camera at 10 hz as well. I adjust the slop between 0.1 to 0.5 and change the inrange function of ldiar to various number. but i can't get the full point cloud to display properly image

I eventually removed all teh inrage and tried to display all points. but problem it is still 2points. May i ask what could be the issue?

snakehaihai commented 3 years ago

hi I found out that ouster lidar has shape of (16, 1024, 9) is it because of this that we have issue?

heethesh commented 3 years ago

Yes, it could be. Looks like the Ouster LiDAR data is organized or grouped by the beams. Does your sensor have 16 beams?

snakehaihai commented 3 years ago

Thanks for the quick response. Yes my lidar is 16 line lidar. I saw your video has 2 number 384, 4. what does those mean?

heethesh commented 3 years ago

I believe that was the intensity channel data, which is only used for visualization colors here. Just make sure the points array has N rows, corresponding to all points from all beams, and the first 3 columns represent X, Y, Z data. You may just disable the color map if you don't have an intensity channel. Apologies, I have not tested this on Ouster data, this was only tested on a Velodyne point cloud.

Thanks for the quick response. Yes my lidar is 16 line lidar. I saw your video has 2 number 384, 4. what does those mean?

N = 384 points (after filtering point in range), 4 columns representing X, Y, Z, intensity data

snakehaihai commented 3 years ago

the 9 means x y z intensity t reflectivity ring noise range So i should merge 16 ring with each 1024 points into one single 1024x16 points?
then behind remove t reflective ring noise range?

heethesh commented 3 years ago

Try this out points = points.reshape(-1, 9)[:, :4] add this on line 230, right after the data is loaded from the ROS message. This will remove the beam grouping and pick the first 4 columns for X, Y, Z, intensity - you can still use the color mapping now too.

snakehaihai commented 3 years ago

Try this out points = points.reshape(-1, 9)[:, :4] add this on line 230

image

this is the correct solution i can see the depth now

I saw some other dude also have issue with ouster. OS-1 might be good to update to him as well

thanks bro

heethesh commented 3 years ago

Updated master now. If you are using Ouster LiDAR, set OUSTER_LIDAR = True here.