赞
踩
flightmare,是uzh组基于unity 3D, gazebo 做的仿真软件:
1. 效果视频:https://www.bilibili.com/video/BV1mf4y1Q7VD?from=search&seid=14905217311811133451
2. code:https://github.com/uzh-rpg/flightmare
3. flightmare 介绍视频:https://www.bilibili.com/video/BV16v411r7dB?from=search&seid=14905217311811133451
4. 官方document: https://flightmare.readthedocs.io/en/latest/
可以先git clone 工程文件,找到以下路径:
/flightmare/docs/source/getting_started/
其中的quick_start.rst,其中简要介绍了安装的依赖与步骤。内容简洁摘要如下:
sudo apt-get install git
git config --global user.name "Your Name Here"
git config --global user.email "Same Email as used for github"
git config --global color.ui true
apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
libzmqpp-dev \
libopencv-dev
conda create --name ENVNAME python=3.6
conda activate ENVNAME
git clone https://github.com/uzh-rpg/flightmare.git
echo "export FLIGHTMARE_PATH=~/Desktop/flightmare" >> ~/.bashrc
source ~/.bashrc
conda activate ENVNAME
cd flightmare/
pip install -r requirements.txt
其中不建议使用VCS,只有7个依赖,直接找到txt文件打开,git clone会比用VCS快
cd flightmare/flightlib
# it first compile the flightlib and then install it as a python package.
pip install .
sudo apt-get install gazebo9
sudo apt-get install gazebo7
sudo apt-get install gazebo2
sudo apt-get install libgoogle-glog-dev protobuf-compiler ros-$ROS_DISTRO-octomap-msgs ros-$ROS_DISTRO-octomap-ros ros-$ROS_DISTRO-joy python-vcstool
sudo apt-get install python-pip
sudo pip install catkin-tools
cd
mkdir -p catkin_ws/src
cd catkin_ws
catkin config --init --mkdirs --extend /opt/ros/$ROS_DISTRO --merge-devel --cmake-args -DCMAKE_BUILD_TYPE=Release
cd ~/catkin_ws/src
git clone https://github.com/uzh-rpg/flightmare.git
vcs-import < flightmare/flightros/dependencies.yaml
catkin build
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
echo "export FLIGHTMARE_PATH=~/catkin_ws/src/flightmare" >> ~/.bashrc
source ~/.bashrc
安装的其他参考博客:
https://blog.csdn.net/ZNxiaobai/article/details/109687203?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-5.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7Edefault-5.control
/home/zzx/flightmare/src/flightmare/flightlib/include/flightlib/bridges/unity_bridge.hpp:19:10: fatal error: zmqpp/zmqpp.hpp: 没有那个文件或目录
#include <zmqpp/zmqpp.hpp>
关于ZeroMQ:
ZMQ(以下ZeroMQ简称ZMQ)是一个简单好用的传输层,像框架一样的一个socket library,他使得Socket编程更加简单、简洁和性能更高。是一个消息处理队列库,可在多个线程、内核和主机盒之间弹性伸缩。ZMQ的明确目标是“成为标准网络协议栈的一部分,之后进入Linux内核”。现在还未看到它们的成功。但是,它无疑是极具前景的、并且是人们更加需要的“传统”BSD套接字之上的一 层封装。
解决方法:
安装 zmqpp
git clone https://github.com/zeromq/libzmq.git
git checkout v4.3.3
cd libzmq && ./configure --prefix=/usr
make -j4 && sudo make install
roslaunch flightros rotors_gazebo.launch
在flightmare的document中(链接:https://flightmare.readthedocs.io/en/latest/),查找“unity”,有需要的版本号和安装链接
unity需要安装两部分: editor +hub
unity下载中文网站:https://unity.cn/releases/full/2020
**unity hub **:( v2.0)
https://forum.unity.com/threads/unity-hub-v2-0-0-release.677485/
unity editor : Unity Editor Unity 2020.1.10
安装完hub后,可以在hub中下载editor
选择左侧的install, 选择版本。(在flightmare的官方document中推荐2020.2.10,在下载页面中unity推荐了2020.3,所以安装了这一版,经测试也可以使用。在官方document中提到也可以使用旧版的editor,只是需要放弃一些功能)
文章:Unity2020.1新功能探路:编辑器相关更新
https://www.bilibili.com/read/cv6474757/
xz -d Unity.tar.xz
tar -xvf Unity.tar
两步分别得到 Unity.tar压缩包 以及 文件夹Editor
chmod 744 文件名
保存第一步中的许可证,根据提示进行用户注册,进行人机验证后提交,进入邮箱点击相关邮件进行确认,在第二步中添加第一步中的许可证;再开启unity时则可以看到如下界面
最终,运行roslaunch flightros rotors_gazebo.launch时可以得到:
conda activate ENVNAME
cd /path/to/flightmare/flightrl
pip install .
cd examples
python3 run_drone_control.py --train 0 --render 1
# The examples are by default not built.
catkin build flightros -DBUILD_SAMPLES:=ON
# Now you can run any example.
roslaunch flightros rotors_gazebo.launch
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。