Build Unity Project
Go inside the AirSim\Unity directory: cd Unity.
Build the unity project: build.cmd.
Additionally, there is a free environment Windridge City which you can download from Unity Asset Store. And, of course, you can always create your own environment.
出错,应该是VS2017缺少组件 Windows SDK 10.0.16299.0,这个版本的组件有四个,我只安装了如下两个
这个warning不用管,至此就build完成了,生成了AirLibWrapper插件。
在Unity Asset Store中购买(免费)该资源后,用unity打开,开始下载。
下载完成后,导入即可
第一次使用,当然是全部导入啦
导入完成后,场景是这样的,很棒
但是好像有编译错误,不能直接运行
在源码中有如下解释
// NOTE: If you are getting errors of the sort that say something like:
// "The type or namespace name `PostProcessing' does not exist in the namespace"
// it is because the Post Processing Stack V2 module has not been installed in your project.
//
// To make the errors go away, you can either:
// 1 - Download PostProcessing V2 and install it into your project
// or
// 2 - Delete the CinemachinePostProcessingV2 folder from your project
postprocessing的wiki-install说明文档如下
First, make sure you don't already have the Postprocessing package installed or it will conflict
with a source installation. If you do, you can remove it using the package manager (Window -> Package Manager).
Then you can use your Git client to clone the post-processing repository into your Assets folder.
If you don't want to use a Git client you can also download a zip archive by clicking the green
button that says "Clone or download" at the top of the repository and extract it into your project.
在window->package manager里,也有安装的方法
将下载好的postprocessing解压缩到project-asset目录下,等待unity加载完新资源,此时error就没了。
运行当前场景,移动鼠标可以环视四周,安装postprocessing之后,就能看到视觉特效啦。
Start Unity and click Open project.
Select the folder AirSim\Unity\UnityDemo, and then hit the button Select Folder.
In the bottom pane, Click on Projects->Assets->Scenes. Then, Double-click on SimModeSelector, DroneDemo, or CarDemo.
Hit the play button to start the simulation (and hit play again to stop the simulation. .
Alternatively, you can change the SimMode in your Settings.json file. (you can read more about it here)
打开项目,双击打开SimModeSelector场景。(如果直接打开另外两个场景去运行,编辑器会崩溃)
直接play,会读取Settings.json
我这里没有这个路径,所以生成失败,到"C:\Users\name\Documents"目录下创建"AirSIM"文件夹,再次点击play,即成功运行场景。
如未在Settings.json中设置仿真模式,会首先弹出提示框,用于选择仿真模式。
选择Car进入CarDemo场景,仿真模拟无人车
选择Multirotor进入DroneDemo场景,仿真模拟无人机
示例项目启动完成
Controlling the car:
Use WASD or the Arrow keys or the AirSim client.
Controlling the drone:
Use the PageUP/PageDown with WASD/Arrow keys.
Changing camera views:
Keys 0, 1, 2, 3 are used to toggle windows of different camera views.
Recording simulation data:
Press Record button(Red button) located at the right bottom corner of the screen, to toggle recording of the simulation data. The recorded data can be found at Documents\AirSim(Date of recording)
以下为操作方式的翻译