编译volans遇到的问题

volans使用指导文件

Could not find a package configuration file provided by “OMPL” with any of
the following names:

OMPLConfig.cmake
ompl-config.cmake
sudo apt install ros-melodic-ompl*
sudo apt install libfcl-dev libompl-dev
cd /opt/ros/melodic/include
sudo cp -a ompl-1.4/ompl ompl

之后到volans/src/sup/path_planning/CMakeLists.txt中,修改find_package(OMPL REQUIRED)为find_package(ompl REQUIRED) (此处是大坑!!!)

1.错误:
gz:symbol lookup error: /usr/lib/x86_64-linux-gnu/libgazebo_common.so.9: undefined symbol: _ZTIN8ignition4math2v45ColorE
解决:sudo apt upgrade 运行成功后,重新启动电脑

2.错误:
sudo apt-get install libjaster-dev提示:errorE: unable to locate libjasper-dev
解决:
sudo add-apt-repository “deb http://security.ubuntu.com/ubuntu xenial-security main”
sudo apt update
sudo apt install libjasper1 libjasper-dev

3.错误:
Could not find a package configuration file provided by “OMPL” with any of
the following names:

OMPLConfig.cmake
ompl-config.cmake

解决:sudo apt-get install ros-melodic-ompl*或github上下载源码安装。
之后到volans/src/sup/path_planning/CMakeLists.txt中,修改find_package(OMPL REQUIRED)为find_package(ompl REQUIRED) (此处是大坑!!!)

4.错误: Could not find a package configuration file provided by “darknet_ros_msgs” with any of the following names: darknet_ros_msgsConfig.cmake darknet_ros_msgs-config.cmake
用sudo apt-get install ros-melodic-darknet-ros-msgs显示无法定位软件包
解决:到http://wiki.ros.org/darknet_ros上下载zip压缩包,放到volans的src路径下,重新catkin build

5.警告:
Warning [parser.cc:626] Can not find the XML attribute ‘version’ in sdf XML tag for model: 2Dlidar. Please specify the SDF protocol supported in the model configuration file. The first sdf tag in the config file will be used
[INFO] [1604490731.139914, 354.363000]: Spawn status: SpawnModel: Successfully spawned entity
可直接忽略,不影响后续

6.错误:一直提示No map received。
原因:gazebo缺少插件。
解决:sudo apt-get install ros-melodic-gazebo-plugins
7、noetic 没有这两个包 ar_track_alvar / ar_track_alvar_msgs
fatal error: ar_track_alvar_msgs/AlvarMarkers.h: No such file or directory
3 | #include

git clone https://github.com/ros-perception/ar_track_alvar.git

编译ar_track_alvar时报错
手动把ar_track_alvar下ar_track_alvar子文件移除,只留下ar_track_alvar_msgs,因为只需要这个包。
可以把catkin_ws/devel/include/ar_track_alvar_msgs 下面的share拷贝到/opt/ros/noetic/include/

sudo cp -rf  /home/bitcq/Videos/ar_track_alvar/devel/include/ar_track_alvar_msgs /opt/ros/noetic/include/

error: ‘CV_CAP_PROP_FRAME_WIDTH’ was not declared in this scope
46 | int img_width = capture.get(CV_CAP_PROP_FRAME_WIDTH);
ros_darknet与ros_kcf编译使用说明 src/mid/image_process/README.md
因为ros-kcf需要opencv3.4.4固件,而ubuntu18.04自带的libopencv-dev版本为3.2,我们需要重新编译opencv,系统自带的libopencv-dev请勿卸载。

git clone -b 3.4.4 https://gitee.com/opencv/opencv 
git clone -b 3.4.4 https://gitee.com/opencv/opencv_contrib
将opencv_contrib目录移到opencv目录下
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
mkdir build
cd build
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
make

fatal error: opencv2/xfeatures2d/cuda.hpp: No such file or directory 52 | # include “opencv2/xfeatures2d/cuda.hpp”
在/home/src/software/opencv-3.4.2/modules/stitching/CMakeLists.txt中加入

INCLUDE_DIRECTORIES("/home/src/software/opencv-3.4.2/opencv_contrib-3.4.2/modules/xfeatures2d/include")

