Skip to content

Commit

Permalink
[docs] Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed May 17, 2020
1 parent be424b0 commit 43386ed
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 91 deletions.
86 changes: 44 additions & 42 deletions docs/build_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Only macOS **Catalina (10.15)** is supported.
We've two options - you can either build inside docker containers or your host machine.

## Docker

Please see instructions [here](https://github.com/Microsoft/AirSim/blob/master/docs/docker_ubuntu.md)

## Host machine
Expand All @@ -19,14 +20,14 @@ Please see instructions [here](https://github.com/Microsoft/AirSim/blob/master/d

- Clone Unreal in your favorite folder and build it (this may take a while!). **Note**: We only support Unreal >= 4.22 at present. We recommend using 4.24.

```bash
# go to the folder where you clone GitHub projects
git clone -b 4.24 https://github.com/EpicGames/UnrealEngine.git
cd UnrealEngine
./Setup.sh
./GenerateProjectFiles.sh
make
```
```bash
# go to the folder where you clone GitHub projects
git clone -b 4.24 https://github.com/EpicGames/UnrealEngine.git
cd UnrealEngine
./Setup.sh
./GenerateProjectFiles.sh
make
```

#### macOS - Download Unreal Engine

Expand All @@ -41,18 +42,18 @@ Click on the `Add Versions` which should show the option to download **Unreal 4.

- Clone AirSim and build it:

```bash
# go to the folder where you clone GitHub projects
git clone https://github.com/Microsoft/AirSim.git
cd AirSim
```
```bash
# go to the folder where you clone GitHub projects
git clone https://github.com/Microsoft/AirSim.git
cd AirSim
```

By default AirSim recommends using clang 8 to build the binaries as those will be compatible with UE 4.24. The setup script will install the right version of cmake, llvm, and eigen.

```bash
./setup.sh
./build.sh
```
```bash
./setup.sh
./build.sh
```

### Build Unreal Environment

Expand All @@ -68,17 +69,17 @@ Once AirSim is setup:
- When Unreal Engine prompts for opening or creating project, select Browse and choose `AirSim/Unreal/Environments/Blocks` (or your [custom](unreal_custenv.md) Unreal project).
- Alternatively, the project file can be passed as a commandline argument. For Blocks: `./Engine/Binaries/Linux/UE4Editor <AirSim_path>/Unreal/Environments/Blocks/Blocks.uproject`
- If you get prompts to convert project, look for More Options or Convert-In-Place option. If you get prompted to build, choose Yes. If you get prompted to disable AirSim plugin, choose No.
- After Unreal Editor loads, press Play button.
- After Unreal Editor loads, press Play button.

### Mac

- Browse to `AirSim/Unreal/Environments/Blocks`.
- Run `./GenerateProjectFiles.sh <UE_PATH>` from the terminal, where `UE_PATH` is the path to the Unreal installation folder. (By default, this is `/Users/Shared/Epic\ Games/UE_4.24/`) The script creates an XCode workspace by the name Blocks.xcworkspace.
- Open the XCode workspace, and press the Build and run button in the top left.
- After Unreal Editor loads, press Play button.
- Open the XCode workspace, and press the Build and run button in the top left.
- After Unreal Editor loads, press Play button.

See [Using APIs](apis.md) and [settings.json](settings.md) for various options available for AirSim usage.
Tip: go to 'Edit->Editor Preferences', in the 'Search' box type 'CPU' and ensure that the 'Use Less CPU when in Background' is unchecked.
Tip: go to 'Edit->Editor Preferences', in the 'Search' box type 'CPU' and ensure that the 'Use Less CPU when in Background' is unchecked.

### [Optional] Setup Remote Control (Multirotor Only)

Expand All @@ -88,38 +89,39 @@ Alternatively, you can use [APIs](apis.md) for programmatic control or use the s

## FAQs

- I'm getting error "<MyProject> could not be compiled. Try rebuilding from source manually".
* This could either happen because of compile error or the fact that your gch files are outdated. Look in to your console window. Do you see something like below?
```
fatal error: file '/usr/include/linux/version.h''/usr/include/linux/version.h' has been modified since the precompiled header
```
* If this is the case then look for *.gch file(s) that follows after that message, delete them and try again. Here's [relevant thread](https://answers.unrealengine.com/questions/412349/linux-ue4-build-precompiled-header-fatal-error.html) on Unreal Engine forums.
* If you see other compile errors in console then open up those source files and see if it is due to changes you made. If not, then report it as issue on GitHub.
- I'm getting error `<MyProject> could not be compiled. Try rebuilding from source manually`.
* This could either happen because of compile error or the fact that your gch files are outdated. Look in to your console window. Do you see something like below?

`fatal error: file '/usr/include/linux/version.h''/usr/include/linux/version.h' has been modified since the precompiled header`

* If this is the case then look for *.gch file(s) that follows after that message, delete them and try again. Here's [relevant thread](https://answers.unrealengine.com/questions/412349/linux-ue4-build-precompiled-header-fatal-error.html) on Unreal Engine forums.

* If you see other compile errors in console then open up those source files and see if it is due to changes you made. If not, then report it as issue on GitHub.

- Unreal crashed! How do I know what went wrong?
* Go to the `MyUnrealProject/Saved/Crashes` folder and search for the file `MyProject.log` within its subdirectories. At the end of this file you will see the stack trace and messages.
You can also take a look at the `Diagnostics.txt` file.
* Go to the `MyUnrealProject/Saved/Crashes` folder and search for the file `MyProject.log` within its subdirectories. At the end of this file you will see the stack trace and messages.
You can also take a look at the `Diagnostics.txt` file.

- How do I use an IDE on Linux?
* You can use Qt Creator or CodeLite. Instructions for Qt Creator are available [here](https://docs.unrealengine.com/latest/INT/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnIDE/index.html).
* You can use Qt Creator or CodeLite. Instructions for Qt Creator are available [here](https://docs.unrealengine.com/latest/INT/Platforms/Linux/BeginnerLinuxDeveloper/SettingUpAnIDE/index.html).

- Can I cross compile for Linux from a Windows machine?
* Yes, you can, but we haven't tested it. You can find the instructions [here](https://docs.unrealengine.com/latest/INT/Platforms/Linux/GettingStarted/index.html).
* Yes, you can, but we haven't tested it. You can find the instructions [here](https://docs.unrealengine.com/latest/INT/Platforms/Linux/GettingStarted/index.html).

- What compiler and stdlib does AirSim use?
* We use the same compiler that Unreal Engine uses, **Clang 8**, and stdlib, **libc++**. AirSim's `setup.sh` will automatically download them.
* We use the same compiler that Unreal Engine uses, **Clang 8**, and stdlib, **libc++**. AirSim's `setup.sh` will automatically download them.

- What version of CMake does the AirSim build use?
* 3.10.0 or higher. This is *not* the default in Ubuntu 16.04 so setup.sh installs it for you. You can check your CMake version using `cmake --version`. If you have an older version, follow [these instructions](cmake_linux.md) or see the [CMake website](https://cmake.org/install/).
* 3.10.0 or higher. This is *not* the default in Ubuntu 16.04 so setup.sh installs it for you. You can check your CMake version using `cmake --version`. If you have an older version, follow [these instructions](cmake_linux.md) or see the [CMake website](https://cmake.org/install/).

- Can I compile AirSim in BashOnWindows?
* Yes, however, you can't run Unreal from BashOnWindows. So this is kind of useful to check a Linux compile, but not for an end-to-end run.
See the [BashOnWindows install guide](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide).
Make sure to have the latest version (Windows 10 Creators Edition) as previous versions had various issues.
Also, don't invoke `bash` from `Visual Studio Command Prompt`, otherwise CMake might find VC++ and try and use that!
* Yes, however, you can't run Unreal from BashOnWindows. So this is kind of useful to check a Linux compile, but not for an end-to-end run.
See the [BashOnWindows install guide](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide).
Make sure to have the latest version (Windows 10 Creators Edition) as previous versions had various issues.
Also, don't invoke `bash` from `Visual Studio Command Prompt`, otherwise CMake might find VC++ and try and use that!

- Where can I find more info on running Unreal on Linux?
* Start here: [Unreal on Linux](https://docs.unrealengine.com/latest/INT/Platforms/Linux/index.html)
* [Building Unreal on Linux](https://wiki.unrealengine.com/Building_On_Linux#Clang)
* [Unreal Linux Support](https://wiki.unrealengine.com/Linux_Support)
* [Unreal Cross Compilation](https://wiki.unrealengine.com/Compiling_For_Linux)
* Start here: [Unreal on Linux](https://docs.unrealengine.com/latest/INT/Platforms/Linux/index.html)
* [Building Unreal on Linux](https://wiki.unrealengine.com/Building_On_Linux#Clang)
* [Unreal Linux Support](https://wiki.unrealengine.com/Linux_Support)
* [Unreal Cross Compilation](https://wiki.unrealengine.com/Compiling_For_Linux)
97 changes: 48 additions & 49 deletions docs/unreal_custenv.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,71 +4,71 @@ This page contains the complete instructions start to finish for setting up Unre
Below we will use a freely downloadable environment from Unreal Marketplace called Landscape Mountain but the steps are same for any other environments. You can also view these steps performed in [Unreal AirSim Setup Video](https://youtu.be/1oY8Qu5maQQ).

## Note for Linux Users
There is no `Epic Games Launcher` for Linux which means that if you need to create custom environment, you will need Windows machine to do that. Once you have Unreal project folder, just copy it over to your Linux machine.
There is no `Epic Games Launcher` for Linux which means that if you need to create custom environment, you will need Windows machine to do that. Once you have Unreal project folder, just copy it over to your Linux machine.

## Step by Step Instructions

1. Make sure AirSim is built and Unreal 4.24 is installed as described in [build instructions](build_windows.md).
2. In `Epic Games Launcher` click the Learn tab then scroll down and find `Landscape Mountains`. Click the `Create Project` and download this content (~2GB download).

![current version](images/landscape_mountains.png)
![current version](images/landscape_mountains.png)

3. Open `LandscapeMountains.uproject`, it should launch the Unreal Editor.

![unreal editor](images/unreal_editor.png)
![unreal editor](images/unreal_editor.png)

4. From the `File menu` select `New C++ class`, leave default `None` on the type of class, click `Next`, leave default name `MyClass`, and click `Create Class`. We need to do this because Unreal requires at least one source file in project. It should trigger compile and open up Visual Studio solution `LandscapeMountains.sln`.

5. Go to your folder for AirSim repo and copy `Unreal\Plugins` folder in to your `LandscapeMountains` folder. This way now your own Unreal project has AirSim plugin.

6. Edit the `LandscapeMountains.uproject` so that it looks like this

```
{
"FileVersion": 3,
"EngineAssociation": "4.24",
"Category": "Samples",
"Description": "",
"Modules": [
{
"Name": "LandscapeMountains",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"AirSim"
]
}
],
"TargetPlatforms": [
"MacNoEditor",
"WindowsNoEditor"
],
"Plugins": [
{
"Name": "AirSim",
"Enabled": true
}
]
}
```
```
{
"FileVersion": 3,
"EngineAssociation": "4.24",
"Category": "Samples",
"Description": "",
"Modules": [
{
"Name": "LandscapeMountains",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"AirSim"
]
}
],
"TargetPlatforms": [
"MacNoEditor",
"WindowsNoEditor"
],
"Plugins": [
{
"Name": "AirSim",
"Enabled": true
}
]
}
```
7. Close Visual Studio and the `Unreal Editor` and right click the LandscapeMountains.uproject in Windows Explorer and select `Generate Visual Studio Project Files`. This step detects all plugins and source files in your Unreal project and generates `.sln` file for Visual Studio.
![regen](images/regen_sln.png)
![regen](images/regen_sln.png)
Tip: If the `Generate Visual Studio Project Files` option is missing you may need to reboot your machine for the Unreal Shell extensions to take effect. If it is still missing then open the LandscapeMountains.uproject in the Unreal Editor and select `Refresh Visual Studio Project` from the `File` menu.
Tip: If the `Generate Visual Studio Project Files` option is missing you may need to reboot your machine for the Unreal Shell extensions to take effect. If it is still missing then open the LandscapeMountains.uproject in the Unreal Editor and select `Refresh Visual Studio Project` from the `File` menu.
8. Reopen `LandscapeMountains.sln` in Visual Studio, and make sure "DebugGame Editor" and "Win64" build configuration is the active build configuration.
![build config](images/vsbuild_config.png)
![build config](images/vsbuild_config.png)
9. Press `F5` to `run`. This will start the Unreal Editor. The Unreal Editor allows you to edit the environment, assets and other game related settings. First thing you want to do in your environment is set up `PlayerStart` object. In Landscape Mountains environment, `PlayerStart` object already exist and you can find it in the `World Outliner`. Make sure its location is setup as shown. This is where AirSim plugin will create and place the vehicle. If its too high up then vehicle will fall down as soon as you press play giving potentially random behavior
![lm_player_start_pos.png](images/lm_player_start_pos.png)
![lm_player_start_pos.png](images/lm_player_start_pos.png)
10. In `Window/World Settings` as shown below, set the `GameMode Override` to `AirSimGameMode`:
![sim_game_mode.png](images/sim_game_mode.png)
![sim_game_mode.png](images/sim_game_mode.png)
11. Go to 'Edit->Editor Preferences' in Unreal Editor, in the 'Search' box type 'CPU' and ensure that the 'Use Less CPU when in Background' is unchecked. If you don't do this then UE will be slowed down dramatically when UE window loses focus.
Expand All @@ -90,7 +90,7 @@ Once you have your environment using above instructions, you should frequently u
## FAQ
#### What are other cool environments?
[Unreal Marketplace](https://www.unrealengine.com/marketplace) has dozens of prebuilt extra-ordinarily detailed [environments](https://www.unrealengine.com/marketplace/content-cat/assets/environments) ranging from Moon to Mars and everything in between. The one we have used for testing is called [Modular Neighborhood Pack](https://www.unrealengine.com/marketplace/modular-neighborhood-pack)
[Unreal Marketplace](https://www.unrealengine.com/marketplace) has dozens of prebuilt extra-ordinarily detailed [environments](https://www.unrealengine.com/marketplace/content-cat/assets/environments) ranging from Moon to Mars and everything in between. The one we have used for testing is called [Modular Neighborhood Pack](https://www.unrealengine.com/marketplace/modular-neighborhood-pack)
but you can use any environment. Another free environment is [Infinity Blade series](https://www.unrealengine.com/marketplace/infinity-blade-plain-lands). Alternatively, if you look under the Learn tab in Epic Game Launcher, you will find many free samples that you can use. One of our favorites is "A Boy and His Kite" which is a 100 square miles of highly detailed environment (caution: you will need *very* beefy PC to run it!).
#### When I press Play button some kind of video starts instead of my vehicle.
Expand All @@ -108,19 +108,18 @@ In this case, create a new blank C++ project with no Starter Content and add you
#### I already have my own Unreal project. How do I use AirSim with it?
Copy the `Unreal\Plugins` folder from the build you did in the above section into the root of your Unreal project's folder. In your Unreal project's .uproject file, add the key `AdditionalDependencies` to the "Modules" object
as we showed in the `LandscapeMountains.uproject` above.
```
```
"AdditionalDependencies": [
"AirSim"
]
```
and the `Plugins` section to the top level object:
```
"Plugins": [
{
"Name": "AirSim",
"Enabled": true
}
]
```

```
and the `Plugins` section to the top level object:
```
"Plugins": [
{
"Name": "AirSim",
"Enabled": true
}
]
```

0 comments on commit 43386ed

Please sign in to comment.