ROS2-问题汇总
前言:
因为没有购买wheeltec整车,但又想使用wheeltec得源码实现ros2机器人导航。然而wheeltec的ros2机器人源码编译教程缺少了一些报错信息以及相应的解决方案,故本文用于对该文档的进一步补充。wheeltec官方人员看到后记得打赏哈!
1、完全重置 rosdepc 解决方案
1.1 报错信息:
jetson@yahboom:~$ sudo rm -rf /home/jetson/.ros/rosdep/sources.cache
jetson@yahboom:~$ rosdepc update
您已经成功安装rosdepc,下面提示的用法中,请将rosdep替换为rosdepc使用~
欢迎使用国内版rosdep之rosdepc,我是作者小鱼!
学习机器人,就关注《鱼香ROS》(公众号|B站|CSDN)!
小鱼rosdepc正式为您服务
reading in sources list data from /etc/ros/rosdep/sources.list.d
ERROR: unable to process source [file:///usr/share/python3-rosdep2/debian.yaml]:
<urlopen error [Errno 2] No such file or directory: '/usr/share/python3-rosdep2/debian.yaml'> (file:///usr/share/python3-rosdep2/debian.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:
Failed to download target platform data for gbpdistro:
<urlopen error [Errno 104] Connection reset by peer>
ERROR: unable to process source [file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml]:
<urlopen error [Errno 2] No such file or directory: '/home/jetson/Desktop/ros2_ws/custom-rosdep.yaml'> (file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml)
ERROR: unable to process source [file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml]:
<urlopen error [Errno 2] No such file or directory: '/home/jetson/Desktop/ros2_ws/custom-rosdep.yaml'> (file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml)
ERROR: unable to process source [file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml]:
<urlopen error [Errno 2] No such file or directory: '/home/jetson/Desktop/ros2_ws/custom-rosdep.yaml'> (file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml)
Query rosdistro index https://mirrors.tuna.tsinghua.edu.cn/rosdistro/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Skip end-of-life distro "foxy"
Skip end-of-life distro "galactic"
Skip end-of-life distro "groovy"
Add distro "humble"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "iron"
Skip end-of-life distro "jade"
Add distro "jazzy"
Add distro "kilted"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Skip end-of-life distro "melodic"
Skip end-of-life distro "noetic"
Add distro "rolling"
updated cache in /home/jetson/.ros/rosdep/sources.cache
ERROR: Not all sources were able to be updated.
[[[
ERROR: unable to process source [file:///usr/share/python3-rosdep2/debian.yaml]:
<urlopen error [Errno 2] No such file or directory: '/usr/share/python3-rosdep2/debian.yaml'> (file:///usr/share/python3-rosdep2/debian.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]:
<urlopen error timed out> (https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml)
ERROR: unable to process source [https://ghproxy.com/https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:
Failed to download target platform data for gbpdistro:
<urlopen error [Errno 104] Connection reset by peer>
ERROR: unable to process source [file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml]:
<urlopen error [Errno 2] No such file or directory: '/home/jetson/Desktop/ros2_ws/custom-rosdep.yaml'> (file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml)
ERROR: unable to process source [file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml]:
<urlopen error [Errno 2] No such file or directory: '/home/jetson/Desktop/ros2_ws/custom-rosdep.yaml'> (file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml)
ERROR: unable to process source [file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml]:
<urlopen error [Errno 2] No such file or directory: '/home/jetson/Desktop/ros2_ws/custom-rosdep.yaml'> (file:///home/jetson/Desktop/ros2_ws/custom-rosdep.yaml)
]]]
---------------------------------------------------------------------------
小鱼恭喜:rosdepc已为您完成更新!!
---------------------------------------------------------------------------
小鱼科普:rosdep干什么用的?可以跳过吗?https://fishros.org.cn/forum/topic/2124
如果再使用过程中遇到任何问题,欢迎通过fishros.org.cn反馈,或者加入QQ交流群(139707339)
1.2 核心问题在于:
-
无效本地源配置
-
引用不存在的文件:
/usr/share/python3-rosdep2/debian.yaml -
缺失自定义文件:
~/Desktop/ros2_ws/custom-rosdep.yaml
-
-
国内镜像源连接问题
-
使用 ghproxy 镜像超时(
timed out) -
连接被重置(
Connection reset by peer)
-
-
配置残留
-
旧缓存文件导致错误持续出现
-
1.3 终极解决方案:完全重置 rosdepc
# 1. 卸载现有 rosdepc
sudo pip3 uninstall rosdepc -y
# 2. 清理残留配置
sudo rm -rf /etc/ros/rosdep
sudo rm -rf ~/.ros/rosdep
# 3. 重新安装最新版
sudo pip3 install rosdepc --upgrade
# 4. 初始化(使用sudo)
rosdepc init
2、wheeltec_aiui 包无法找到 ollama_ros_msgs 的依赖项
2.1 报错信息
jetson@yahboom:~/wheeltec_ros2$ colcon build
[0.987s] colcon.colcon_core.package_selection WARNING Some selected packages are already built in one or more underlay workspaces:
'nav2_msgs' is in: /opt/ros/humble
'nav2_bringup' is in: /opt/ros/humble
'nav2_map_server' is in: /opt/ros/humble
'aruco_msgs' is in: /home/jetson/wheeltec_ros2/install/aruco_msgs, /opt/ros/humble
'tf2_tools' is in: /home/jetson/wheeltec_ros2/install/tf2_tools, /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding aruco_msgs nav2_bringup nav2_map_server nav2_msgs tf2_toolsThis may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Starting >>> serial
Starting >>> nmea_msgs
Starting >>> ublox_serialization
Starting >>> ackermann_msgs
Starting >>> wheeltec_robot_msg
Starting >>> aruco
Finished <<< ublox_serialization [0.43s]
Starting >>> ublox_msgs
Finished <<< serial [0.52s]
Starting >>> aruco_msgs
Finished <<< aruco [0.57s]
Starting >>> astra_camera_msgs
Finished <<< nav2_common [1.28s]
Starting >>> nav2_msgs
Finished <<< nav_2d_msgs [1.43s]
Starting >>> nav2_voxel_grid
Finished <<< ackermann_msgs [1.45s]
Finished <<< nmea_msgs [1.50s]
Starting >>> dwb_msgs
Starting >>> bodyreader_msg
Finished <<< wheeltec_robot_msg [1.59s]
Starting >>> lslidar_msgs
Finished <<< aruco_msgs [1.70s]
Starting >>> ollama_ros_msgs
Finished <<< astra_camera_msgs [1.80s]
Finished <<< nav2_voxel_grid [1.07s]
Starting >>> openslam_gmapping
Starting >>> wheeltec_mic_msg
Finished <<< lslidar_msgs [1.47s]
Starting >>> yesense_interface
Finished <<< ublox_msgs [2.68s]
Finished <<< dwb_msgs [1.65s]
Finished <<< openslam_gmapping [0.68s]
Starting >>> ublox_gps
Starting >>> auto_recharge_ros2
Starting >>> ldlidar_sl_ros2
Finished <<< nav2_msgs [1.95s]
Starting >>> nav2_util
Finished <<< bodyreader_msg [1.74s]
Starting >>> nav2_simple_commander
Finished <<< ollama_ros_msgs [1.65s]
Starting >>> turn_on_wheeltec_robot
Finished <<< ldlidar_sl_ros2 [1.45s]
Starting >>> ldlidar_stl_ros2
Finished <<< wheeltec_mic_msg [2.16s]
Starting >>> nav2_waypoint_cycle
Finished <<< yesense_interface [1.61s]
Starting >>> orb_slam2_ros
Finished <<< ldlidar_stl_ros2 [0.67s]
Starting >>> qt_ros_test
Finished <<< auto_recharge_ros2 [2.79s]
Starting >>> tf2_tools
Finished <<< qt_ros_test [0.73s]
Starting >>> ultralytics_ros2
Finished <<< nav2_simple_commander [4.54s]
Starting >>> usb_cam
Finished <<< orb_slam2_ros [4.05s]
Starting >>> web_video_server
Finished <<< usb_cam [1.10s]
Starting >>> wheeltec_aiui
Finished <<< nav2_waypoint_cycle [4.54s]
Starting >>> wheeltec_cartographer
Finished <<< web_video_server [0.88s]
Starting >>> wheeltec_gps_driver
--- stderr: wheeltec_aiui
CMake Error at CMakeLists.txt:25 (find_package):
By not providing "Findollama_ros_msgs.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"ollama_ros_msgs", but CMake did not find one.Could not find a package configuration file provided by "ollama_ros_msgs"
with any of the following names:ollama_ros_msgsConfig.cmake
ollama_ros_msgs-config.cmakeAdd the installation prefix of "ollama_ros_msgs" to CMAKE_PREFIX_PATH or
set "ollama_ros_msgs_DIR" to a directory containing one of the above files.
If "ollama_ros_msgs" provides a separate development package or SDK, be
sure it has been installed.
---
Failed <<< wheeltec_aiui [2.57s, exited with code 1]
Aborted <<< tf2_tools [6.42s]
Aborted <<< ultralytics_ros2 [6.35s]
Aborted <<< wheeltec_cartographer [3.80s]
Aborted <<< turn_on_wheeltec_robot [9.41s]
Aborted <<< wheeltec_gps_driver [7.04s]
Aborted <<< ublox_gps [1min 27s]
Aborted <<< nav2_util [1min 31s]Summary: 29 packages finished [1min 35s]
1 package failed: wheeltec_aiui
7 packages aborted: nav2_util tf2_tools turn_on_wheeltec_robot ublox_gps ultralytics_ros2 wheeltec_cartographer wheeltec_gps_driver
2 packages had stderr output: ublox_gps wheeltec_aiui
53 packages not processed
2.2 错误原因分析
-
核心问题:
wheeltec_aiui的 CMakeLists.txt 中声明需要ollama_ros_msgs包,但编译系统找不到它的配置文件。 -
依赖关系:虽然日志显示
ollama_ros_msgs已编译完成,但可能由于以下原因导致wheeltec_aiui找不到它:-
编译顺序问题(并行编译时依赖包尚未完全安装)
-
环境变量未正确传递
-
缺少显式依赖声明
-
2.3 解决方案
步骤 1:允许包覆盖(解决初始警告)
colcon build --allow-overriding aruco_msgs nav2_bringup nav2_map_server nav2_msgs tf2_tools
步骤2:修复ollama_ros_msgs
# 1. 检查依赖包是否已安装
ls install/ollama_ros_msgs/share/ollama_ros_msgs/cmake
#2 在 wheeltec_aiui 的 CMakeLists.txt 中显式添加路径
# 在 CMakeLists.txt 的 find_package 前添加这行
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../install/ollama_ros_msgs")
# 原始代码
find_package(ollama_ros_msgs REQUIRED)
#3 确保 package.xml 包含完整依赖
检查 wheeltec_aiui/package.xml 是否包含:
<depend>ollama_ros_msgs</depend>
#4 使用正确的工作空间顺序编译
# 先单独编译依赖项
colcon build --packages-select ollama_ros_msgs
# 设置工作空间环境
source /opt/ros/humble/setup.bash
source install/setup.bash
# 编译问题包
colcon build --packages-select wheeltec_aiui \
--cmake-args -DCMAKE_VERBOSE_MAKEFILE=ON
3、由于 apt autoremove 尝试移除 ros-humble-nav2-mppi-controller 时破坏了系统依赖关系,导致多媒体开发库(FFmpeg相关)出现版本冲突。
3.1 报错信息:
jetson@yahboom:~/wheeltec_ros2$ sudo apt autoremove ros-humble-nav2-mppi-controller
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Hmm, seems like the AutoRemover destroyed something which really
shouldn't happen. Please file a bug report against apt.The following information may help to resolve the situation:
The following packages have unmet dependencies:
libavcodec-dev : Depends: libavutil-dev (= 7:4.4.2-0ubuntu0.22.04.1)
libavformat-dev : Depends: libavutil-dev (= 7:4.4.2-0ubuntu0.22.04.1)
libswresample-dev : Depends: libavutil-dev (= 7:4.4.2-0ubuntu0.22.04.1)
libswscale-dev : Depends: libavutil-dev (= 7:4.4.2-0ubuntu0.22.04.1)
E: Internal Error, AutoRemover broke stuff
3.2 错误原因
-
依赖链断裂
移除ROS包时连带删除了某些共享库(如libavutil-dev),导致其他包依赖的特定版本(7:4.4.2-0ubuntu0.22.04.1)丢失。 -
版本冲突
系统中可能存在多个版本的libavutil-dev,或升级后残留了旧版本配置。
3.3 解决方案
步骤1:修复依赖关系
步骤1:修复依赖关系
sudo apt --fix-broken install
步骤2:强制安装所需版本
# 明确安装缺失的版本
sudo apt install libavutil-dev=7:4.4.2-0ubuntu0.22.04.1 \
libavcodec-dev=7:4.4.2-0ubuntu0.22.04.1 \
libavformat-dev=7:4.4.2-0ubuntu0.22.04.1 \
libswscale-dev=7:4.4.2-0ubuntu0.22.04.1 \
libswresample-dev=7:4.4.2-0ubuntu0.22.04.1
步骤3:清理残留配置
# 清理无效包配置
sudo dpkg --configure -a
sudo apt update
sudo apt --fix-missing install
步骤4:重新移除ROS包
sudo apt autoremove ros-humble-nav2-mppi-controller
4、 1 package failed: nav2_mppi_controller
4.1报错信息
Failed <<< nav2_mppi_controller [4min 57s, exited with code 2]
Aborted <<< nav2_waypoint_follower [2min 44s]
Aborted <<< nav2_smac_planner [4min 30s]Summary: 84 packages finished [17min 55s]
1 package failed: nav2_mppi_controller
2 packages aborted: nav2_smac_planner nav2_waypoint_follower
11 packages had stderr output: aruco_ros bodyreader lslidar_driver nav2_mppi_controller nav2_regulated_pure_pursuit_controller slam_gmapping wheeltec_aiui wheeltec_mic_ros2 wheeltec_multi wheeltec_path_follow wheeltec_robot_rrt
3 packages not processed
4.2 报错原因
目前环境内二进制安装和源码编译安装的功能共存(主要为nav2系列功能包)
4.3解决方案
step1:先卸载mppi路径规划
sudo apt autoremove ros-humble-nav2-mppi-controller
step2:再编译:colcon build
step3:重新安装mppi路径规划
sudo apt install ros-humble-nav2-mppi-controller
step4:最后再来一次编译:colcon build
5、ros2-colcon build时权限问题
5.1报错信息
jetson@yahboom:~/wheeltec_ros2$ colcon build
[1.052s] colcon.colcon_core.package_selection WARNING Some selected packages are already built in one or more underlay workspaces:
'nav2_msgs' is in: /home/jetson/wheeltec_ros2/install/nav2_msgs, /opt/ros/humble
'aruco_msgs' is in: /home/jetson/wheeltec_ros2/install/aruco_msgs, /opt/ros/humble
'tf2_tools' is in: /home/jetson/wheeltec_ros2/install/tf2_tools, /opt/ros/humble
'nav2_map_server' is in: /opt/ros/humble, /home/jetson/wheeltec_ros2/install/nav2_map_server
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding aruco_msgs nav2_map_server nav2_msgs tf2_toolsThis may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Starting >>> serial
Starting >>> nmea_msgs
Starting >>> ublox_serialization
Starting >>> ackermann_msgs
Starting >>> ollama_ros_msgs
Starting >>> wheeltec_robot_msg
--- stderr: ublox_serialization
CMake Error at cmake_install.cmake:46 (file):
file INSTALL cannot set permissions on
"/home/jetson/wheeltec_ros2/install/ublox_serialization/include/ublox_serialization":
Operation not permitted.
---
Failed <<< ublox_serialization [1.48s, exited with code 1]
--- stderr: serial
CMake Error at cmake_install.cmake:46 (file):
file INSTALL cannot set permissions on
"/home/jetson/wheeltec_ros2/install/serial/lib/libserial.a": Operation not
permitted.
---
Failed <<< serial [1.53s, exited with code 1]
Aborted <<< nmea_msgs [1.52s]
Aborted <<< nav_2d_msgs [1.55s]
Aborted <<< ackermann_msgs [1.49s]
Aborted <<< nav2_common [1.57s]
Aborted <<< ollama_ros_msgs [1.54s]
Aborted <<< wheeltec_robot_msg [1.63s]Summary: 0 packages finished [2.69s]
2 packages failed: serial ublox_serialization
6 packages aborted: ackermann_msgs nav2_common nav_2d_msgs nmea_msgs ollama_ros_msgs wheeltec_robot_msg
3 packages had stderr output: ackermann_msgs serial ublox_serialization
82 packages not processed
5.2报错原因
主要在于文件权限不足导致安装失败。
5.3解决方案
优先采用该指令,若不行按步骤来
# 重置目录所有权给当前用户(假设用户名为jetson)
sudo chown -R jetson:jetson ~/wheeltec_ros2
(1)清理工作空间并修复权限
# 进入工作空间目录
cd ~/wheeltec_ros2
# 删除之前构建的文件(需要sudo权限修复所有权)
sudo rm -rf install build log
# 重置目录所有权给当前用户(假设用户名为jetson)
sudo chown -R jetson:jetson ~/wheeltec_ros2
# 确认权限
ls -ld ~/wheeltec_ros2
(2)重新构建并允许覆盖冲突包
根据警告提示,添加--allow-overriding参数:
colcon build --allow-overriding aruco_msgs nav2_map_server nav2_msgs tf2_tools
(3)如果问题依旧,尝试单独构建失败包
# 先构建依赖项
colcon build --packages-up-to nav2_common nav_2d_msgs
# 再单独构建失败包
colcon build --packages-select ublox_serialization serial
(4)使用--symlink-install避免文件复制
colcon build --symlink-install
6、tts包编译失败:链接器找不到兼容ARM64架构的libmsc.so库(Jetson是ARM平台,而当前库是x86_64的)
6.1报错信息
jetson@yahboom:~/wheeltec_ros2$ colcon build
[1.053s] colcon.colcon_core.package_selection WARNING Some selected packages are already built in one or more underlay workspaces:
'nav2_msgs' is in: /home/jetson/wheeltec_ros2/install/nav2_msgs, /opt/ros/humble
'tf2_tools' is in: /home/jetson/wheeltec_ros2/install/tf2_tools, /opt/ros/humble
'nav2_map_server' is in: /home/jetson/wheeltec_ros2/install/nav2_map_server, /opt/ros/humble
'aruco_msgs' is in: /home/jetson/wheeltec_ros2/install/aruco_msgs, /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding aruco_msgs nav2_map_server nav2_msgs tf2_toolsThis may be promoted to an error in a future release of colcon-override-check.
Starting >>> nav2_common
Starting >>> nav_2d_msgs
Starting >>> serial
Starting >>> nmea_msgs
Starting >>> ublox_serialization
Starting >>> ackermann_msgs
Starting >>> wheeltec_robot_msg
Starting >>> aruco
Finished <<< ublox_serialization [0.56s]
Finished <<< serial [0.63s]
Starting >>> ublox_msgs
Starting >>> aruco_msgs
Finished <<< aruco [0.68s]
Starting >>> astra_camera_msgs
Finished <<< nav2_common [1.94s]
Starting >>> nav2_msgs
Finished <<< nmea_msgs [2.03s]
Starting >>> nav2_voxel_grid
Finished <<< wheeltec_robot_msg [2.07s]
Finished <<< nav_2d_msgs [2.17s]
Starting >>> dwb_msgs
Starting >>> bodyreader_msg
Finished <<< ackermann_msgs [2.22s]
Starting >>> lslidar_msgs
Finished <<< aruco_msgs [1.91s]
Starting >>> ollama_ros_msgs
Finished <<< astra_camera_msgs [2.40s]
Starting >>> openslam_gmapping
Finished <<< ublox_msgs [2.67s]
Starting >>> wheeltec_mic_msg
Finished <<< nav2_voxel_grid [1.32s]
Starting >>> yesense_interface
Finished <<< openslam_gmapping [0.96s]
Starting >>> ublox_gps
Finished <<< nav2_msgs [2.40s]
Starting >>> nav2_util
Finished <<< dwb_msgs [2.22s]
Starting >>> nav2_simple_commander
Finished <<< bodyreader_msg [2.28s]
Starting >>> turn_on_wheeltec_robot
Finished <<< lslidar_msgs [2.30s]
Starting >>> auto_recharge_ros2
Finished <<< ollama_ros_msgs [2.67s]
Starting >>> ldlidar_sl_ros2
Finished <<< ublox_gps [1.80s]
Finished <<< nav2_util [1.71s]
Starting >>> nav2_lifecycle_manager
Starting >>> nav2_map_server
Finished <<< wheeltec_mic_msg [2.79s]
Finished <<< yesense_interface [2.75s]
Starting >>> nav_2d_utils
Starting >>> nav2_behavior_tree
Finished <<< turn_on_wheeltec_robot [1.94s]
Starting >>> nav2_amcl
Finished <<< ldlidar_sl_ros2 [1.25s]
Starting >>> nav2_velocity_smoother
Finished <<< nav2_lifecycle_manager [0.78s]
Starting >>> nav2_rviz_plugins
Finished <<< nav_2d_utils [0.83s]
Starting >>> ldlidar_stl_ros2
Finished <<< nav2_map_server [1.13s]
Starting >>> nav2_costmap_2d
Finished <<< nav2_simple_commander [2.85s]
Starting >>> nav2_waypoint_cycle
Finished <<< auto_recharge_ros2 [2.84s]
Starting >>> orb_slam2_ros
Finished <<< nav2_velocity_smoother [1.64s]
Finished <<< ldlidar_stl_ros2 [1.24s]
Finished <<< nav2_rviz_plugins [1.44s]
Starting >>> qt_ros_test
Starting >>> tf2_tools
Starting >>> tts
Finished <<< nav2_amcl [1.98s]
Starting >>> ultralytics_ros2
Finished <<< qt_ros_test [1.79s]
Finished <<< nav2_costmap_2d [2.90s]
Starting >>> nav2_core
Starting >>> costmap_queue
Finished <<< nav2_behavior_tree [4.01s]
Starting >>> nav2_collision_monitor
Finished <<< nav2_core [0.44s]
Starting >>> dwb_core
Finished <<< nav2_waypoint_cycle [3.57s]
Starting >>> nav2_controller
Finished <<< costmap_queue [0.81s]
Starting >>> nav2_regulated_pure_pursuit_controller
Finished <<< nav2_collision_monitor [0.91s]
Starting >>> nav2_behaviors
Finished <<< dwb_core [1.26s]
Finished <<< nav2_regulated_pure_pursuit_controller [0.91s]
Starting >>> dwb_critics
Starting >>> dwb_plugins
Finished <<< nav2_controller [1.09s]
Finished <<< tf2_tools [3.63s]
Starting >>> nav2_bt_navigator
Starting >>> nav2_constrained_smoother
Finished <<< ultralytics_ros2 [3.55s]
Finished <<< nav2_behaviors [0.96s]
Starting >>> nav2_mppi_controller
Starting >>> nav2_navfn_planner
Finished <<< dwb_plugins [0.76s]
Starting >>> nav2_planner
Finished <<< dwb_critics [0.85s]
Starting >>> nav2_smac_planner
Finished <<< nav2_bt_navigator [0.85s]
Starting >>> nav2_smoother
Finished <<< nav2_constrained_smoother [0.90s]
Starting >>> nav2_theta_star_planner
Finished <<< nav2_navfn_planner [0.90s]
Starting >>> nav2_waypoint_follower
Finished <<< nav2_mppi_controller [0.99s]
Starting >>> nav2_rotation_shim_controller
Finished <<< nav2_planner [0.99s]
Starting >>> nav2_dwb_controller
Finished <<< nav2_theta_star_planner [0.84s]
Starting >>> usb_cam
Finished <<< nav2_smoother [0.98s]
Starting >>> web_video_server
Finished <<< nav2_smac_planner [1.16s]
Starting >>> wheeltec_aiui
Finished <<< nav2_waypoint_follower [0.96s]
Finished <<< nav2_rotation_shim_controller [0.93s]
Starting >>> wheeltec_cartographer
Starting >>> wheeltec_gps_driver
Finished <<< nav2_dwb_controller [0.52s]
Starting >>> navigation2
Finished <<< usb_cam [0.56s]
Starting >>> wheeltec_joy
Finished <<< wheeltec_cartographer [0.35s]
Finished <<< web_video_server [0.58s]
Starting >>> wheeltec_robot_kcf
Starting >>> wheeltec_robot_keyboard
--- stderr: orb_slam2_ros
/usr/bin/ld: warning: libopencv_imgcodecs.so.4.5d, needed by /opt/ros/humble/lib/libcv_bridge.so, may conflict with libopencv_imgcodecs.so.410
/usr/bin/ld: warning: libopencv_core.so.4.5d, needed by /opt/ros/humble/lib/libcv_bridge.so, may conflict with libopencv_core.so.410
---
Finished <<< orb_slam2_ros [6.37s]
Finished <<< wheeltec_aiui [0.62s]
Starting >>> wheeltec_robot_rrt
Starting >>> wheeltec_robot_rtab
Finished <<< wheeltec_gps_driver [1.15s]
Starting >>> wheeltec_robot_urdf
Finished <<< wheeltec_joy [0.98s]
Finished <<< wheeltec_robot_kcf [0.92s]
Starting >>> wheeltec_rrt_msg
Starting >>> wheeltec_rviz2
Finished <<< navigation2 [1.43s]
Finished <<< wheeltec_robot_urdf [0.44s]
Finished <<< wheeltec_robot_rtab [1.11s]
Starting >>> nav2_bringup
Starting >>> wheeltec_slam_toolbox
Starting >>> aruco_ros
Finished <<< wheeltec_rviz2 [0.55s]
Starting >>> astra_camera
Finished <<< wheeltec_robot_rrt [1.52s]
Starting >>> lslidar_driver
Finished <<< wheeltec_slam_toolbox [0.48s]
Starting >>> nmea_navsat_driver
Finished <<< aruco_ros [1.18s]
Finished <<< wheeltec_robot_keyboard [2.50s]
Starting >>> ollama_ros_chat
Starting >>> slam_gmapping
Finished <<< astra_camera [1.13s]
Finished <<< lslidar_driver [1.03s]
Starting >>> yesense_std_ros2
Starting >>> bodyreader
Finished <<< wheeltec_rrt_msg [2.44s]
Starting >>> wheeltec_mic_ros2
Finished <<< nav2_bringup [2.20s]
Starting >>> wheeltec_multi
Finished <<< slam_gmapping [1.19s]
Starting >>> wheeltec_path_follow
Finished <<< yesense_std_ros2 [1.16s]
Starting >>> simple_follower_ros2
Finished <<< bodyreader [1.19s]
Starting >>> ublox
Finished <<< wheeltec_multi [1.10s]
Starting >>> wheeltec_nav2
Finished <<< wheeltec_mic_ros2 [1.24s]
Finished <<< nmea_navsat_driver [2.84s]
Finished <<< wheeltec_path_follow [0.96s]
Finished <<< ublox [0.87s]
Finished <<< wheeltec_nav2 [0.40s]
Finished <<< ollama_ros_chat [2.79s]
--- stderr: tts
/usr/bin/ld: skipping incompatible /home/jetson/wheeltec_ros2/src/tts_make_ros2/libs/x64/libmsc.so when searching for -lmsc
/usr/bin/ld: cannot find -lmsc: No such file or directory
/usr/bin/ld: skipping incompatible /home/jetson/wheeltec_ros2/src/tts_make_ros2/libs/x64/libmsc.so when searching for -lmsc
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/tts_node.dir/build.make:159: tts_node] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/tts_node.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< tts [11.5s, exited with code 2]
Aborted <<< simple_follower_ros2 [1.65s]Summary: 89 packages finished [20.8s]
1 package failed: tts
1 package aborted: simple_follower_ros2
2 packages had stderr output: orb_slam2_ros tts
6.2解决方案
修复CMake配置
# 编辑CMakeLists.txt
nano ~/wheeltec_ros2/src/tts_make_ros2/CMakeLists.txt
# 找到类似这行:
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/x64)
# 改为:
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/arm64)
重新编译
7 OpenCV 库版本冲突
7.1 报错信息
--- stderr: orb_slam2_ros
/usr/bin/ld: warning: libopencv_imgcodecs.so.4.5d, needed by /opt/ros/humble/lib/libcv_bridge.so, may conflict with libopencv_imgcodecs.so.410
/usr/bin/ld: warning: libopencv_core.so.4.5d, needed by /opt/ros/humble/lib/libcv_bridge.so, may conflict with libopencv_core.so.410
---
Finished <<< orb_slam2_ros [6.95s]
Starting >>> wheeltec_slam_toolbox
Finished <<< navigation2 [1.09s]
Finished <<< wheeltec_robot_rtab [1.05s]
Starting >>> nav2_bringup
Starting >>> aruco_ros
Finished <<< wheeltec_rviz2 [0.50s]
Starting >>> astra_camera
Finished <<< wheeltec_robot_urdf [0.60s]
Finished <<< wheeltec_robot_rrt [1.42s]
Starting >>> lslidar_driver
Starting >>> nmea_navsat_driver
Finished <<< wheeltec_slam_toolbox [1.14s]
Finished <<< aruco_ros [1.03s]
Starting >>> ollama_ros_chat
Starting >>> slam_gmapping
Finished <<< lslidar_driver [0.87s]
Starting >>> yesense_std_ros2
Finished <<< astra_camera [1.57s]
Starting >>> bodyreader
Finished <<< wheeltec_rrt_msg [2.17s]
Finished <<< wheeltec_robot_keyboard [3.13s]
Starting >>> wheeltec_mic_ros2
Starting >>> wheeltec_multi
Finished <<< nav2_bringup [2.05s]
Starting >>> wheeltec_path_follow
Finished <<< slam_gmapping [1.12s]
Starting >>> simple_follower_ros2
Finished <<< yesense_std_ros2 [0.55s]
Starting >>> ublox
Finished <<< bodyreader [1.17s]
Finished <<< nmea_navsat_driver [2.73s]
Starting >>> wheeltec_nav2
Finished <<< wheeltec_multi [1.19s]
Finished <<< wheeltec_path_follow [1.10s]
Finished <<< wheeltec_mic_ros2 [1.25s]
Finished <<< ublox [0.88s]
Finished <<< wheeltec_nav2 [0.38s]
Finished <<< ollama_ros_chat [2.63s]
Finished <<< simple_follower_ros2 [2.28s]Summary: 91 packages finished [21.3s]
1 package had stderr output: orb_slam2_ros
7.2解决方案
step1:检查已安装的 OpenCV 版本
dpkg -l | grep opencv
step2:移除冲突的 OpenCV 版本
sudo apt purge libopencv4.1* # 替换为实际检测到的旧版本包名
step3:重新编译
8.Could not find a package configuration file provided by "ament_cmake_cppcheck" with any of the following names:
8.1报错信息
--- stderr: wheeltec_robot_msg
CMake Error at /opt/ros/humble/share/rosidl_generator_c/cmake/rosidl_generator_c_generate_interfaces.cmake:179 (find_package):
By not providing "Findament_cmake_cppcheck.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"ament_cmake_cppcheck", but CMake did not find one.Could not find a package configuration file provided by
"ament_cmake_cppcheck" with any of the following names:ament_cmake_cppcheckConfig.cmake
ament_cmake_cppcheck-config.cmakeAdd the installation prefix of "ament_cmake_cppcheck" to CMAKE_PREFIX_PATH
or set "ament_cmake_cppcheck_DIR" to a directory containing one of the
above files. If "ament_cmake_cppcheck" provides a separate development
package or SDK, be sure it has been installed.
Call Stack (most recent call first):
/opt/ros/humble/share/ament_cmake_core/cmake/core/ament_execute_extensions.cmake:48 (include)
/opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:286 (ament_execute_extensions)
CMakeLists.txt:25 (rosidl_generate_interfaces)
gmake: *** [Makefile:963: cmake_check_build_system] Error 1
8.2解决方案
step1:安装缺失的依赖包
sudo apt update
sudo apt install ros-humble-ament-cmake-cppcheck
step2:使用 rosdep 自动安装所有依赖
# 进入工作空间根目录(包含 src 文件夹)
cd ~/your_workspace
# 安装系统依赖
rosdep install --from-paths src --ignore-src -r -y
step3:重新编译
colcon build
8.3错误原因说明
-
ament_cmake_cppcheck是 ROS2 中用于静态代码分析的工具,通常在包的测试阶段被调用(例如if(BUILD_TESTING)条件内)。 -
你的
wheeltec_robot_msg包的CMakeLists.txt中可能使用了rosidl_generate_interfaces,该宏内部间接依赖了ament_cmake_cppcheck(即使测试未启用,也可能因为 CMake 的 find_package 机制而触发)。 -
系统缺少该包,导致 CMake 配置阶段失败。
DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐


所有评论(0)