Skip to content

Commit

Permalink
doc update; fix bash snippet md rendering; misc doc indentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
madratman committed Jul 24, 2020
1 parent 6444edc commit 81d4cab
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 184 deletions.
6 changes: 3 additions & 3 deletions docs/azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Use [this](https://github.com/microsoft/AirSim/blob/master/azure/azure-env-creat
- When using an Azure Trial account, the default vCPU quota may not be enough to allocate the required VM to run AirSim. If that's the case, you will see an error when trying to create the VM and will have to make a support request to increase the default quota.

- To avoid charges for the Virtual Machine usage while not in use, remember to deallocate its resources from the [Azure Portal](https://portal.azure.com) or use the following command from the Azure CLI:
```bash
az vm deallocate --resource-group MyResourceGroup --name MyVMName
```
```bash
az vm deallocate --resource-group MyResourceGroup --name MyVMName
```

## Code and debug from Visual Studio Code and Remote SSH
- Install Visual Studio Code
Expand Down
37 changes: 19 additions & 18 deletions docs/build_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,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 +41,19 @@ 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.
By default AirSim uses clang 8 to build for compatibility 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
# use ./build.sh --debug to build in debug mode
```

### Build Unreal Environment

Expand Down
147 changes: 80 additions & 67 deletions docs/docker_ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ We've two options for docker. You can either build an image for running [airsim
You can specify any [NVIDIA cudagl](https://hub.docker.com/r/nvidia/cudagl/) at your own risk.
`--target_image` is the desired name of your docker image.
Defaults to `airsim_binary` with same tag as the base image
```
$ cd Airsim/docker;
$ python build_airsim_image.py \
--base_image=nvidia/cudagl:10.0-devel-ubuntu18.04 \
--target_image=airsim_binary:10.0-devel-ubuntu18.04
```

```bash
$ cd Airsim/docker;
$ python build_airsim_image.py \
--base_image=nvidia/cudagl:10.0-devel-ubuntu18.04 \
--target_image=airsim_binary:10.0-devel-ubuntu18.04
```

- Verify you have an image by:
`$ docker images | grep airsim`
Expand All @@ -25,28 +26,32 @@ We've two options for docker. You can either build an image for running [airsim
- Get [an unreal binary](https://github.com/Microsoft/AirSim/releases/tag/v1.2.0Linux) or package your own project in Ubuntu.
Let's take the Blocks binary as an example.
You can download it by running
```
$ cd Airsim/docker;
$ ./download_blocks_env_binary.sh
```

```bash
$ cd Airsim/docker;
$ ./download_blocks_env_binary.sh
```

- Running an unreal binary inside a docker container
The syntax is:
```
$ ./run_airsim_image_binary.sh DOCKER_IMAGE_NAME UNREAL_BINARY_SHELL_SCRIPT UNREAL_BINARY_ARGUMENTS -- headless
```

```bash
$ ./run_airsim_image_binary.sh DOCKER_IMAGE_NAME UNREAL_BINARY_SHELL_SCRIPT UNREAL_BINARY_ARGUMENTS -- headless
```

For blocks, you can do a `$ ./run_airsim_image_binary.sh airsim_binary:10.0-devel-ubuntu18.04 Blocks/Blocks.sh -windowed -ResX=1080 -ResY=720`

* `DOCKER_IMAGE_NAME`: Same as `target_image` parameter in previous step. By default, enter `airsim_binary:10.0-devel-ubuntu18.04`
* `UNREAL_BINARY_SHELL_SCRIPT`: for Blocks enviroment, it will be `Blocks/Blocks.sh`
* [`UNREAL_BINARY_ARGUMENTS`](https://docs.unrealengine.com/en-us/Programming/Basics/CommandLineArguments):
For airsim, most relevant would be `-windowed`, `-ResX`, `-ResY`. Click on link to see all options.

* Running in Headless mode:
Suffix `-- headless` at the end:
```
$ ./run_airsim_image_binary.sh Blocks/Blocks.sh -- headless
```
* Running in Headless mode:
Suffix `-- headless` at the end:
```bash
$ ./run_airsim_image_binary.sh Blocks/Blocks.sh -- headless
```

- [Specifying a `settings.json`](https://github.com/Microsoft/AirSim/blob/master/docs/docker_ubuntu.md#airsim_binary-docker-image)

## Source
Expand Down Expand Up @@ -79,18 +84,22 @@ You can download it by running
`--base_image`: This is image over which we'll install airsim. We've tested on `adamrehn/ue4-engine:4.19.2-cudagl10.0`. See [ue4-docker](https://adamrehn.com/docs/ue4-docker/building-images/available-container-images) for other versions.
`--target_image` is the desired name of your docker image.
Defaults to `airsim_source` with same tag as the base image
```
$ cd Airsim/docker;
$ python build_airsim_image.py \
--source \
----base_image adamrehn/ue4-engine:4.19.2-cudagl10.0 \
--target_image=airsim_source:4.19.2-cudagl10.0
```

```bash
$ cd Airsim/docker;
$ python build_airsim_image.py \
--source \
----base_image adamrehn/ue4-engine:4.19.2-cudagl10.0 \
--target_image=airsim_source:4.19.2-cudagl10.0
```

#### Running AirSim container
* Run the airsim source image we built by:
```
./run_airsim_image_source.sh airsim_source:4.19.2-cudagl10.0
```

```bash
./run_airsim_image_source.sh airsim_source:4.19.2-cudagl10.0
```

Syntax is `./run_airsim_image_source.sh DOCKER_IMAGE_NAME -- headless`
`-- headless`: suffix this to run in optional headless mode.

Expand All @@ -103,52 +112,56 @@ You can download it by running
#### [Misc] Packaging Unreal Environments in `airsim_source` containers
* Let's take the Blocks environment as an example.
In the following script, specify the full path to your unreal uproject file by `project` and the directory where you want the binaries to be placed by `archivedirectory`
```
$ /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -platform=Linux -clientconfig=Shipping -serverconfig=Shipping -noP4 -cook -allmaps -build -stage -prereqs -pak -archive \
-archivedirectory=/home/ue4/Binaries/Blocks/ \
-project=/home/ue4/AirSim/Unreal/Environments/Blocks/Blocks.uproject
```

```bash
$ /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -platform=Linux -clientconfig=Shipping -serverconfig=Shipping -noP4 -cook -allmaps -build -stage -prereqs -pak -archive \
-archivedirectory=/home/ue4/Binaries/Blocks/ \
-project=/home/ue4/AirSim/Unreal/Environments/Blocks/Blocks.uproject
```

This would create a Blocks binary in `/home/ue4/Binaries/Blocks/`.
You can test it by running `/home/ue4/Binaries/Blocks/LinuxNoEditor/Blocks.sh -windowed`

### Specifying an airsim settings.json
#### `airsim_binary` docker image:
#### `airsim_binary` docker image:
- We're mapping the host machine's `PATH/TO/Airsim/docker/settings.json` to the docker container's `/home/airsim_user/Documents/AirSim/settings.json`.
- Hence, we can load any settings file by simply modifying `PATH_TO_YOUR/settings.json` by modifying the following snippets in * [`run_airsim_image_binary.sh`](https://github.com/Microsoft/AirSim/blob/master/docker/run_airsim_image_binary.sh)
```
nvidia-docker run -it \
-v $PATH_TO_YOUR/settings.json:/home/airsim_user/Documents/AirSim/settings.json \
-v $UNREAL_BINARY_PATH:$UNREAL_BINARY_PATH \
-e SDL_VIDEODRIVER=$SDL_VIDEODRIVER_VALUE \
-e SDL_HINT_CUDA_DEVICE='0' \
--net=host \
--env="DISPLAY=$DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-env="XAUTHORITY=$XAUTH" \
--volume="$XAUTH:$XAUTH" \
--runtime=nvidia \
--rm \
$DOCKER_IMAGE_NAME \
/bin/bash -c "$UNREAL_BINARY_COMMAND"
```
#### `airsim_source` docker image:

```bash
nvidia-docker run -it \
-v $PATH_TO_YOUR/settings.json:/home/airsim_user/Documents/AirSim/settings.json \
-v $UNREAL_BINARY_PATH:$UNREAL_BINARY_PATH \
-e SDL_VIDEODRIVER=$SDL_VIDEODRIVER_VALUE \
-e SDL_HINT_CUDA_DEVICE='0' \
--net=host \
--env="DISPLAY=$DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-env="XAUTHORITY=$XAUTH" \
--volume="$XAUTH:$XAUTH" \
--runtime=nvidia \
--rm \
$DOCKER_IMAGE_NAME \
/bin/bash -c "$UNREAL_BINARY_COMMAND"
```

#### `airsim_source` docker image:

* We're mapping the host machine's `PATH/TO/Airsim/docker/settings.json` to the docker container's `/home/airsim_user/Documents/AirSim/settings.json`.
* Hence, we can load any settings file by simply modifying `PATH_TO_YOUR/settings.json` by modifying the following snippets in [`run_airsim_image_source.sh`](https://github.com/Microsoft/AirSim/blob/master/docker/run_airsim_image_source.sh):
```
nvidia-docker run -it \
-v $(pwd)/settings.json:/home/airsim_user/Documents/AirSim/settings.json \
-e SDL_VIDEODRIVER=$SDL_VIDEODRIVER_VALUE \
-e SDL_HINT_CUDA_DEVICE='0' \
--net=host \
--env="DISPLAY=$DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-env="XAUTHORITY=$XAUTH" \
--volume="$XAUTH:$XAUTH" \
--runtime=nvidia \
--rm \
$DOCKER_IMAGE_NAME
```

```bash
nvidia-docker run -it \
-v $(pwd)/settings.json:/home/airsim_user/Documents/AirSim/settings.json \
-e SDL_VIDEODRIVER=$SDL_VIDEODRIVER_VALUE \
-e SDL_HINT_CUDA_DEVICE='0' \
--net=host \
--env="DISPLAY=$DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-env="XAUTHORITY=$XAUTH" \
--volume="$XAUTH:$XAUTH" \
--runtime=nvidia \
--rm \
$DOCKER_IMAGE_NAME
```
4 changes: 2 additions & 2 deletions docs/lidar.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ Use `getLidarData()` API to retrieve the Lidar data.
* Can be used to transform points to other frames.

### Python Examples
[drone_lidar.py](https://github.com/Microsoft/AirSim/tree/master/PythonClient//multirotor)
[car_lidar.py](https://github.com/Microsoft/AirSim/tree/master/PythonClient//car)
- [drone_lidar.py](https://github.com/Microsoft/AirSim/tree/master/PythonClient//multirotor)
- [car_lidar.py](https://github.com/Microsoft/AirSim/tree/master/PythonClient//car)

## Coming soon
* Visualization of lidar data on client side.
Loading

0 comments on commit 81d4cab

Please sign in to comment.