Airsim+UnrealEngine 搭建自动驾驶虚拟环境

##Airsim

AirSim is a simulator for drones, cars and more built on Unreal Engine. It is open-source, cross platform and supports hardware-in-loop with popular flight controllers such as PX4 for physically and visually realistic simulations. It is developed as an Unreal plugin that can simply be dropped in to any Unreal environment you want.

Our goal is to develop AirSim as a platform for AI research to experiment with deep learning, computer vision and reinforcement learning algorithms for autonomous vehicles. For this purpose, AirSim also exposes APIs to retrieve data and control vehicles in a platform independent way.
         ——Microsoft

微软想把它打造成人工智能研究的仿真平台,以无人驾驶为主(比如自主无人机、自动驾驶汽车),在Airsim中跑深度学习,计算机视觉和强化学习算法。

##Unreal Engine

The Unreal Engine is a game engine developed by Epic Games.With its code written in C++, the Unreal Engine features a high degree of portability and is a tool used by many game developers today.The current release is Unreal Engine 4, designed for Microsoft Windows, macOS, Linux, SteamOS, HTML5, iOS, Android, Nintendo Switch, PlayStation 4, Xbox One and virtual reality (SteamVR/HTC Vive, Oculus Rift, PlayStation VR, Google Daydream, OSVR and Samsung Gear VR).

##在Linux下环境搭建
1. 编译安装 UnrealEngine
UnrealEngine在github上私有的项目,https://github.com/EpicGames/UnrealEngine.git 不信你点点看。
但是只要你申请加入Unreal engine项目的组织,还是可以Clone下来的,具体步骤。

1、首先登陆UnrealEngine的缔造者Epic的官网,注册一个账号
2、然后在Epic的个人页面下–账号关联,关联到自己的GitHub账号 (这个关联表明你申请加入EpicGames的开发,他会向你发出一个加入邀请)
3、登陆GitHub,在https://github.com/EpicGames 确认邀请就可以了

Airsim+UnrealEngine 搭建自动驾驶虚拟环境_第1张图片

接下来就按照Build It on Linux的步骤,下载、编译安装 就可以啦

git clone -b 4.17 https://github.com/EpicGames/UnrealEngine.git
cd UnrealEngine
//few times Epic folks broke the build so we will get commit that works
git checkout af96417313a908b20621a443175ba91683c238c8
./Setup.sh
./GenerateProjectFiles.sh
 make
 //注意 UnrealEngine这个东西很占地方,不仅下载大,编译更大,所以你的HOME下至少要有20G的Free Space,不然等你编译的时候,空间占满了,就失败了,我开始就这样,后来把我的双系统Windows下的一个分区挂到home下的一个文件夹下,才解决。
     # go to folder where you clone GitHub projects
     git clone https://github.com/Microsoft/AirSim.git
     cd AirSim
     ./setup.sh
     ./build.sh

./Engine/Binaries/Linux/UE4Editor 执行这个这个路径下的可执行程序,启动Unreal Engine试试。有两点说明。

  1. 如果在初始化启动的过程中出错了(比如OpenGL的错误),说明你要按照NVIDIA的显卡驱动
  2. 这个软件很大,对显卡的显存要求也比较高

用于仿真的多个UE4的场景

场景 描述
Africa.zip 1.05G
Blocks.zip 327 MB
CityEnviron.zip.001 1.66 GB
CityEnviron.zip.002 1.24 GB
Forest.zip 1.17 GB
LandscapeMountains.zip 657 MB
Neighborhood.zip 1.42 GB
SimpleMaze.zip 423 MB
TrapCam.zip.001 1.76 GB
TrapCam.zip.002 1.33 GB
Warehouse.zip 837 MB
ZhangJiaJie.zip 517 MB

Source code (zip)
Source code (tar.gz)

OK 至此,Airsim+UnrealEngine 在Linux下的环境就搭建好了,可以自己先体验一下。
后面再分享Airsim+UnrealEngine的使用

AirSim Settings.json 很总要


Software-In-Loop Simulation (SIL)

Airsim SIL简单说明


Aerial Informatics and Robotics Platform 官方Airsim说明文档

【1/编译安装】
Unreal Engine + AirSim/docs/build_linux.md
[Unreal Engine + AirSim/docs/build_windows.md]

【2/启动与使用】

camera_views.md
通过F1开关camera settings.json设置image mode 机器性能影响帧率

flight_controller.md
简要说明 Flight Controller HIL SIL simple_flight PX4

hello_drone.md 介绍hello drone如何工作的
Airsim启动时,会启动RPC server, Hello Drone uses the RPC client to connect it.

multi_vehicle.md :Setting Up Multiple Vehicles

px4_build.md  
make posix_sitl_default
./build_posix_sitl_default/src/firmware/posix/px4 ./posix-configs/SITL/init/ekf2/iris

px4_setup.md PX4 Setup for AirSim
Setting up PX4 Hardware-in-Loop
Setting up PX4 Software-in-Loop

px4_sitl.md 详细讲Setting up PX4 Software-in-Loop

FAQ.md

log_viewer.md Log Viewer是一个数据调试工具

【3/深究Airsim】
design.md & paper

code_structure.md Airsim代码组织结构
AirLib包含(Physics engine、Sensor models、Vehicle models、Control library)
Unreal/Plugins/AirSim Unreal Engine中用于自动驾驶的一个插件
MavLinkCom  
Sample Programs 一些例程examples hellocar helloDrone Droneshell

custom_drone.md AirLib on a Real Drone

apis.md —— c++ API hello drone/ hello car
python.md——Python API接口使用
image_apis.md

reinforcement_learning.md Reinforcement Learning in AirSim

Remote Control.md 遥控的使用

Hardware-In-Loop Simulation)(HIL)

YouTube有关HIL using Airsim的视频教程
UE+AirSim& PX4+遥控器 在Windows环境下搭建

Pixhawk 有关硬件在环仿真的说明


强化学习demo
DeepQNeuralNetwork in AirSim using CNTK
https://github.com/Microsoft/AirSim/blob/master/PythonClient/DQNdrone.py

Autonomous vehicle navigation based on Deep Reinforcement Learnin using AirSim

参考文档:
Building On Linux

你可能感兴趣的:(机器学习)