fatal error: opencv2/xfeatures2d.hpp: No such file or directory
44 | #include

在opencv的安装文件里,找到 CMakeLists.txt,加入(注意修改路径)
include_directories("/home/z/opencv-4.4.0/opencv_contrib-4.4.0/modules/xfeatures2d/include")

– IPPICV: Download: ippicv_2019_lnx_intel64_general_20180723.tgz
修改opencv里相关配置文件

gedit ~/opencv/3rdparty/ippicv/ippicv.cmake #就是这个文件的路径
 
# 将47行的下载地址前添加加速地址https://ghproxy.com/
     "https://ghproxy.com/https://raw.githubusercontent.com/opencv/opencv_3rdparty/${IPPICV_COMMIT}ippicv/"
 

fatal error: boostdesc_bgm.i: No such file or directory
653 | #include “boostdesc_bgm.i”
链接不到raw.githubusercontent.com
应该是boostdesc_bgm.i文件下载失败了,需要手动下载,在/home/src/software/opencv-3.4.2/build路径下找到CMakeDownloadLog.txt,打开后搜索”boostdesc_bgm.i“,复制其下载地址到网页可以看到源码,直接拷贝源码并存为同名文件,把它放在
/home/src/software/opencv-3.4.2/opencv_contrib-3.4.2/modules/xfeatures2d/src
路径下

sudo gedit /etc/hosts
末尾加入
151.101.76.133 raw.githubusercontent.com
地址加速 

 wget https://github3.mk-proxy.ml/----- https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i
或者
wget https://ghproxy.com/https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i

编译cv_bridge
请看这个README.md
修改CMakeList.txt
将编译完成的opencv-3.4.4/build路径以及cv_bridge相关路径添加到ros_kcf中
修改ros_kcf中
将编译完成的opencv-3.4.4/build路径添加到ros_kcf中tracking以及video_pub中的CMakeList.txt

set(OpenCV_DIR "your-path/opencv-3.4.4/build")    
set(cv_bridge_DIR your-path/cv_bridge_ws/devel/share/cv_bridge/cmake)

Could not find a package configuration file provided by “boost_python3”
(requested version 1.71.0) with any of the following names:
boost_python3Config.cmake
boost_python3-config.cmake

将 CMakeLists.txt 中的如下语句:
if(NOT ANDROID)
  find_package(PythonLibs)
  if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
    find_package(Boost REQUIRED python)
  else()
    find_package(Boost REQUIRED python3)
  endif()
else()
find_package(Boost REQUIRED)
endif()

修改成:

if(NOT ANDROID)
  find_package(PythonLibs)
  # if(PYTHONLIBS_VERSION_STRING VERSION_LESS 3)
    find_package(Boost REQUIRED python)
  # else()
  #   find_package(Boost REQUIRED python3)
  # endif()
else()
find_package(Boost REQUIRED)
endif()

Could not find a configuration file for package “OpenCV” that is compatible with requested version “3”.
找不到 opencv ,因为系统 opencv 版本可能默认是 4.0,在 CMakeLists.txt 中设置自己安装的 opencv3路径:

Set(OpenCV_DIR /usr/local/opencv/opencv-3.4.3/share/OpenCV) 
Set(OpenCV_INCLUDE_DIRS "/usr/local/opencv/opencv-3.4.3/include")
Set(OpenCV_LIBRARIES "/usr/local/opencv/opencv-3.4.3/lib")

最后在代码工程的 CMakeLists.txt 中设置 opencv 和 cv_bridge 的链接路径即可,在我配置的环境中是这样的:

set(cv_bridge_DIR /home/dango/dango_file/lib/cv_bridge_melodic/usr/local/share/cv_bridge/cmake)
Set(OpenCV_DIR /usr/local/opencv/opencv-3.4.3/share/OpenCV) 
Set(OpenCV_INCLUDE_DIRS "/usr/local/opencv/opencv-3.4.3/include")
Set(OpenCV_LIBRARIES "/usr/local/opencv/opencv-3.4.3/lib")

Ubuntu20.04 Noetic运行Web上位机和Nav2d pr2机器人仿真

你可能感兴趣的:(ROS,ros)