我首先是按照这个博主的链接去安装【精华】ROS学习(二):Realsense ROS驱动安装-CSDN博客
1、安装Realsense SDK包的时候比较顺利没有报错,但是安装Realsense ROS时报错:
catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 4 packages in topological order:
-- ~~ - ddynamic_reconfigure
-- ~~ - realsense2_camera_msgs (plain cmake)
-- ~~ - realsense2_description (plain cmake)
-- ~~ - realsense2_camera (plain cmake)
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_workspace.cmake:100 (message):
This workspace contains non-catkin packages in it, and catkin cannot build
a non-homogeneous workspace without isolation. Try the
'catkin_make_isolated' command instead.
Call Stack (most recent call first):
CMakeLists.txt:69 (catkin_workspace)
-- Configuring incomplete, errors occurred!
See also "/home/imcm2/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/imcm2/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:320: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
2、在另一个博主那找到解决方案ubuntu18.04在下载编译Realsense-ros遇到的问题_this workspace contains non-catkin packages in it,-CSDN博客
问题解析:我一键安装安装的ros版本为ros1,不能通过直接git clone的方式进行下载,如下:
git clone https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
因为这样的版本适配ros2,我们必须去官网进行源码下载:
官网网址:https://github.com/IntelRealSense/realsense-ros
一定要注意切换版本,如图所示,ros1-legacy版本
但还是报错:
Could NOT find ddynamic_reconfigure (missing: ddynamic_reconfigure_DIR)
3、我就把第一个方法在git clone下载的ddynamic_reconfigure包复制到第二个方法下下载的,然后就编译成功了。
4、运行roslaunch realsense2_camera demo_pointcloud.launch
报错:
RLException: [demo_pointcloud.launch] is neither a launch file in package [realsense2_camera] nor is [realsense2_camera] a launch file name
The traceback for the exception was written to the log file
解决方案:roslaunch报错:[start_demo.launch]isneitheralaunchfileinpackage[learning_tf]noris[lear
处理方法: $ cd ~/catkin_ws/ #根据自己的工作空间切换到相应的文件夹 $ source devel/setup.bash
再roslaunch就好了