小问题比较多,根据自己编译的情况罗列,不一定是最佳解决办法。

-------------------------------------------------------------------------

CMake Error at /usr/share/cmake-3.16/Modules/FindQt4.cmake:1314 (message):
  Found unsuitable Qt version "5.12.8" from /usr/bin/qmake, this code
  requires Qt 4.x
Call Stack (most recent call first):
  lidar/hector_slam/hector_geotiff/CMakeLists.txt:12 (find_package)

NOT working
sudo add-apt-repository ppa:rock-core/qt4
sudo add-apt-repository --remove ppa:rock-core/qt4

网上有个说法,修改 src/lidar/hector_slam/hector_geotiff/CMakeLists.txt,把

find_package(Qt4 4.6 COMPONENTS QtCore QtGui REQUIRED)

改为

find_package(Qt5 COMPONENTS Core Gui REQUIRED)
我试了一上,出现下面两个问题

---------------------------------------------------------------------
ubuntu@ubuntu:/opt$ whereis qmake
qmake: /usr/bin/qmake
ubuntu@ubuntu:/opt$ whereis qt5
qt5: /usr/lib/aarch64-linux-gnu/qt5 /usr/lib/qt5 /usr/share/qt5

CMake Error at lidar/hector_slam/hector_geotiff/CMakeLists.txt:28 (include):
  include called with wrong number of arguments.  include() only takes one
  file.

CMake Warning at /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'QT' but neither 'QT_INCLUDE_DIRS' nor
  'QT_LIBRARIES' is defined.
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package)
  lidar/hector_slam/hector_geotiff/CMakeLists.txt:69 (catkin_package)

---------------------------------------------------------------------------
CMake Error at lidar/hector_slam/hector_geotiff/CMakeLists.txt:29 (include):
  include called with wrong number of arguments.  include() only takes one
  file.

CMake Warning at /opt/ros/noetic/share/catkin/cmake/catkin_package.cmake:166 (message):
  catkin_package() DEPENDS on 'QT' but neither 'QT_INCLUDE_DIRS' nor 'QT_LIBRARIES' is defined.

最终发现,hector_slam的版本不对,换个版本能解决这个问题

解决办法,

下载对应的版本并重新编译

-------------------------------------------------------------------------------

CMake Error at /usr/lib/aarch64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
  Could not find a package configuration file provided by "boost_signals"
  (requested version 1.71.0) with any of the following names:

boost_signalsConfig.cmake
    boost_signals-config.cmake

Add the installation prefix of "boost_signals" to CMAKE_PREFIX_PATH or set
  "boost_signals_DIR" to a directory containing one of the above files.  If
  "boost_signals" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  /usr/lib/aarch64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
  /usr/share/cmake-3.16/Modules/FindBoost.cmake:443 (find_package)
  imu_filter_madgwick/CMakeLists.txt:6 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/riki/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/riki/catkin_ws/build/CMakeFiles/CMakeError.log".

这个问题十分奇怪,我是尝试着解决的,办法如下,

sudo apt autoremove

sudo apt update

sudo apt upgrade

后来还重新安装了一次ros-noetic才解决。具体原因可能是文件包冲突。

----------------------------------------------------------------------------------

[ 34%] Building CXX object opencv_apps/CMakeFiles/phase_corr_exe.dir/phase_corr.cpp.o
In file included from /usr/include/string.h:495,
                 from ../Include/Linux-Arm/../Linux-x86/XnPlatformLinux-x86.h:34,
                 from ../Include/Linux-Arm/XnPlatformLinux-Arm.h:25,
                 from ../Include/XnPlatform.h:55,
                 from ../Include/XnOS.h:27,
                 from ../Include/XnProfiling.h:27,
                 from XnProfiling.cpp:24:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘XnStatus xnProfilingSectionStart(const char*, XnBool, XnProfilingHandle*)’ at XnProfiling.cpp:220:11:
/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ specified bound 256 equals destination size [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 34%] Linking CXX executable /home/ubuntu/riki/catkin_ws/devel/lib/opencv_apps/face_recognition
[ 34%] Built target face_recognition_exe
Scanning dependencies of target watershed_segmentation_exe
[ 34%] Building CXX object opencv_apps/CMakeFiles/watershed_segmentation_exe.dir/watershed_segmentation.cpp.o
Linux/XnLinuxUSB.cpp:40:10: fatal error: libudev.h: No such file or directory
   40 | #include <libudev.h>
      |          ^~~~~~~~~~~
compilation terminated.

