• 欢迎访问开心洋葱网站,在线教程,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入开心洋葱 QQ群
  • 为方便开心洋葱网用户,开心洋葱官网已经开启复制功能!
  • 欢迎访问开心洋葱网站,手机也能访问哦~欢迎加入开心洋葱多维思维学习平台 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏开心洋葱吧~~~~~~~~~~~~~!
  • 由于近期流量激增,小站的ECS没能经的起亲们的访问,本站依然没有盈利,如果各位看如果觉着文字不错,还请看官给小站打个赏~~~~~~~~~~~~~!

ROS——无人机ROS仿真包 rotors_simulator 编译教程

人工智能 懒小象 1590次浏览 0个评论

文章目录

  • 1. 安装依赖工具
  • 2. 源码下载编译
    • 2.1 创建ROS工程
    • 2.2 下载源码
    • 2.3 可能遇到的问题
      • 2.3.1 git失败
      • 2.3.2 缺少某些包
      • 2.3.3 CMake Error
      • 2.3.4 python no found
      • 2.3.5 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 git@github.com:ethz-asl/rotors_simulator.git

 

2.3 可能遇到的问题

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

2.3.1 git失败

 
ROS——无人机ROS仿真包 rotors_simulator 编译教程   解决方法请参考我的另外一篇博客,点这里跳转

2.3.2 缺少某些包

 
ROS——无人机ROS仿真包 rotors_simulator 编译教程   解决方法请参考我的另外一篇博客,点这里跳转

2.3.3 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.4 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.5 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

    运行结果如下图:  
ROS——无人机ROS仿真包 rotors_simulator 编译教程  

参考资料

  1. rotors_simulator的github账户

     


开心洋葱 , 版权所有丨如未注明 , 均为原创丨未经授权请勿修改 , 转载请注明ROS——无人机ROS仿真包 rotors_simulator 编译教程
喜欢 (0)

您必须 登录 才能发表评论!

加载中……