- 1--启动roscore后报错:原因是我把一个功能包的配置文件-package.xml的内容作了修改,有的地方没有改对,因此把配置文件改回来,如果改不回来就把整个功能包删除再运行即可。我是为了方便加了一个中文注释,结果报错,原因是注释格式写错了。
- 2--运行 rqt 报
打开终端输入sudo nautilus(不输入直接找到路径会限制修改),然后文件系统会自动弹出,
进到/opt/ros/kinetic/share/pr2_motor_diagnostic_tool中新建一个plugin.xml的文件。内容如下:
然后保存关闭,再启动rqt就不会报错了
- 3-- gazebo启动报错
在对应的urdf中找到gazebo插件部分,加入如下两句即可
- 4--安装工具包时报错:
修改网关配置,sudo vi /etc/resolv.conf命令打开配置文件,网上查找自己的镜像源网关地址,我用的是清华大学的,地址是nameserver 202.96.134.133 和 nameserver 202.96.128.68两个不同的运营商,都添加进去。
如果还不行则进行密钥更换:
1 //删除旧密钥,Ubuntu 16.04和更新版本: 2 3 sudo apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116 4 5 导入新密钥: 6 7 sudo -E apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C65
运行sudo apt update,sudo apt install,没有报错即可。然后就可以正常安装了。
- 5--运行launch文件提示log已超过1G,
用rosclean purge清除一下即可。
- 不同路径存在多个功能包报错:
用命令查看存在同名功能包的地址;catkin_find --without-underlays --libexec --share orbslam2_pointcloud,将不属于当前功能包的文件删除,运行即可
- 报错提示usb权限没有打开:
- #error This file requires compiler and library support for the ISO C++ 2011错误解决办法,在CMakeLists.txt添加如下内容
include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif()
- 编译build_ros.sh时报错
Building ROS nodes mkdir: cannot create directory ‘build’: File exists [rosbuild] Building package ORB_SLAM2 [rosbuild] Error from directory check: /opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py /home/tianbot/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2 1 Traceback (most recent call last): File "/opt/ros/kinetic/share/ros/core/rosbuild/bin/check_same_directories.py", line 46, in <module> raise Exception Exception CMake Error at /opt/ros/kinetic/share/ros/core/rosbuild/private.cmake:102 (message): [rosbuild] rospack found package "ORB_SLAM2" at "", but the current directory is "/home/tianbot/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2". You should double-check your ROS_PACKAGE_PATH to ensure that packages are found in the correct precedence order. Call Stack (most recent call first): /opt/ros/kinetic/share/ros/core/rosbuild/public.cmake:177 (_rosbuild_check_package_location) CMakeLists.txt:4 (rosbuild_init) -- Configuring incomplete, errors occurred! See also "/home/tianbot/catkin_ws/src/ORB_SLAM2/Examples/ROS/ORB_SLAM2/build/CMakeFiles/CMakeOutput.log". make: *** No targets specified and no makefile found. Stop.
在~/.bashrc文件末尾添加一行路径(一定要加在末尾,不然还会报错):gedit ~/.bashrc
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:/home/tianbot/code_source/ORB_SLAM2_PointCloud/Examples/ROS //按自己当前的路径修改
- 编译build_ros.sh时报错:/usr/lib/x86_64-linux-gnu/libboost_system.so: error adding symbols: DSO missing from command line,
找到ROS功能包下的CMakeLists.txt,后面添加-lboost_system
set(LIBS ${OpenCV_LIBS} ${EIGEN3_LIBS} ${Pangolin_LIBRARIES} ${PROJECT_SOURCE_DIR}/../../../Thirdparty/DBoW2/lib/libDBoW2.so ${PROJECT_SOURCE_DIR}/../../../Thirdparty/g2o/lib/libg2o.so ${PROJECT_SOURCE_DIR}/../../../lib/libORB_SLAM2.so -lboost_system )
- 报错找不到ply_io.h文件。其他找不到.h文件的类似
用locate ply_io.h寻找系统的文件路径,在CMakeLists.txt文件中加入如下的配置
include_directories("/usr/include/pcl-1.7")
出现如下错误的原因比较多:有可能是不能够加载文件,文件路径错误: