ROS 您所在的位置:网站首页 无人机启动教程 ROS

ROS

2024-07-16 12:01| 来源: 网络整理| 查看: 265

文章目录 1. 安装依赖工具2. 源码下载编译2.1 创建ROS工程2.2 下载源码2.3 可能遇到的问题2.3.1 git失败2.3.2 缺少mav_msgs2.3.3 缺少某些包2.3.4 CMake Error2.3.5 python no found2.3.6 VMware运行Gazebo出错 3. 测试参考资料

1. 安装依赖工具

安装wstool

sudo apt install python3-wstool 2. 源码下载编译 2.1 创建ROS工程 $ mkdir -p ~/UAV/src $ cd ~/UAV/src $ catkin_init_workspace # initialize your catkin workspace $ wstool init 2.2 下载源码 git clone [email protected]:ethz-asl/rotors_simulator.git 2.3 可能遇到的问题

下载源码的过程中可能会出现如下的问题:

2.3.1 git失败

在这里插入图片描述 解决方法请参考我的另外一篇博客,点这里跳转。

2.3.2 缺少mav_msgs

在这里插入图片描述这个问题出现在noetic版本的ROS中,原因是该版本已经将这个ros包移除,解决办法是去mav_msgs官方github下载源码,然后放入工程的src/目录下,本文中放在~/UAV/src目录下。

mav_msgs官方githubCSDN下载 2.3.3 缺少某些包

在这里插入图片描述 解决方法请参考我的另外一篇博客,点这里跳转。

2.3.4 CMake Error

出现如下提示:

CMake Error at rotors_simulator/rotors_gazebo_plugins/cmake/FindGlog.cmake:77 (MESSAGE): Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h Call Stack (most recent call first): rotors_simulator/rotors_gazebo_plugins/cmake/FindGlog.cmake:103 (GLOG_REPORT_NOT_FOUND) rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:147 (find_package) -- Configuring incomplete, errors occurred!

解决方案

sudo apt-get install libgoogle-glog-dev

解决问题后重新在工程目录下输入catkin_make即可

2.3.5 python no found

出现如下提示:

[ 12%] Generating /home/lanx/Project/ROS/UAV/src/rotors_simulator/rotors_gazebo/models/iris/iris.sdf /bin/sh: 1: python: not found make[2]: *** [rotors_simulator/rotors_gazebo/CMakeFiles/sdf.dir/build.make:64: /home/lanx/Project/ROS/UAV/src/rotors_simulator/rotors_gazebo/models/iris/iris.sdf] Error 127

解决方案:   这种情况的出现通常都是使用了较新版本的ubuntu,例如我用的ubuntu 20.04,系统自带的python版本就说python3.8,所以出现了问题。因此需要添加从python3到python的映射:

sudo ln -s /usr/bin/python3 /usr/bin/python 2.3.6 VMware运行Gazebo出错

  这个问题主要出现在使用WMware虚拟机运行Gazebo的情况下,提示如下:

VMware: vmw_ioctl_command error Invalid argument.”

解决方案:

echo "export SVGA_VGPU10=0" >> ~/.bashrc 3. 测试

  记得每次出错后最好把工程目录下build文件夹内的文件都删除,然后重新catkin_make。

  在工程目录下输入:

source devel/setup.bash roslaunch rotors_gazebo mav_hovering_example.launch mav_name:=firefly world_name:=basic

运行结果如下图: 在这里插入图片描述

参考资料 rotors_simulator的github账户


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有