Gazebo学习(二)Ubuntu20.04配置RotorS+Gazebo11

 series:

Gazebo学习(一)Ubuntu20.04安装ROS+gazebo11+模型库导入(汇总跳转连接+个人安装记录)_gazebo模型库-优快云博客

Gazebo学习(二)Ubuntu20.04配置RotorS+Gazebo11_rotors simulator ubuntu20.04-优快云博客

**救命终于配置出来环境了,中途还轻轻rm掉了好些东西找不回来了泪目**

*官方代码链接:GitHub - ethz-asl/rotors_simulator: RotorS is a UAV gazebo simulator*

*参考教程:https://www.guyuehome.com/16351*

一、准备工作

1.安装ROS与Gazebo11

*参考教程:

Gazebo学习(一)Ubuntu20.04安装ROS+gazebo11+模型库导入(汇总跳转连接+个人安装记录)_gazebo模型库-优快云博客文章浏览阅读3.9k次,点赞11次,收藏70次。记录在Ubuntu20.04中安装ROS和Gazebo过程,汇总了找到的链接以及记录个人遇到问题及解决方法。_gazebo模型库icon-default.png?t=O83Ahttps://blog.youkuaiyun.com/Jenniehubby/article/details/134780066?spm=1001.2014.3001.5501

2.安装wstool

sudo apt install python3-wstool

二、源码下载编译

1.创建ROS工程

mkdir -p ~/UAV/src
cd ~/UAV/src
​catkin_init_workspace
wstool init

2.下载源码

git clone https://github.com/ethz-asl/rotors_simulator.git

3.下载所需要配置文件

*注:这里满的话可能需要挂梯子或者换源,以及需要登陆自己的Github账号才有权限,直接运行指令不成功可以去Github对应仓库自行下载放在scr目录下*

*无权限可参考教程:Linux——使用github提示错误Please make sure you have the correct access rights and the repository exists._linux please make sure you have the correct access-优快云博客文章浏览阅读3.5k次,点赞6次,收藏10次。文章目录1. 问题描述2. 解决方法2.1 设置用户信息2.2 删除旧配置文件生成配置文件登记KEY测试1. 问题描述今天在使用git clone命令时出现了下面的提示Please make sure you have the correct access rights and the repository exists.很懵呀,以前都没遇到过,谷歌了下,发现是SSH KEY的问题,需要重新添加KEY才阔以,解决方法如下。2. 解决方法2.1 设置用户信息打开一个命令窗口,输入:git _linux please make sure you have the correct access rights and the repositoryicon-default.png?t=O83Ahttps://blog.youkuaiyun.com/qq_16775293/article/details/109329492

git clone https://github.com/ethz-asl/mav_comm.git
git clone https://github.com/ethz-asl/glog_catkin.git
git clone https://github.com/ethz-asl/catkin_simple.git

4.编译环境

cd ..
catkin_make

 **如果编译[100%],恭喜你丝滑编译成功!!!如果冒红没关系看后面的ERROR解决大法~**

三、测试运行

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

四、编译可能遇到问题

 *参考教程:ROS——工程编译出错:Could not find a package configuration file provided by-优快云博客文章浏览阅读2.2w次,点赞34次,收藏110次。文章目录问题描述解决方法问题描述  在catkin_make 编译ROS工程时,通常会出现如下的错误:-- Could NOT find octomap_ros (missing: octomap_ros_DIR)-- Could not find the required component 'octomap_ros'. The following CMake error indicates that you either need to install the package with the_could not find a package configuration file provided by "octomap" with any oicon-default.png?t=O83Ahttps://blog.youkuaiyun.com/qq_16775293/article/details/109330494

1.缺少相关安装包

报错:

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

    octomap_rosConfig.cmake
    octomap_ros-config.cmake

  Add the installation prefix of "octomap_ros" to CMAKE_PREFIX_PATH or set
  "octomap_ros_DIR" to a directory containing one of the above files.  If
  "octomap_ros" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:106 (find_package)

解决:

sudo apt-get install ros-noetic-octomap-msgs

同理会有其他同样格式出现的未安装包出现,以同样方法运行下面代码,将“octomap-msgs”部分替换成报错中“xxConfig.cmake”中的xx:

sudo apt-get install ros-noetic-xx

2.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  

3.无法定位软件包 ros-noetic-desktop-full

解决:

sudo apt update
sudo apt install ros-noetic-desktop-full

4.rotors_gazebo_plugins build fail

解决:

打开:~/UAV/src/rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt

将“add_definitions(-std=c++11)”修改成:

add_definitions(-std=c++17)

5.其他

*参考教程:

ROS——无人机ROS仿真包 rotors_simulator 编译教程_rotos simulator教程-优快云博客文章浏览阅读4.1k次,点赞8次,收藏61次。文章目录安装wstoolsudo apt install python3-wstool创建ROS工程$ mkdir -p ~/UAV/src$ cd ~/UAV/src$ catkin_init_workspace # initialize your catkin workspace$ wstool init下载源码git clone git@github.com:ethz-asl/rotors_simulator.git源码链接:https://github.com/eth_rotos simulator教程icon-default.png?t=O83Ahttps://blog.youkuaiyun.com/qq_16775293/article/details/109329022?spm=1001.2014.3001.5506

Issues · ethz-asl/rotors_simulator · GitHubRotorS is a UAV gazebo simulator. Contribute to ethz-asl/rotors_simulator development by creating an account on GitHub.icon-default.png?t=O83Ahttps://github.com/ethz-asl/rotors_simulator/issues

**以上为我所遇到的各种问题,如果还有其他问题可以查询一下上面两个链接参考,也欢迎评论区交流** 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值