解决办法,
sudo apt-get install libudev-dev

------------------------------------------------------------------------
In file included from /home/ubuntu/riki/catkin_ws/src/clbrobot_project/clbrobot/src/riki_base.cpp:4:
/home/ubuntu/riki/catkin_ws/src/clbrobot_project/clbrobot/include/riki_base.h:5:10: fatal error: riki_msgs/Velocities.h: No such file or directory
    5 | #include <riki_msgs/Velocities.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [clbrobot_project/clbrobot/CMakeFiles/riki_base.dir/build.make:63: clbrobot_project/clbrobot/CMakeFiles/riki_base.dir/src/riki_base.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:15585: clbrobot_project/clbrobot/CMakeFiles/riki_base.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

解决办法,

catkin_make -DCATKIN_WHITELIST_PACKAGES="riki_msgs"
catkin_make -DCATKIN_WHITELIST_PACKAGES=""

--------------------------------------------------------------------------
In file included from /home/ubuntu/riki/catkin_ws/src/clbrobot_project/frontier_exploration/polygon_layer/src/polygon_layer.cpp:1:
/home/ubuntu/riki/catkin_ws/src/clbrobot_project/frontier_exploration/polygon_layer/include/polygon_layer/polygon_layer.h:9:10: fatal error: exploration_msgs/SetPolygon.h: No such file or directory
    9 | #include <exploration_msgs/SetPolygon.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [clbrobot_project/frontier_exploration/polygon_layer/CMakeFiles/polygon_layer.dir/build.make:63: clbrobot_project/frontier_exploration/polygon_layer/CMakeFiles/polygon_layer.dir/src/polygon_layer.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:20435: clbrobot_project/frontier_exploration/polygon_layer/CMakeFiles/polygon_layer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

解决办法,
catkin_make -DCATKIN_WHITELIST_PACKAGES="exploration_msgs"
catkin_make -DCATKIN_WHITELIST_PACKAGES=""

