网上买了个机器人小车,却发现发给我的树莓派硬件不兼容卖家的系统,小车装好了不想再拆装折腾,没办法只能自己安装编译,这里记录一下自己碰到的ROS程序编译问题。
源码由卖家提供,不过我找了一下,发现各家提供的源码大同小异,估计都来自开源项目的改编。
对于这些问题,在ubuntu18.04上,安装时碰到的全部问题的解决办法包括下面的指令
sudo apt install libqt4-dev
sudo apt install ros-melodic-rosserial-python -y
sudo apt install ros-melodic-costmap-2d -y
sudo apt install ros-melodic-geographic-msgs -y
sudo apt install ros-melodic-move-base-msgs -y
sudo apt install libgeographic-dev -y
sudo apt install libv4l-dev
sudo apt-get install libudev-dev
catkin_make -DCATKIN_WHITELIST_PACKAGES="clb_msgs"
catkin_make -DCATKIN_WHITELIST_PACKAGES=""
catkin_make -DCATKIN_WHITELIST_PACKAGES="riki_msgs"
catkin_make -DCATKIN_WHITELIST_PACKAGES=""
catkin_make -DCATKIN_WHITELIST_PACKAGES="exploration_msgs"
catkin_make -DCATKIN_WHITELIST_PACKAGES=""
我的树莓派安装的是ubuntu20.04,所以解决起来有点费劲,melodic要改成noetic,我详细记录了全部问题,分成2个贴子,
ROS移植机器人小车:问题集(2)_tanmx219的博客-CSDN博客
好,言归正传,现在开始列举ROS noetic安装碰到的问题,如下,
========================================================
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)
在ubuntu18.04或树莓派上的解决办法,
sudo apt install qt4-default
在ubuntu20.04上,因为不再支持QT4,所以解决办法有点不同,
==============================================================
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "rosserial_python" with any of the following names:
rosserial_pythonConfig.cmake rosserial_python-config.cmake
Add the installation prefix of "rosserial_python" to CMAKE_PREFIX_PATH or set "rosserial_python_DIR" to a directory containing one of the above files. If "rosserial_python" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): clbrobot_project/clbrobot/CMakeLists.txt:7 (find_package) -- Configuring incomplete, errors occurred!
解决办法,
sudo apt install ros-noetic-rosserial-python -y
========================================================
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "costmap_2d" with any of the following names:
costmap_2dConfig.cmake costmap_2d-config.cmake
Add the installation prefix of "costmap_2d" to CMAKE_PREFIX_PATH or set "costmap_2d_DIR" to a directory containing one of the above files. If "costmap_2d" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): m-explore/explore/CMakeLists.txt:5 (find_package)
解决办法,
sudo apt install ros-noetic-costmap-2d -y
========================================================
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "geographic_msgs" with any of the following names:
geographic_msgsConfig.cmake geographic_msgs-config.cmake
Add the installation prefix of "geographic_msgs" to CMAKE_PREFIX_PATH or set "geographic_msgs_DIR" to a directory containing one of the above files. If "geographic_msgs" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): robot_localization/CMakeLists.txt:9 (find_package)
解决办法,
sudo apt install ros-noetic-geographic-msgs -y
========================================================
CMake Error at robot_localization/CMakeLists.txt:35 (find_package): By not providing "FindGeographicLib.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "GeographicLib", but CMake did not find one.
Could not find a package configuration file provided by "GeographicLib" with any of the following names:
GeographicLibConfig.cmake geographiclib-config.cmake
Add the installation prefix of "GeographicLib" to CMAKE_PREFIX_PATH or set "GeographicLib_DIR" to a directory containing one of the above files. If "GeographicLib" provides a separate development package or SDK, be sure it has been installed.
解决办法,
sudo apt install libgeographic-dev -y
========================================================
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "move_base_msgs" with any of the following names:
move_base_msgsConfig.cmake move_base_msgs-config.cmake
Add the installation prefix of "move_base_msgs" to CMAKE_PREFIX_PATH or set "move_base_msgs_DIR" to a directory containing one of the above files. If "move_base_msgs" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): m-explore/explore/CMakeLists.txt:5 (find_package)
解决办法,
sudo apt install ros-noetic-move-base-msgs -y
========================================================
In file included from /home/ubuntu/noetic/catkin_ws/src/camera_umd/uvc_camera/include/uvc_camera/camera.h:3, from /home/ubuntu/noetic/catkin_ws/src/camera_umd/uvc_camera/src/camera_node.cpp:4: /home/ubuntu/noetic/catkin_ws/src/camera_umd/uvc_camera/include/uvc_cam/uvc_cam.h:26:10: fatal error: libv4l2.h: No such file or directory 26 | #include | ^~~~~~~~~~~ compilation terminated.
解决办法,
sudo apt install libv4l-dev
========================================================
解决办法,
========================================================
参考:
TX2-ros机器人移植调试第一弹——catkin_make的error_vslyu的博客-CSDN博客