ros 添加usb-cam 库出现的问题

下载usb-cam放在catkin_ws /src下

在catkin_ws 下编译

catkin_make

出错:

Checking for module ‘libv4l2’
– No package ‘libv4l2’ found
CMake Error at /usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:463 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPkgConfig.cmake:643 (_pkg_check_modules_internal)
usb_cam-develop/CMakeLists.txt:10 (pkg_check_modules)

解决办法:

sudo apt-get install libv4l-dev

Could NOT find image_transport (missing: image_transport_DIR)
– Could not find the required component ‘image_transport’. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by “image_transport”
with any of the following names:

image_transportConfig.cmake
image_transport-config.cmake

Add the installation prefix of “image_transport” to CMAKE_PREFIX_PATH or
set “image_transport_DIR” to a directory containing one of the above files.
If “image_transport” provides a separate development package or SDK, be
sure it has been installed.
Call Stack (most recent call first):
usb_cam-develop/CMakeLists.txt:31 (find_package)
解决办法:

sudo apt-get install ros-noetic-image-transport

Could NOT find camera_info_manager (missing: camera_info_manager_DIR)
– Could not find the required component ‘camera_info_manager’. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
“camera_info_manager” with any of the following names:

camera_info_managerConfig.cmake
camera_info_manager-config.cmake

Add the installation prefix of “camera_info_manager” to CMAKE_PREFIX_PATH
or set “camera_info_manager_DIR” to a directory containing one of the above
files. If “camera_info_manager” provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
usb_cam-develop/CMakeLists.txt:31 (find_package)

解决办法:

sudo apt-get install ros-noetic-camera-info-manager
 source devel/setup.bash  
 echo "source ~/catkin_ws/devel/setup.sh" >> ~/.bashrc          //永久生效环境

进入usb-cam文件夹下
打开终端

mkdir build
cd build
cmake ..
make

测试

roscore

另外一个终端

roslaunch usb_cam usb_cam-test.launch 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值