-------------------------------------------
/usr/bin/ld: CMakeFiles/apply_calib.dir/src/apply_calib.cpp.o: in function `imu_calib::ApplyCalib::ApplyCalib()':
apply_calib.cpp:(.text+0x50): undefined reference to `imu_calib::AccelCalib::AccelCalib()'
/usr/bin/ld: apply_calib.cpp:(.text+0x1ec): undefined reference to `imu_calib::AccelCalib::loadCalib(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/usr/bin/ld: apply_calib.cpp:(.text+0x208): undefined reference to `imu_calib::AccelCalib::calibReady()'
/usr/bin/ld: CMakeFiles/apply_calib.dir/src/apply_calib.cpp.o: in function `imu_calib::ApplyCalib::rawImuCallback(boost::shared_ptr<riki_msgs::Imu_<std::allocator<void> > const>)':
apply_calib.cpp:(.text+0xc54): undefined reference to `imu_calib::AccelCalib::applyCalib(double*, double*)'
collect2: error: ld returned 1 exit status
make[2]: *** [clbrobot_project/imu_calib/CMakeFiles/apply_calib.dir/build.make:117: /home/ubuntu/riki/catkin_ws/devel/lib/imu_calib/apply_calib] Error 1
make[1]: *** [CMakeFiles/Makefile2:7620: clbrobot_project/imu_calib/CMakeFiles/apply_calib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 61%] Linking CXX executable /home/ubuntu/riki/catkin_ws/devel/lib/imu_calib/do_calib
/usr/bin/ld: CMakeFiles/do_calib.dir/src/do_calib.cpp.o: in function `imu_calib::DoCalib::DoCalib()':
do_calib.cpp:(.text+0x50): undefined reference to `imu_calib::AccelCalib::AccelCalib()'
/usr/bin/ld: CMakeFiles/do_calib.dir/src/do_calib.cpp.o: in function `imu_calib::DoCalib::imuCallback(boost::shared_ptr<riki_msgs::Imu_<std::allocator<void> > const>)':
do_calib.cpp:(.text+0x714): undefined reference to `imu_calib::AccelCalib::beginCalib(int, double)'
/usr/bin/ld: do_calib.cpp:(.text+0x858): undefined reference to `imu_calib::AccelCalib::addMeasurement(imu_calib::AccelCalib::Orientation, double, double, double)'
/usr/bin/ld: do_calib.cpp:(.text+0x8f8): undefined reference to `imu_calib::AccelCalib::computeCalib()'
/usr/bin/ld: do_calib.cpp:(.text+0x964): undefined reference to `imu_calib::AccelCalib::saveCalib(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: error: ld returned 1 exit status
make[2]: *** [clbrobot_project/imu_calib/CMakeFiles/do_calib.dir/build.make:117: /home/ubuntu/riki/catkin_ws/devel/lib/imu_calib/do_calib] Error 1
make[1]: *** [CMakeFiles/Makefile2:7677: clbrobot_project/imu_calib/CMakeFiles/do_calib.dir/all] Error 2
fatal: unable to access 'https://github.com/orbbec/OpenNI2.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
CMake Error at /home/ubuntu/riki/catkin_ws/build/depth_camera/ros_astra_camera/astra_openni2/tmp/astra_openni2-gitupdate.cmake:55 (message):
  Failed to fetch repository 'https://github.com/orbbec/OpenNI2.git'

make[2]: *** [depth_camera/ros_astra_camera/CMakeFiles/astra_openni2.dir/build.make:96: depth_camera/ros_astra_camera/astra_openni2/src/astra_openni2-stamp/astra_openni2-update] Error 1
make[1]: *** [CMakeFiles/Makefile2:6461: depth_camera/ros_astra_camera/CMakeFiles/astra_openni2.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j4 -l4" failed

老问题,链接不正确,可能生成了空的链接文件,强制重新编译一下。

---------------------------------------------------------------
[ 84%] Generating EusLisp code from frontier_exploration/ExploreTaskFeedback.msg
/bin/sh: 1: python2.7: not found
/bin/sh: 1: python2.7: not found
/bin/sh: 1: python2.7: not found
/bin/sh: 1: python2.7: not found
make[3]: Packaging/Harvest.py: Command not found
make[3]: *** [Makefile:205: release] Error 127
make[2]: *** [depth_camera/ros_astra_camera/CMakeFiles/astra_openni2.dir/build.make:112: depth_camera/ros_astra_camera/astra_openni2/src/astra_openni2-stamp/astra_openni2-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:6461: depth_camera/ros_astra_camera/CMakeFiles/astra_openni2.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 84%] Generating EusLisp manifest code for frontier_exploration
[ 84%] Built target frontier_exploration_generate_messages_eus
[ 84%] Linking CXX executable /home/ubuntu/riki/catkin_ws/devel/lib/exploration_server/plugin_client
[ 84%] Built target plugin_client
[ 84%] Linking CXX executable /home/ubuntu/riki/catkin_ws/devel/lib/exploration_server/exploration_server_node
[ 84%] Built target exploration_server_node
make: *** [Makefile:141: all] Error 2
Invoking "make -j4 -l4" failed

解决办法,

Step 1: Update system:

   sudo apt-get update

Step 2: Install: python2.7-minimal

Ater updaing the OS run following command to install the packae:

   sudo apt-get install python2.7-minimal

参考:

Install python2.7-minimal on Ubuntu: sudo apt-get install python2.7-minimal

--------------------------------------------------------------------
Scanning dependencies of target depthimage_to_laserscan
[ 85%] Building CXX object depth_camera/depthimage_to_laserscan/CMakeFiles/depthimage_to_laserscan.dir/src/depthimage_to_laserscan.cpp.o
/home/ubuntu/riki/catkin_ws/src/clbrobot_project/riki_line_follower/src/linedetect.cpp: In member function ‘int LineDetect::colorthresh(cv::Mat)’:
/home/ubuntu/riki/catkin_ws/src/clbrobot_project/riki_line_follower/src/linedetect.cpp:96:5: error: ‘CV_FONT_HERSHEY_COMPLEX’ was not declared in this scope
   96 |     CV_FONT_HERSHEY_COMPLEX, 1, CV_RGB(255, 0, 0));
      |     ^~~~~~~~~~~~~~~~~~~~~~~
[ 85%] Linking CXX shared library /home/ubuntu/riki/catkin_ws/devel/lib/libDepthImageToLaserScanNodelet.so
[ 85%] Built target DepthImageToLaserScanNodelet
Scanning dependencies of target riki_lidar_follower_generate_messages
[ 85%] Built target riki_lidar_follower_generate_messages
Scanning dependencies of target opencv_apps
[ 85%] Linking CXX executable /home/ubuntu/riki/catkin_ws/devel/lib/depthimage_to_laserscan/depthimage_to_laserscan
[ 85%] Building CXX object opencv_apps/CMakeFiles/opencv_apps.dir/src/nodelet/nodelet.cpp.o
[ 85%] Built target depthimage_to_laserscan
[ 86%] Building CXX object opencv_apps/CMakeFiles/opencv_apps.dir/src/nodelet/adding_images_nodelet.cpp.o
make[2]: *** [clbrobot_project/riki_line_follower/CMakeFiles/detect.dir/build.make:76: clbrobot_project/riki_line_follower/CMakeFiles/detect.dir/src/linedetect.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5178: clbrobot_project/riki_line_follower/CMakeFiles/detect.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 86%] Building CXX object opencv_apps/CMakeFiles/opencv_apps.dir/src/nodelet/discrete_fourier_transform_nodelet.cpp.o
[ 86%] Building CXX object opencv_apps/CMakeFiles/opencv_apps.dir/src/nodelet/pyramids_nodelet.cpp.o

原因,
这个是 opencv4的问题

以前系统的路径是

/usr/include/opecv2/**

到opencv4以后,系统默认的路径变成了

/usr/include/opencv4/opecv2/**

默认安装的是opencv4,采用cmake编译的时候,cmake一般也能找到opencv4;编译时候报错:

fatal error: opencv2/opencv.hpp: No such file or directory
#include <opencv2/opencv.hpp>

解决方案,

这是因为opencv头文件的路径中多了一个opencv4的文件夹:/usr/include/opencv4/opencv2,

我的办法:将opencv2文件夹链接到include文件夹下
    sudo ln -s /usr/include/opencv4/opencv2  /usr/include/

将/usr/include/opencv4添加系统路径中去也应该可以解决这个问题。

-------------------------------------------------------------------------------------------------------
/home/ubuntu/riki/catkin_ws/src/opencv_apps/src/nodelet/discrete_fourier_transform_nodelet.cpp:61:24: error: ‘DiscreteFourierTransformConfig’ in namespace ‘opencv_apps’ does not name a type; did you mean ‘DiscreteFourierTransformNodelet’?
   61 |   typedef opencv_apps::DiscreteFourierTransformConfig Config;
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                        DiscreteFourierTransformNodelet
/home/ubuntu/riki/catkin_ws/src/opencv_apps/src/nodelet/discrete_fourier_transform_nodelet.cpp:62:39: error: ‘Config’ was not declared in this scope; did you mean ‘dynamic_reconfigure::Config’?
   62 |   typedef dynamic_reconfigure::Server<Config> ReconfigureServer;
      |                                       ^~~~~~
      |                                       dynamic_reconfigure::Config

解决办法,

到下面的地址,

https://github.com/ros-perception/opencv_apps

根据你自己的系统,选择合适版本的opencv_apps,比如我在树莓派上装的ubuntu20.04.4 focal系统,就选这个
opencv_apps-release-debian-ros-noetic-opencv-apps_2.0.2-1_focal

-------------------------------------------------------------------------------------------------------
/home/ubuntu/riki/catkin_ws/src/clbrobot_project/riki_line_follower/src/linedetect.cpp: In member function ‘int LineDetect::colorthresh(cv::Mat)’:
/home/ubuntu/riki/catkin_ws/src/clbrobot_project/riki_line_follower/src/linedetect.cpp:96:5: error: ‘CV_FONT_HERSHEY_COMPLEX’ was not declared in this scope
   96 |     CV_FONT_HERSHEY_COMPLEX, 1, CV_RGB(255, 0, 0));
      |     ^~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [clbrobot_project/riki_line_follower/CMakeFiles/detect.dir/build.make:76: clbrobot_project/riki_line_follower/CMakeFiles/detect.dir/src/linedetect.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5178: clbrobot_project/riki_line_follower/CMakeFiles/detect.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

原因:

不知道为什么,#include <opencv2/opencv.hpp>不再包含imgproc_c.h中的内容,

解决办法:在linedetect.cpp中添加头文件

#include <opencv2/imgproc/imgproc_c.h>

ROS移植机器人小车:问题集(2)相关推荐

  1. ros手柄控制机器人小车(一)

    实验室新购置了一辆机器人,师兄们做好了键盘控制机器人运行,但总拿着电脑太麻烦了,就让我做一个手柄控制机器人,随便实践一下ros开发能力. 首先尝试用手柄控制海龟. 主要参考文章:文章一,文章二,文章三 ...

  2. ros手柄控制机器人小车(三)

    今天学到了,使用了ros::spin()就是让程序一直在subscriber里面死循环. 更新需求,要把按键设置成控制速度按钮,摇杆作为前进后退的控制. 首先需要测试手柄上所有的按键对应的button ...

  3. ROS机器人小车底盘DIY有何难?不枉学一番工业设计,巧手搭躯壳

    ROS机器人小车底盘DIY有何难?不枉学一番工业设计,巧手搭躯壳 目标: 四轮驱动,可扩展多层的车架结构. 孔位设计: 固定轮子(底座) 固定雷达 固定扩展多层支柱 固定主板,其他传感器,穿线孔等 c ...

  4. 机器人操作系统 ROS 相关书籍整理合集 [古月居推荐]

    ROS 相关的一波 PDF 及链接 观看了深蓝的 ROS公开课,主讲老师(古月居)推荐了10本ROS学习的教材,大部分都可以在CSDN上下载到,之前网友下载我分享的资源也存了一些积分,利用这些积分我下 ...

  5. ROS机器人项目开发11例-ROS Robotics Projects(10)机器人Web工具集

    本书最后一章的内容是通过Web网页对机器人进行监测和控制等,使用的是Robot Web Tools. 插播一组视频,暑期学校的全部视频资料,可看: http://i.youku.com/i/UMTMx ...

  6. 轻量级开源ROS 的机器人设备(2)--设计

    目录 一.提要 二.对快速原型框架的需求 三.关于ROS 3.1 机器人操作系统 3.2  架构 ROS 框架是高度模块化的. 四.开发过程 4.1  开放机器人控制软件 4.2 架构 4.3 开发过 ...

  7. ros构建机器人运动学模型_ROS系统玩转自主移动机器人(5)-- ROS系统建模

    注:本篇博文全部源码下载地址为:Git Repo传送门. 1. 下载到本地后解压到当前文件夹然后运行:catkin_make 编译. 2. 源码是在 Ubuntu14.04 + Indigo 环境下编 ...

  8. 基于ros的机器人运动控制相关学习(一)

    基础知识 机器人控制分层 底层包括三个级别:(1)发动机.编码器:(2)发动机控制器和驱动器:(3)驱动程序和pid控制器整合到一起的基控制器. 中间层:movebase级别,路径规划 高层:slam ...

  9. 【大一立项】ROS服务机器人-结题报告

    知乎:Magical-E Github:Magical-E 项目展示:[大一立项]亲手搭建ROS机器人小车 1.课题背景 近年来,机器人领域飞速发展,各种技术层出不穷.从四足机器狗的运动,到阿尔法狗战 ...

最新文章

  1. XML 文档(0, 0)中有错误。缺少根元素。
  2. 题目1002:Grading
  3. VB.NET和C#的比较
  4. 本地yum源安装teamviewer
  5. Mac 下 CocoaPods软件⁩汉化
  6. python爬取链家租房信息_使用python爬取链家广州12108条租房信息,并做一些基础分析...
  7. HDU 5857 Median(找中位数)
  8. 初次打开QQ空间后IE卡死问题处理
  9. 51单片机在物联网中的应用实战-熊健-专题视频课程
  10. 基于ESP32测温湿度上传到OneNET并通过微信小程序控制,查看,下发指令
  11. 计算机应用基础评分标准及评分细则,《计算机应用基础》评分标准
  12. 对接转账到支付宝账户API接口流程步骤
  13. [附源码]Python计算机毕业设计SSM流浪动物救助及领养平台(程序+LW)
  14. resultMap的用处
  15. 【Android Gradle 插件】DexOptions 配置 ⑤ ( additionalParameters 属性配置 | --minimal-main-dex 参数最小化主 dex 字节码 )
  16. Chef学习之六:Knife cookbook
  17. 网站seo优化到底该怎么做呢
  18. 自动控制原理上课笔记(不定期更新)
  19. 1.1 FPGA基础及电路设计
  20. linux运行md文件,Linux常用的18个命令.md

热门文章

  1. 狂神说smbms超市管理系统项目源码
  2. 一沉担千斤,一默解万愁
  3. 经济法基础(2020年)——第三章 支付结算法律制度
  4. python 日历壁纸_Excel+Python=精美DIY壁纸日历
  5. 如何优雅地测量一只猫的体积,而不使其感到惊恐或受到伤害?
  6. 九、系统的软中断导致CPU使用率升高,我该怎么办?
  7. GDPR哪些情况下会对企业征收行政罚款?
  8. OmniPeek tools install and setting
  9. matlab 数据透视表,MATLAB | 用行为数据处理EEG数据事件码
  10. 怎样让云盘和服务器同步更新,百度云网盘怎么设置同步文件夹、怎么进行文件同步?...