ankitdhall / lidar_camera_calibration

ROS package to find a rigid-body transformation between a LiDAR and a camera for "LiDAR-Camera Calibration using 3D-3D Point correspondences"
http://arxiv.org/abs/1705.09785
GNU General Public License v3.0
1.52k stars 461 forks source link

How to get accurate inital ros_x, rot_y, rot_z? #64

Closed oaix closed 5 years ago

oaix commented 5 years ago

The precision of inital ros_x, rot_y, rot_z will impact final rotation matrix.

qlidarToCamera = Eigen::AngleAxisd(config.initialRot[2], Eigen::Vector3d::UnitZ()) *
                   Eigen::AngleAxisd(config.initialRot[1], Eigen::Vector3d::UnitY()) *
                   Eigen::AngleAxisd(config.initialRot[0], Eigen::Vector3d::UnitX());
lidarToCamera = qlidarToCamera.matrix();
Eigen::Matrix3d final_rotation = rotation_avg * lidarToCamera;
xinwf commented 5 years ago

Can we have a communication about this project? I can't get any result, when the window pop up, there is no any dots on it, just a black window, I don't know what should I do

oaix commented 5 years ago
xinwf commented 5 years ago

@oaix , hi, I can't get the point cloud in the camera's view, our lidar is also VLP16, and the camera towards to the forward direction with lidar, so I haven't modified the rotation matrix ros_x, ros_y and ros_z, is there any problem about this setting? Can you give me some help? How can I get the coordinate of the camera and then get the rotation rad from lidar to camera? And another question is if I set the limits of visible area of point cloud to a large value, can I see many points in the window? Or I can't see anything if the rotation matrix is wrong?

oaix commented 5 years ago

@xinwf 如果你用的是velodyne的雷达,那么坐标系和源码中是一致的,只要你的相机雷达和标定板的位置和文中一致,就可以用他们的初始化旋转角。

XinWenfei commented 5 years ago

@oaix ,标定板位置是一致的,标定的marker也是一样的,但是激光雷达和camera的位置摆放不一样,在同一个中轴线上,但是有一个大约30cm的高度差,前后距离大概还有60cm左右,激光雷达在后,摄像头在前,弹出来的cloud的窗口只有标定板的上面一部分,不知道这个高度差还有前后的距离差是不是对标定程序有严重影响,这个代码里面也没有可以设置激光雷达到相机相对距离的地方,是不是这个程序要求摄像头和激光雷达必须在同一水平面啊

xinwf commented 5 years ago

@oaix, 说错了,高度差大概有80cm

oaix commented 5 years ago

@xinwf 你给一个平移量就可以了,源码里面给的[0, 0, 0],也就是下面的x, y, z的值 transform(board_edge_cloud, x, y, z, config.initialRot[0], config.initialRot[1], config.initialRot[2]);

xinwf commented 5 years ago

@oaix ,非常感谢!不过再多问一些啊,这里的x,y,z应该怎么样取值呢,首先,这个校准是激光雷达到相机,所以应该以相机为原点,xyz是雷达到相机的平移量,对吧?第二个就是,xyz取值问题,是距离量还是坐标量,距离量就都是正的,坐标量就会有正负,如果是坐标量的话,是激光雷达在相机坐标系中的坐标吗,还是坐标取反表示平移量,例如,雷达在相机坐标系(Z向前,Y向下,X向右)中的坐标为(0,-0.8,-0.5),那么平移量就是[0, -0.8, -0.5]还是[0, 0.8, 0.5]

ailovejinx commented 5 months ago

@oaix ,非常感谢!不过再多问一些啊,这里的x,y,z应该怎么样取值呢,首先,这个校准是激光雷达到相机,所以应该以相机为原点,xyz是雷达到相机的平移量,对吧?第二个就是,xyz取值问题,是距离量还是坐标量,距离量就都是正的,坐标量就会有正负,如果是坐标量的话,是激光雷达在相机坐标系中的坐标吗,还是坐标取反表示平移量,例如,雷达在相机坐标系(Z向前,Y向下,X向右)中的坐标为(0,-0.8,-0.5),那么平移量就是[0, -0.8, -0.5]还是[0, 0.8, 0.5]

hi, xinwf, I also met this problem. Have you figured out the problem?