Code Monkey home page Code Monkey logo

camera_lidar_calibration_v2's Introduction

Camera Lidar Calibration Tool ROS Version.

building

Author:xinliangzhong([email protected])

demo0

demo

怎么使用

##步骤0: 将解压包放到一个ros工作空间,并使用以下命令进行编译

catkin_make --pkg camera_laser_calibration

如果遇到cv_bridge的错误那请将Cmakelists.txt第12行取消注释 如果提示ceres未安装,请按照ceres官方指示进行安装操作

步骤1:

进入到ros工作空间

source devel/setup.bash

然后运行

roslaunch camera_laser_calibration collect_laser_image_data.launch

进入到你要用于标定的bag文件目录下 并执行

rosbag play --pause XXX.bag

此时记得用空格键来控制bag的播放与暂停

开启一个新的终端 启动rqt 选择Plungs/Configuration/Dynamic Reconfiguration

最终你在rviz和rqt将看到以下两个画面表示成功, 其中rviz出现图像和激光彩色线条,rqt中出现控制界面

步骤2

如果你不想看文字,可以直接看根目录下的演示视频 How_to_use.mp4

暂停bag的播放

通过rviz工具栏的 2D Nav Goal 去选择激光的点,选择之后会在第一个启动标定程序的终端显示出类似以下的内容

[ INFO] [1534164489.163120940]: Setting goal: Frame:laser, Position(1.575, -0.752, 0.000), Orientation(0.000, 0.000, -0.688, 0.725) = Angle: -1.518

请复制我标粗的部分到粘贴板 并切换到rqt界面,将其粘贴到laser_coor右边的框中,如果是上面的例子,粘贴完成应该显示1.575, -0.752

勾选Save按钮 此时会弹出当前激光对应的图像,你需要勾选一个小的矩形框,勾选完成后 会弹出检测出坐标点的特征点,然后对着图像窗口按键盘空格键,窗口将消失 数据将以 x y u v 的格式存自动保存在data/data_v2.txt文件夹下

步骤3

标定 将data/data_v2.txt 复制一份变为data.txt

roslaunch camera_laser_calibration calibration.launch

标定结果 Tcl: 结果为激光雷达到相机的外参,它会自动保存到data文件夹下

reprojection

步骤4

重投影检验标定结果

roslaunch camera_laser_calibration reprojection_test.launch

会自动启动rviz,重投影图像是以rosmsg消息发布的 demo0

camera_lidar_calibration_v2's People

Contributors

turtlezhong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

camera_lidar_calibration_v2's Issues

question of build error

hello
i got error in the build

the error is

jaewoo@jaewoo:~/catkin_ws$ catkin_make
Base path: /home/jaewoo/catkin_ws
Source space: /home/jaewoo/catkin_ws/src
Build space: /home/jaewoo/catkin_ws/build
Devel space: /home/jaewoo/catkin_ws/devel
Install space: /home/jaewoo/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/jaewoo/catkin_ws/build"
####
####
#### Running command: "make -j16 -l16" in "/home/jaewoo/catkin_ws/build"
####
[  9%] Generating dynamic reconfigure files from cfg/dynamic_range.cfg: /home/jaewoo/catkin_ws/devel/include/camera_laser_calibration/dynamic_rangeConfig.h /home/jaewoo/catkin_ws/devel/lib/python3/dist-packages/camera_laser_calibration/cfg/dynamic_rangeConfig.py
[ 27%] Built target camera_laser_calibration
[ 36%] Building CXX object camera_lidar_calibration_v2/CMakeFiles/corner_detecter.dir/src/corner_detecter.cc.o
[ 45%] Building CXX object camera_lidar_calibration_v2/CMakeFiles/collect_laser_image_data.dir/src/collect_laser_image_data.cc.o
[ 54%] Building CXX object camera_lidar_calibration_v2/CMakeFiles/calibration.dir/src/camera_laser_calibration.cc.o
[ 72%] Built target reprojection_test
Generating reconfiguration files for dynamic_range in camera_laser_calibration
[ 72%] Built target camera_laser_calibration_gencfg
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc: In functionvoid cornerDetect(const cv::Mat&, const Point&, const Point&)’:
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:56:13: error: ‘CV_TERMCRIT_EPSwas not declared in this scope
   56 |             CV_TERMCRIT_EPS + CV_TERMCRIT_ITER,
      |             ^~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:56:31: error: ‘CV_TERMCRIT_ITERwas not declared in this scope
   56 |             CV_TERMCRIT_EPS + CV_TERMCRIT_ITER,
      |                               ^~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc: In functionvoid on_mouse(int, int, int, int, void*)’:
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:75:18: error: ‘CV_EVENT_LBUTTONDOWNwas not declared in this scope
   75 |     if (event == CV_EVENT_LBUTTONDOWN)
      |                  ^~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:81:45: error: ‘CV_FILLEDwas not declared in this scope
   81 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                             ^~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:81:55: error: ‘CV_AAwas not declared in this scope; did you meanCV_AVX’?
   81 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                                       ^~~~~
      |                                                       CV_AVX
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:84:23: error: ‘CV_EVENT_MOUSEMOVEwas not declared in this scope
   84 |     else if (event == CV_EVENT_MOUSEMOVE && !(flags & CV_EVENT_FLAG_LBUTTON))
      |                       ^~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:84:55: error: ‘CV_EVENT_FLAG_LBUTTONwas not declared in this scope
   84 |     else if (event == CV_EVENT_MOUSEMOVE && !(flags & CV_EVENT_FLAG_LBUTTON))
      |                                                       ^~~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:101:23: error: ‘CV_EVENT_LBUTTONUPwas not declared in this scope
  101 |     else if (event == CV_EVENT_LBUTTONUP)
      |                       ^~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:107:45: error: ‘CV_FILLEDwas not declared in this scope
  107 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                             ^~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/corner_detecter.cc:107:55: error: ‘CV_AAwas not declared in this scope; did you meanCV_AVX’?
  107 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                                       ^~~~~
      |                                                       CV_AVX
