raspberry4 ubuntu安装ros和astra 驱动

news/2024/11/29 20:38:41/

astra 安装

  1. 编译会报错
 Could not find a package configuration file provided by "libuvc" with anyof the following names:libuvcConfig.cmakelibuvc-config.cmake

解决方法:

git clone https://github.com/libuvc/libuvc
cd libuvc
mkdir build
cd build
cmake ..
make && sudo make install

但是cmake … 报如下错误.

-- Checking for module 'libusb-1.0'
--   No package 'libusb-1.0' 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)cmake/FindLibUSB.cmake:18 (pkg_check_modules)CMakeLists.txt:42 (find_package)

解决办法如下;

sudo apt-get install libusb-1.0-0-dev libusb-dev libudev-dev

编译ros_astra_camera 包的时候会出现一大段报错问题,这样的一堆…

[ 88%] Linking CXX executable /home/ubuntu/noetic/catkin_ws/devel/lib/astra_camera/camera_node
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/…/…/…/aarch64-linux-gnu/Scrt1.o: in function _start': (.text+0x18): undefined reference to main’
/usr/bin/ld: (.text+0x1c): undefined reference to main' /usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::~CameraDriver()‘:
camera_driver.cpp:(.text+0xb98): undefined reference to uvc_free_frame' /usr/bin/ld: camera_driver.cpp:(.text+0xbb4): undefined reference to uvc_exit’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::getUVCExposureCb(astra_camera::GetUVCExposureRequest_<std::allocator<void> >&, astra_camera::GetUVCExposureResponse_<std::allocator<void> >&)': camera_driver.cpp:(.text+0xd1c): undefined reference to uvc_get_exposure_abs’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::setUVCExposureCb(astra_camera::SetUVCExposureRequest_<std::allocator<void> >&, astra_camera::SetUVCExposureResponse_<std::allocator<void> >&)': camera_driver.cpp:(.text+0xdbc): undefined reference to uvc_set_ae_mode’
/usr/bin/ld: camera_driver.cpp:(.text+0xdd4): undefined reference to uvc_set_ae_mode' /usr/bin/ld: camera_driver.cpp:(.text+0xf30): undefined reference to uvc_set_exposure_abs’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::getUVCGainCb(astra_camera::GetUVCGainRequest_<std::allocator<void> >&, astra_camera::GetUVCGainResponse_<std::allocator<void> >&)': camera_driver.cpp:(.text+0xfdc): undefined reference to uvc_get_gain’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::setUVCGainCb(astra_camera::SetUVCGainRequest_<std::allocator<void> >&, astra_camera::SetUVCGainResponse_<std::allocator<void> >&)': camera_driver.cpp:(.text+0x1064): undefined reference to uvc_set_gain’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::getUVCWhiteBalanceCb(astra_camera::GetUVCWhiteBalanceRequest_<std::allocator<void> >&, astra_camera::GetUVCWhiteBalanceResponse_<std::allocator<void> >&)': camera_driver.cpp:(.text+0x10bc): undefined reference to uvc_get_white_balance_temperature’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::setUVCWhiteBalanceCb(astra_camera::SetUVCWhiteBalanceRequest_<std::allocator<void> >&, astra_camera::SetUVCWhiteBalanceResponse_<std::allocator<void> >&)': camera_driver.cpp:(.text+0x1144): undefined reference to uvc_set_white_balance_temperature_auto’
/usr/bin/ld: camera_driver.cpp:(.text+0x115c): undefined reference to uvc_set_white_balance_temperature_auto' /usr/bin/ld: camera_driver.cpp:(.text+0x117c): undefined reference to uvc_set_white_balance_temperature’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::Start()': camera_driver.cpp:(.text+0x1204): undefined reference to uvc_init’
/usr/bin/ld: camera_driver.cpp:(.text+0x1224): undefined reference to uvc_perror' /usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::Stop()‘:
camera_driver.cpp:(.text+0x13c4): undefined reference to uvc_exit' /usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::ReconfigureCallback(libuvc_camera::UVCCameraConfig&, unsigned int)’:
camera_driver.cpp:(.text+0x1534): undefined reference to uvc_set_scanning_mode' /usr/bin/ld: camera_driver.cpp:(.text+0x16c4): undefined reference to uvc_set_ae_mode’
/usr/bin/ld: camera_driver.cpp:(.text+0x184c): undefined reference to uvc_set_ae_priority' /usr/bin/ld: camera_driver.cpp:(.text+0x19e4): undefined reference to uvc_set_exposure_abs’
/usr/bin/ld: camera_driver.cpp:(.text+0x1b84): undefined reference to uvc_set_focus_auto' /usr/bin/ld: camera_driver.cpp:(.text+0x1d10): undefined reference to uvc_set_focus_abs’
/usr/bin/ld: camera_driver.cpp:(.text+0x1e98): undefined reference to uvc_set_gain' /usr/bin/ld: camera_driver.cpp:(.text+0x2024): undefined reference to uvc_set_iris_abs’
/usr/bin/ld: camera_driver.cpp:(.text+0x21ac): undefined reference to uvc_set_brightness' /usr/bin/ld: camera_driver.cpp:(.text+0x2350): undefined reference to uvc_set_pantilt_abs’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::ImageCallback(uvc_frame*)': camera_driver.cpp:(.text+0x2954): undefined reference to uvc_yuyv2bgr’
/usr/bin/ld: camera_driver.cpp:(.text+0x2974): undefined reference to uvc_perror' /usr/bin/ld: camera_driver.cpp:(.text+0x29fc): undefined reference to uvc_mjpeg2rgb’
/usr/bin/ld: camera_driver.cpp:(.text+0x2a1c): undefined reference to uvc_perror' /usr/bin/ld: camera_driver.cpp:(.text+0x2a94): undefined reference to uvc_any2bgr’
/usr/bin/ld: camera_driver.cpp:(.text+0x2ab4): undefined reference to uvc_perror' /usr/bin/ld: camera_driver.cpp:(.text+0x2e3c): undefined reference to astraWithUVC(OB_DEVICE_NO)’
/usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::OpenCamera(libuvc_camera::UVCCameraConfig&)': camera_driver.cpp:(.text+0x3cec): undefined reference to uvc_find_devices’
/usr/bin/ld: camera_driver.cpp:(.text+0x3d0c): undefined reference to uvc_perror' /usr/bin/ld: camera_driver.cpp:(.text+0x3d84): undefined reference to uvc_unref_device’
/usr/bin/ld: camera_driver.cpp:(.text+0x3ef8): undefined reference to uvc_open' /usr/bin/ld: camera_driver.cpp:(.text+0x4024): undefined reference to uvc_get_bus_number’
/usr/bin/ld: camera_driver.cpp:(.text+0x4038): undefined reference to uvc_get_device_address' /usr/bin/ld: camera_driver.cpp:(.text+0x4184): undefined reference to uvc_get_bus_number’
/usr/bin/ld: camera_driver.cpp:(.text+0x4198): undefined reference to uvc_get_device_address' /usr/bin/ld: camera_driver.cpp:(.text+0x41a8): undefined reference to uvc_strerror’
/usr/bin/ld: camera_driver.cpp:(.text+0x4208): undefined reference to uvc_unref_device' /usr/bin/ld: camera_driver.cpp:(.text+0x4228): undefined reference to uvc_set_status_callback’
/usr/bin/ld: camera_driver.cpp:(.text+0x4290): undefined reference to uvc_get_stream_ctrl_format_size' /usr/bin/ld: camera_driver.cpp:(.text+0x42b8): undefined reference to uvc_perror’
/usr/bin/ld: camera_driver.cpp:(.text+0x42c4): undefined reference to uvc_close' /usr/bin/ld: camera_driver.cpp:(.text+0x42d0): undefined reference to uvc_unref_device’
/usr/bin/ld: camera_driver.cpp:(.text+0x4408): undefined reference to uvc_print_diag' /usr/bin/ld: camera_driver.cpp:(.text+0x4430): undefined reference to uvc_start_streaming’
/usr/bin/ld: camera_driver.cpp:(.text+0x4450): undefined reference to uvc_perror' /usr/bin/ld: camera_driver.cpp:(.text+0x445c): undefined reference to uvc_close’
/usr/bin/ld: camera_driver.cpp:(.text+0x4468): undefined reference to uvc_unref_device' /usr/bin/ld: camera_driver.cpp:(.text+0x4488): undefined reference to uvc_free_frame’
/usr/bin/ld: camera_driver.cpp:(.text+0x44b0): undefined reference to uvc_allocate_frame' /usr/bin/ld: CMakeFiles/camera_node.dir/src/libuvc_camera/camera_driver.cpp.o: in function libuvc_camera::CameraDriver::CloseCamera()‘:
camera_driver.cpp:(.text+0x4644): undefined reference to uvc_close' /usr/bin/ld: camera_driver.cpp:(.text+0x4658): undefined reference to uvc_unref_device’
collect2: error: ld returned 1 exit status
make[2]: *** [depth_camera/ros_astra_camera/CMakeFiles/camera_node.dir/build.make:150: /home/ubuntu/noetic/catkin_ws/devel/lib/astra_camera/camera_node] Error 1
make[1]: *** [CMakeFiles/Makefile2:4581: depth_camera/ros_astra_camera/CMakeFiles/camera_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…

看一下就是找不到库的问题,解决这个问题的方法是修改ros_astra_camera的CmakeList.txt文件。(入行小白一开始很头大,因为不熟悉Cmake语法,后来看了几天之后凭感觉学会了,我真是个天才,哈哈飘了)咳咳,直接关注问题本身。

Cmakelist中的添加libuvc是通过find_package(libuvc REQUIRED) 寻找库的,但是新安装的libuvc 0.0.6 没有生成 libuvc.cmake文件(不知道原因),所以编译时libuvc_INCLUDE_DIRS、libuvc_LIBRARIES 都是空的!!! 所以编译才找不到对应的库!
解决办法:在ros_astra_camera的CmakeList.txt文件的find_package(libuvc REQUIRED)下方添加两条语句(根据你libuvc安装的地址修改),编译就OK了
set(libuvc_INCLUDE_DIRS “/usr/local/include/libuvc”)
set(libuvc_LIBRARIES “/usr/local/lib/libuvc.so”)

find_package(libuvc REQUIRED) #原因是libuvc库存在问题,没有libuvc.cmake文件,find_package()无法找到libuvc库文件
#解决办法手动添加库文件位置
set(libuvc_INCLUDE_DIRS "/usr/local/include/libuvc")
set(libuvc_LIBRARIES "/usr/local/lib/libuvc.so")

http://www.ppmy.cn/news/1057261.html

相关文章

KamaCoder(二)

题目来源于&#xff1a;卡码网KamaCoder 题解来源于&#xff1a;GitHub - youngyangyang04/kamacoder-solutions: 卡码网题解全集 34.大鱼吃小鱼 题目描述 现在有 N 条鱼&#xff0c;每条鱼的体积为 Ai&#xff0c;从左到右排成一排。 A 数组是一个排列。 定义一次大鱼吃…

Windows快速关闭占用某端口的进程

在Windows操作系统中&#xff0c;你可以使用以下方法来快速关闭占用特定端口的进程&#xff0c;比如端口8848&#xff1a; 使用命令行工具 打开命令提示符&#xff08;Command Prompt&#xff09;。 输入以下命令&#xff0c;将端口号替换为你需要关闭的端口&#xff08;例如…

Python系统学习1-9-类三之特征

一、封装 数据角度&#xff1a;将一些基本数据类型复合成一个自定义类型。 优势&#xff1a;将数据与对数据的操作相关联。 代码可读性更高&#xff08;类是对象的模板&#xff09;。 行为角度&#xff1a;向类外提供必要的功能&#xff0c;隐藏实现的细节。 优势&#xff…

MySQL中的数据类型

文章目录 1 常见的数据类型2 整数类型2.1 属性 M2.2 属性 UNSIGNED2.3 属性 ZEROFILL2.4 整数类型的适用场景 3 浮点类型4 定点类型5 位类型6 日期与时间类型6.1 YEAR 类型6.2 DATE 类型6.3 TIME 类型6.4 DATETIME 类型6.5 TIMESTAMP 类型 1 常见的数据类型 类型类型分类整数类…

20. 有效的括号(简单系列)

给定一个只包括 ‘(’&#xff0c;‘)’&#xff0c;‘{’&#xff0c;‘}’&#xff0c;‘[’&#xff0c;‘]’ 的字符串 s &#xff0c;判断字符串是否有效。 有效字符串需满足&#xff1a; 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 每个右括号都…

免费照片转绘画风格软件-FotoSketcher

FotoSketcher一款免费照片转绘画风格软件&#xff0c;只需点击几下鼠标即可自动将照片转换为艺术作品。支持从铅笔素描到水彩画或油画、钢笔画、墨水画、抽象艺术和卡通画&#xff0c;有 20 多种不同的风格可供选择&#xff0c;工具还可以修改原始照片增强对比度、锐化、简化图…

共享数据-vue3

vuex方案 安装vuex4.x 两个重要变动&#xff1a; 去掉了构造函数Vuex&#xff0c;而使用createStore创建仓库 为了配合composition api&#xff0c;新增useStore函数获得仓库对象&#xff1b;获取路由对象使用useRouter global state 由于vue3的响应式系统本身可以脱离…

(四)Doceke安装MySQL镜像+Docker启动MySQL容器

Doceke安装MySQL镜像/Docker启动MySQL容器 一、doceke安装MySQL镜像 切换到root用户&#xff0c;su root 。 1、启动Docker 启动&#xff1a;sudo systemctl start docker 停止&#xff1a;systemctl stop docker 重启&#xff1a;systemctl restart docker 查看docker运行…