UBUNTU20.04 下 ROS 摄像头标定
- 很久没用ROS 了, 想先查一下之前安装的ROS版本, 运行roscore是 出现下面error:
Resource not found: roslaunch
The traceback for the exception was written to the log file
参考https://blog.csdn.net/amnesiagreen/article/details/108280806 解决方法:
终端输入
source /opt/ros/kinetic/setup.bash
- 下载usb_cam 并编译
出现error: 下列软件包有未满足的依赖关系:
python-catkin-tools : 依赖: python-catkin-pkg (>= 0.2.9) 但无法安装它
依赖: python-osrf-pycommon 但无法安装它
解决: 使用pip3下载catkin-tools
ryankaros@ryankaros-vm:~$ sudo pip3 install -U catkin_tools
- catkin_make 过程中 持续报错
类似这样的error
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "gmapping" with any
of the following names:
gmappingConfig.cmake
gmapping-config.cmake
解决: 很简单 使用sudo apt-get install 命令下载缺失的功能包即可
-
使用 VMWARE虚拟机 运行UBUNTU 情况下,会出现摄像头无法调用情况
解决: 尝试在VM中设置removable devices 找到摄像头设备并连接
终端打开cheese, 若仍无摄像头图像显示, 打开setting中的USB controller, 把默认USB2.0切换为USB3.0
再次打开cheese测试
注意不要和host的摄像头调用冲突, 只能调用一处 -
分别不同终端运行
roscore
usb_cam 成功打开彩色界面
ryankaros@ryankaros-vm:~/catkin_ws/src/usb_cam/launch$ roslaunch usb_cam usb_cam-test.launch
camera_calibration 成功打开灰色界面
ryankaros@ryankaros-vm:/opt/ros/noetic/share/camera_calibration$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.0245 image:=/usb_cam/image_raw camera:=/usb_cam
等待一分钟左右得到标定数据, 存储在(‘Wrote calibration data to’, ‘/tmp/calibrationdata.tar.gz’)
可以直接点击COMMIT 将满意标定数据保存为.yaml文件 (内含不同位置下的图像+标定参数 .txt .yaml)