make[2]: *** [camera_lidar_calibration_v2/CMakeFiles/corner_detecter.dir/build.make:63: camera_lidar_calibration_v2/CMakeFiles/corner_detecter.dir/src/corner_detecter.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1841: camera_lidar_calibration_v2/CMakeFiles/corner_detecter.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/camera_laser_calibration.cc: In functionvoid BuildOptimizationProblem(Vector3dPoints&, const Vector2dPoints&, Eigen::Quaterniond&, Eigen::Vector3d&, ceres::Problem*)’:
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/camera_laser_calibration.cc:117:12: error: ‘LocalParameterizationis not a member ofceres117 |     ceres::LocalParameterization* quaternion_local_parameterization =
      |            ^~~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/camera_laser_calibration.cc:117:35: error: ‘quaternion_local_parameterizationwas not declared in this scope
  117 |     ceres::LocalParameterization* quaternion_local_parameterization =
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/camera_laser_calibration.cc:118:17: error: ‘EigenQuaternionParameterizationdoes not name a type
  118 |             new EigenQuaternionParameterization;
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/camera_laser_calibration.cc:129:18: error: ‘class ceres::Problemhas no member namedSetParameterization’; did you meanSetParameterLowerBound’?
  129 |         problem->SetParameterization(q.coeffs().data(),
      |                  ^~~~~~~~~~~~~~~~~~~
      |                  SetParameterLowerBound
make[2]: *** [camera_lidar_calibration_v2/CMakeFiles/calibration.dir/build.make:63: camera_lidar_calibration_v2/CMakeFiles/calibration.dir/src/camera_laser_calibration.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1949: camera_lidar_calibration_v2/CMakeFiles/calibration.dir/all] Error 2
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc: In functionvoid on_mouse(int, int, int, int, void*)’:
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:122:18: error: ‘CV_EVENT_LBUTTONDOWNwas not declared in this scope
  122 |     if (event == CV_EVENT_LBUTTONDOWN)
      |                  ^~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:128:45: error: ‘CV_FILLEDwas not declared in this scope
  128 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                             ^~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:128:55: error: ‘CV_AAwas not declared in this scope
  128 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                                       ^~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:131:23: error: ‘CV_EVENT_MOUSEMOVEwas not declared in this scope
  131 |     else if (event == CV_EVENT_MOUSEMOVE && !(flags & CV_EVENT_FLAG_LBUTTON))
      |                       ^~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:131:55: error: ‘CV_EVENT_FLAG_LBUTTONwas not declared in this scope
  131 |     else if (event == CV_EVENT_MOUSEMOVE && !(flags & CV_EVENT_FLAG_LBUTTON))
      |                                                       ^~~~~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:148:23: error: ‘CV_EVENT_LBUTTONUPwas not declared in this scope
  148 |     else if (event == CV_EVENT_LBUTTONUP)
      |                       ^~~~~~~~~~~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:154:45: error: ‘CV_FILLEDwas not declared in this scope
  154 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                             ^~~~~~~~~
/home/jaewoo/catkin_ws/src/camera_lidar_calibration_v2/src/collect_laser_image_data.cc:154:55: error: ‘CV_AAwas not declared in this scope
  154 |         circle(img,pre_pt,2,Scalar(255,0,0),CV_FILLED,CV_AA,0);
      |                                                       ^~~~~
make[2]: *** [camera_lidar_calibration_v2/CMakeFiles/collect_laser_image_data.dir/build.make:63: camera_lidar_calibration_v2/CMakeFiles/collect_laser_image_data.dir/src/collect_laser_image_data.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1922: camera_lidar_calibration_v2/CMakeFiles/collect_laser_image_data.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j16 -l16" failed

Do you know anything about this error?

请问最后重投影的结果是发布在/debug_reprojection话题下吗?我的这个话题显示NO image

 学长您好,我在测试您的标定方法;我选择了35个点记录到了data里面。R和T也分别计算出来了,但是最后运行那个roslaunch camera_laser_calibration reprojection_test后并没有出现重投影的结果。
这是输出:

$ roslaunch camera_laser_calibration reprojection_test.launch
... logging to /home/tent/.ros/log/d2fa9d90-6a86-11e9-b397-fcaa1443ac50/roslaunch-zgq-8859.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://localhost:33439/

SUMMARY

PARAMETERS

  • /calib_result_path: /home/tent/Camera...
  • /image_topic: /camera/image_raw
  • /rosdistro: kinetic
  • /rosversion: 1.12.13
  • /scan_topic: /scan

NODES
/
reprojection_test (camera_laser_calibration/reprojection_test)
rviz (rviz/rviz)

ROS_MASTER_URI=http://localhost:11311

process[reprojection_test-1]: started with pid [8876]
process[rviz-2]: started with pid [8877]
Config.path = /home/tent/Camera_ws/src/camera_lidar_calibration/config/config.yaml
[ INFO] [1556547076.207772850]:
[-0.2961342944500001, 0.4714774343942, -0.8306709013144;
-0.6231966485498001, 0.5636865030646199, 0.5421103929956;
0.7238308190936, 0.6782085002524, 0.12689604067862]
[ INFO] [1556547076.207827004]:
[-446309;
-311055;
1076620]
K:
[1870.089100832898, 0, 775.9379595721259;
0, 1868.052541494669, 539.6847247483735;
0, 0, 1]
D:
[-0.1176336838255311;
0.1704938674443067;
0.001421206207294814;
0.001356481077448661;
0]
[ INFO] [1556547076.207895021]: Rcl =
[-0.2961342944500001, 0.4714774343942, -0.8306709013144;
-0.6231966485498001, 0.5636865030646199, 0.5421103929956;
0.7238308190936, 0.6782085002524, 0.12689604067862]
[ INFO] [1556547076.207913609]: tcl =
[-446309;
-311055;
1076620]
[ INFO] [1556547076.207926375]: image_topic: /camera/image_raw
[ INFO] [1556547076.207937221]: scan_topic: /scan
image

Livox or Velodyne ?

Please specift if the LIDAR is either Livox Velodyne please :)
As well as if it is possible to do the calibration with Livox or Velodyne or with both

calibrate fisheye and lidar

The fisheye's FOV is 180 degree,and we plane to replace it with 197 degree camera later. I wonder if this method would still work with such a large FOV?You prompt reply will be very much appreciated.

求问

首先感谢您的工作!在这里我有一些小的问题想求教,代码里提供的bagfile好像比实际的要短不少,用代码里提供的 data.txt 文件里面的数据点,是可以calibrate的,但是我测试了用您给的sample begfile去采集数据点,测试类很多次,都无法得到好的结果,请问是我测量点的方法不对,还是这一段 bagfile确实无法提供有效的信息来做calibration?

4.091 -1.448 102.396 295.183
3.934 -1.856 150.463 295.506
3.595 -2.448 219.262 295.506
3.623 -2.706 237.624 294.143
3.972 -2.177 178.607 293.038
4.402 -1.177 62.6532 292.229
4.474 -0.933 32.6626 293.128
4.580 -1.186 60.1791 291.182
4.492 -1.481 95.1689 290.294
4.535 -1.344 77.6233 291.148

这些数据点在给的ROS bagfile 里好像都不存在

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.