$ cd catkin_ws/src
$ git clone https://github.com/ros-perception/image_pipeline.git
$ cd ..
$ rosdep install --from-paths src --ignore-src # 安装image_pipeline 所需的依赖
$ catkin_make
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
roslaunch usb_cam usb_cam-test.launch
rosrun camera_calibration cameracalibrator.py --size 7x6 --square 0.0232 image:=/usb_cam/image_raw camera:=/camera
('Waiting for service', '/camera/set_camera_info', '...')
Service not found
输入如下命令重新尝试
rosrun camera_calibration cameracalibrator.py --size 7x6 --square 0.0232 image:=/usb_cam/image_raw camera:=/camera --no-service-check
('D = ', [-0.04483935850269598, 0.21668635011274098, -7.511409441343408e-06, -0.014566337456272171, 0.0])
('K = ', [657.954311720957, 0.0, 297.0047475623269, 0.0, 653.7091694249858, 236.35301154477284, 0.0, 0.0, 1.0])
('R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])
('P = ', [664.5278930664062, 0.0, 290.7184962020892, 0.0, 0.0, 667.2344970703125, 236.43032880130704, 0.0, 0.0, 0.0, 1.0, 0.0])
None
# oST version 5.0 parameters
[image]
width
640
height
480
[narrow_stereo]
camera matrix
657.954312 0.000000 297.004748
0.000000 653.709169 236.353012
0.000000 0.000000 1.000000
distortion
-0.044839 0.216686 -0.000008 -0.014566 0.000000
rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
projection
664.527893 0.000000 290.718496 0.000000
0.000000 667.234497 236.430329 0.000000
0.000000 0.000000 1.000000 0.000000
在做实验的过程中,就算严格按照网上的教程也会出现各种各样的错误。这时候不要急着否定这种方法,分析一下自己所遇到的问题,找出问题的原因,并自己尝试去解决。如果不行,在网上搜索相似的教程进行比较,是否是步骤缺少还是步骤写错。不断提高自己分析问题和解决问题的能力。
http://wiki.ros.org/camera_calibration