HITSZ-NRSL / lidar_camera_calibrator

ROS package to calibrate the extrinsic parameters between LiDAR and Camera.
GNU General Public License v3.0
176 stars 23 forks source link

How do I get LiDAR params? #2

Closed januarkai closed 2 years ago

januarkai commented 2 years ago

"PerspectiveParams": # perspective of pcl_viewer "filter": # The following parameters represent an annular sector area, and the points inside the area will be used to extract the board point cloud. "angle_start": # the starting angle "angle_size": # the angle range "min_distance": # the inside radius "max_distance": # the outer radius "ceil_gap": # the distance to the highest point of the point cloud "floor_gap": # the distance to the lowest point of the point cloud "min_distance_threshold": # the upper limit of min_distance "max_distance_threshold": # the upper limit of max_distance "max_ceil_gap": # the upper limit of ceil_gap "max_floor_gap": # the upper limit of floor_gap

yanliang-wang commented 2 years ago

Hi, @januarks14 , that is a good question that I didn't include in the README.

Firstly, angle_start, angle_size, min_distance, max_distance, ceil_gap, and floor_gap are parameters of a region which contains the calibration plane point cloud. You can test this project with our data to understand the detailed meaning of these parameters.

Before the calibration, you only need to set min_distance_threshold, max_distance_threshold, max_ceil_gap, and max_floor_gap because other params can be set in the Qt GUI. And the relationship between these parameters is as follows.

0 < angle_start < 360
0 < angle_size < 360
0 < min_distance < min_distance_threshold
0 < max_distance < max_distance_threshold
0 < ceil_gap < max_ceil_gap
0 < floor_gap < max_floor_gap

Hope it helps you.

januarkai commented 2 years ago

Thank you for the answer, it help me a lot. But I still got bad calibration result. Here is the config.json I got: { "cam": { "D": [ -0.220206, 0.141516, -0.001165, -0.001723, 0.0 ], "K": [ [ 1361.81689, 0.0, 704.87572 ], [ 0.0, 1369.12754, 436.48622 ], [ 0.0, 0.0, 1.0 ] ] }, "lidar_pose": "descend", "pc": { "PerspectiveParams": [ -9.524364, -1.442703, 5.006819, 0.262149, -0.014307, 0.964921 ], "filter": { "angle_size": 158.0, "angle_start": 297.0, "ceil_gap": 2.0, "floor_gap": 1.0, "max_ceil_gap": 10.0, "max_distance": 6.4, "max_distance_threshold": 15, "max_floor_gap": 10, "min_distance": 0.0, "min_distance_threshold": 0 }, "plane": { "distance_threshold": 0.06, "point_num_min": 20 } }, "size": 4, "tag_size": [ 0.89, 1.25, 0.12 ], "tf": [ [ 0.871155, 0.231576, -0.432967, -0.827489 ], [ -0.0800827, -0.802975, -0.590609, 3.97292 ], [ -0.484433, 0.549185, -0.68097, -4.26191 ], [ 0.0, 0.0, 0.0, 1.0 ] ] } I also attached my calibration result here: https://drive.google.com/file/d/10NaevWpwrqMRYFrgZGPJ6Hn9FrJLAdea/view?usp=sharing And for the tag size, what is actually "height"?. I have chessboard with width=1.25m and height 0.89m, is my tag size configuration is correct?. Thank you.

yanliang-wang commented 2 years ago

Hi, @januarks14 , your configuration looks like correct. I wonder whether you got the appropriate calibration board point cloud like this during calibration. image

januarkai commented 2 years ago

During calibration, I did it in this way> Selection_003

yanliang-wang commented 2 years ago

OK, I think the problem is that you didn't place the calibration board obliquely like this, which is important for this project.

Try again according to the attention for preparing the data.

januarkai commented 2 years ago

Ok, thank you for your help. I will post the result here when it's done.

yanliang-wang commented 2 years ago

Hi, @januarks14 , I just ran into a bug caused by cv::solvePnP. I fixed it in the latest commit. Maybe this version can have a good result for your data.

januarkai commented 2 years ago

Hi Yanliang, Thank you for your update. I have tried it and it gives me a better result. The result is not really good, maybe because of my data. And the third party program is still using OpenCV3 so if anyone is using OpenCV4, the syntax should be converted first.

On Thu, Mar 17, 2022 at 4:46 PM Yanliang Wang @.***> wrote:

Hi, @januarks14 https://github.com/januarks14 , I just ran into a bug caused by cv::solvePnP. I fixed it in the latest commit. Maybe this version can have a good result for your data.

— Reply to this email directly, view it on GitHub https://github.com/HITSZ-NRSL/lidar_camera_calibrator/issues/2#issuecomment-1070669855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCJAIJMOABWQMNW7VYEVOLVAL5O3ANCNFSM5Q5YJEDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

yanliang-wang commented 2 years ago

I also think the possible reason is that your data are not good. You can have a try with the new data that are obtained with the attention for preparing the data.

And many thanks for your reminder about OpenCV

januarkai commented 2 years ago

I got it. Thank you.