运行sudo apt install python3-rosdep2出现的一系列问题(2)

Resource not found: gazebo_ros

ROS path [0]=/opt/ros/noetic/share/ros

ROS path [1]=/home/cst/catkin_ws2/src

ROS path [2]=/home/cst/catkin_ws1/src

ROS path [3]=/home/cst/catkin_ws/src

ROS path [4]=/opt/ros/noetic/share

The traceback for the exception was written to the log file

这个错误表明我的系统无法找到名为"gazebo_ros"的资源。这可能是因为我在启动 wpb_gmapping.launch 文件时,缺少了一些必要的包或者环境设置。 

一、我先确认是否已经正确安装了gazebo_ros软件包:

  1. 打开终端。

  2. 运行以下命令来检查 gazebo_ros 软件包是否已安装:

    dpkg -l | grep gazebo_ros
    
  3. 如果 gazebo_ros 软件包已经安装,你将会看到相关的软件包信息。

  4. 如果未看到任何输出,那么 gazebo_ros 可能尚未安装。你可以通过以下命令安装它:

    sudo apt install ros-noetic-gazebo-ros

 二、接下来进行编译后可能会继续出现一系列错误,我一一说明:

1、

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "rviz" with any of the following names:

rvizConfig.cmake

rviz-config.cmake

 我们还是跟上面一样先确认是否安装了Rviz包:

  1. 检查 RViz 是否已安装: 在终端中运行以下命令,检查是否已经安装了 RViz:

    dpkg -l | grep rviz
    

    如果 RViz 已经安装,你会在输出中看到相关的条目。

  2. 重新安装 RViz: 如果 RViz 没有安装或者你认为安装可能出了问题,你可以尝试重新安装 RViz。在终端中运行以下命令来重新安装 RViz:

    sudo apt-get install ros-noetic-rviz
    

    这将安装 ROS Noetic 版本的 RViz。

  3. 确认安装路径: 检查 RViz 的安装路径是否正确。通常情况下,ROS 包安装在 /opt/ros/noetic/ 目录下。你可以使用以下命令检查 RViz 的安装路径:

    rospack find rviz

 2、

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "pcl_ros" with any of the following names:

pcl_rosConfig.cmake

pcl_ros-config.cmake

然后我们看出和上面的错误大差不差:

 CMake 错误表明我的的系统中缺少名为 pcl_ros 的软件包。而这个包是用于处理点云的,是 ROS 中处理3D图像和点云数据的一部分。要解决这个问题,我们需要安装 pcl_ros 包。以下是在基于Ubuntu的系统上安装 pcl_ros 包的步骤:

  1. 打开终端:您可以使用快捷键 Ctrl+Alt+T 打开一个新的终端窗口。

  2. 更新软件源

    sudo apt-get update
  3. 安装 pcl_ros

    sudo apt-get install ros-noetic-pcl-ros

    这条命令将会安装 ROS Noetic 版本的 pcl_ros 包。

  4. 验证安装: 安装完成后,您可以通过运行以下命令来检查 pcl_ros 包是否正确安装:

    rospack find pcl_ros

    如果安装成功,这个命令将输出 pcl_ros 包的安装路径。

3、写下来还会出现一系列类似的问题,解决办法类似

在我的ros里面继续运行了:

sudo apt-get install ros-noetic-base-local-planner
sudo apt-get install ros-noetic-joint-state-controller
sudo apt-get install ros-noetic-robot-state-publisher

三、接下来可能就到了%号的编译界面,可能也会出现下面的错误

 [ 68%] Linking CXX executable /home/cst/catkin_ws1/devel/lib/wpb_home_tutorials/wpb_home_joystick_demo
/home/cst/catkin_ws1/src/wpb_home/wpbh_local_planner/src/wpbh_local_planner.cpp:40:10: fatal error: tf_conversions/tf_eigen.h: 没有那个文件或目录
   40 | #include <tf_conversions/tf_eigen.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

make[2]: *** [wpb_home/wpbh_local_planner/CMakeFiles/wpbh_local_planner.dir/build.make:63:wpb_home/wpbh_local_planner/CMakeFiles/wpbh_local_planner.dir/src/wpbh_local_planner.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:12770:wpb_home/wpbh_local_planner/CMakeFiles/wpbh_local_planner.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
[ 68%] Built target wpb_home_face_detect_3d
[ 68%] Built target wpb_home_behavior_node
[ 68%] Built target wpb_home_grab_object
[ 69%] Built target wpb_home_simple_goal
[ 69%] Built target wpb_home_cruise
[ 69%] Built target wpb_home_imu_turn
/home/cst/catkin_ws1/src/wpb_home/wpb_home_tutorials/src/wpb_home_speak.cpp:39:10: fatal error: sound_play/SoundRequest.h: 没有那个文件或目录
   39 | #include <sound_play/SoundRequest.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

make[2]: *** [wpb_home/wpb_home_tutorials/CMakeFiles/wpb_home_speak.dir/build.make:63:wpb_home/wpb_home_tutorials/CMakeFiles/wpb_home_speak.dir/src/wpb_home_speak.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:11046:wpb_home/wpb_home_tutorials/CMakeFiles/wpb_home_speak.dir/all] 错误 2
[ 69%] Built target wpb_home_sr_xfyun
[ 69%] Built target wpb_home_joystick_demo
[ 70%] Built target wpb_home_face_detect
/home/cst/catkin_ws1/src/wpb_home/wpb_home_behaviors/src/wpb_home_grab_server.cpp:65:10: fatal error: sound_play/SoundRequest.h: 没有那个文件或目录
   65 | #include <sound_play/SoundRequest.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

make[2]: *** [wpb_home/wpb_home_behaviors/CMakeFiles/wpb_home_grab_server.dir/build.make:63:wpb_home/wpb_home_behaviors/CMakeFiles/wpb_home_grab_server.dir/src/wpb_home_grab_server.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:8206:wpb_home/wpb_home_behaviors/CMakeFiles/wpb_home_grab_server.dir/all] 错误 2
[ 71%] Built target wpb_home_pointcloud_cluster
[ 71%] Built target wpb_home_plane_detect
[ 72%] Built target wpb_home_objects_3d
[ 72%] Built target wpb_home_obj_detect
make: *** [Makefile:141:all] 错误 2
Invoking "make -j16 -l16" failed

上面错误表明编译过程中缺少一些依赖项。主要的问题是找不到 tf_conversions/tf_eigen.hsound_play/SoundRequest.h 这两个头文件。需要确保系统中安装了相应的软件包。以下是解决这些问题的步骤:

  1. 查找缺少的头文件: 首先,确定缺少的头文件所属的软件包。在ROS中,tf_conversions/tf_eigen.h 来自于 tf_conversions 包,而 sound_play/SoundRequest.h 来自于 sound_play 包。

  2. 安装缺少的软件包: 通过以下命令安装缺少的软件包:

    sudo apt-get install ros-noetic-tf-conversions sudo apt-get install ros-noetic-sound-play
  3. 重新编译: 安装完缺少的软件包后,重新执行 catkin_make 来编译您的 ROS 工作空间。

问题完结✿✿ヽ(°▽°)ノ✿!

  • 7
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值