astra s 相机ros包编译错误解决办法

所有报错信息:

/usr/bin/ld: /home/lzd/study_example/ccatkin_ws_astra/devel/lib/libastra_camera.so: undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::filesystem::path const*, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[2]: *** [ros_astra_camera/CMakeFiles/list_devices_node.dir/build.make:315:/home/lzd/study_example/ccatkin_ws_astra/devel/lib/astra_camera/list_devices_node] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2593:ros_astra_camera/CMakeFiles/list_devices_node.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
/usr/bin/ld: /home/lzd/study_example/ccatkin_ws_astra/devel/lib/libastra_camera.so: undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::filesystem::path const*, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[2]: *** [ros_astra_camera/CMakeFiles/astra_camera_node.dir/build.make:315:/home/lzd/study_example/ccatkin_ws_astra/devel/lib/astra_camera/astra_camera_node] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2567:ros_astra_camera/CMakeFiles/astra_camera_node.dir/all] 错误 2
make: *** [Makefile:146:all] 错误 2
Invoking "make -j8 -l8" failed

undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::filesystem::path const*, boost::system::error_code*)'

        从上面这条报错信息中可以发现问题出在BOOST版本过低导致编译错误,要解决这个问题有两个思路,第一是提升BOOST版本,但这种方法操作起来比较困难,故笔者采用了第二种方法,即降低ros_astra_camera包的版本,https://github.com/orbbec/ros_astra_camera进入网址后选择0.3.0版本的下载。

        之后进行编译:

catkin_make --pkg astra_camera

之后若还是报错如下:

/usr/bin/ld: camera_driver.cpp:(.text+0x1b92): undefined reference to `uvc_set_ae_mode'
/usr/bin/ld: camera_driver.cpp:(.text+0x1d0c): undefined reference to `uvc_set_ae_priority'
/usr/bin/ld: camera_driver.cpp:(.text+0x1ea1): undefined reference to `uvc_set_exposure_abs'
/usr/bin/ld: camera_driver.cpp:(.text+0x2032): undefined reference to `uvc_set_focus_auto'
/usr/bin/ld: camera_driver.cpp:(.text+0x21ad): undefined reference to `uvc_set_focus_abs'
/usr/bin/ld: camera_driver.cpp:(.text+0x2327): undefined reference to `uvc_set_gain'
/usr/bin/ld: camera_driver.cpp:(.text+0x24b3): undefined reference to `uvc_set_iris_abs'
/usr/bin/ld: camera_driver.cpp:(.text+0x2631): undefined reference to `uvc_set_brightness'
/usr/bin/ld: camera_driver.cpp:(.text+0x27cd): 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+0x2ee4): undefined reference to `uvc_yuyv2bgr'
/usr/bin/ld: camera_driver.cpp:(.text+0x2f07): undefined reference to `uvc_perror'
/usr/bin/ld: camera_driver.cpp:(.text+0x2fbc): undefined reference to `uvc_mjpeg2rgb'
/usr/bin/ld: camera_driver.cpp:(.text+0x2fdf): undefined reference to `uvc_perror'
/usr/bin/ld: camera_driver.cpp:(.text+0x3081): undefined reference to `uvc_any2bgr'
/usr/bin/ld: camera_driver.cpp:(.text+0x30a4): undefined reference to `uvc_perror'
/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+0x45da): undefined reference to `uvc_find_devices'
/usr/bin/ld: camera_driver.cpp:(.text+0x45fd): undefined reference to `uvc_perror'
/usr/bin/ld: camera_driver.cpp:(.text+0x469e): undefined reference to `uvc_unref_device'
/usr/bin/ld: camera_driver.cpp:(.text+0x4804): undefined reference to `uvc_open'
/usr/bin/ld: camera_driver.cpp:(.text+0x4904): undefined reference to `uvc_get_device_address'
/usr/bin/ld: camera_driver.cpp:(.text+0x491d): undefined reference to `uvc_get_bus_number'
/usr/bin/ld: camera_driver.cpp:(.text+0x4a41): undefined reference to `uvc_strerror'
/usr/bin/ld: camera_driver.cpp:(.text+0x4a5a): undefined reference to `uvc_get_device_address'
/usr/bin/ld: camera_driver.cpp:(.text+0x4a74): undefined reference to `uvc_get_bus_number'
/usr/bin/ld: camera_driver.cpp:(.text+0x4ae1): undefined reference to `uvc_unref_device'
/usr/bin/ld: camera_driver.cpp:(.text+0x4b0a): undefined reference to `uvc_set_status_callback'
/usr/bin/ld: camera_driver.cpp:(.text+0x4b90): undefined reference to `uvc_get_stream_ctrl_format_size'
/usr/bin/ld: camera_driver.cpp:(.text+0x4bc3): undefined reference to `uvc_perror'
/usr/bin/ld: camera_driver.cpp:(.text+0x4bd9): undefined reference to `uvc_close'
/usr/bin/ld: camera_driver.cpp:(.text+0x4bef): undefined reference to `uvc_unref_device'
/usr/bin/ld: camera_driver.cpp:(.text+0x4d1c): undefined reference to `uvc_print_diag'
/usr/bin/ld: camera_driver.cpp:(.text+0x4d52): undefined reference to `uvc_start_streaming'
/usr/bin/ld: camera_driver.cpp:(.text+0x4d75): undefined reference to `uvc_perror'
/usr/bin/ld: camera_driver.cpp:(.text+0x4d8b): undefined reference to `uvc_close'
/usr/bin/ld: camera_driver.cpp:(.text+0x4da1): undefined reference to `uvc_unref_device'
/usr/bin/ld: camera_driver.cpp:(.text+0x4dcf): undefined reference to `uvc_free_frame'
/usr/bin/ld: camera_driver.cpp:(.text+0x4dfc): 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+0x4fe3): undefined reference to `uvc_close'
/usr/bin/ld: camera_driver.cpp:(.text+0x5005): undefined reference to `uvc_unref_device'
collect2: error: ld returned 1 exit status
make[2]: *** [ros_astra_camera/CMakeFiles/camera_node.dir/build.make:164:/home/lzd/study_example/catkin_ws_astra/devel/lib/astra_camera/camera_node] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2647:ros_astra_camera/CMakeFiles/camera_node.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....

这是因为虽然安装了libuvc库,但是仍然找不到在哪里
解决方法;
修改ros_astra_camera的CmakeList.txt文件。
打开ros_astra_camera下CmakeList.txt文件,添加以下代码,后面的路径看你安装在哪里,最好提前确认

set(libuvc_INCLUDE_DIRS "/usr/local/include/libuvc")
set(libuvc_LIBRARIES "/usr/local/lib/libuvc.so")

最后编译成功。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值