Skip to content

Commit

Permalink
PR #2522
Browse files Browse the repository at this point in the history
  • Loading branch information
madratman committed Jul 24, 2020
1 parent c4e1258 commit 6b0f4b7
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 180 deletions.
7 changes: 4 additions & 3 deletions azure/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,12 @@ <h3 id="regarding-the-deployment-of-the-azure-vm">Regarding the deployment of th
<p>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.</p>
</li>
<li>
<p>To avoid charges for the Virtual Machine usage while not in use, remember to deallocate its resources from the <a href="https://portal.azure.com">Azure Portal</a> or use the following command from the Azure CLI:
<code>bash
az vm deallocate --resource-group MyResourceGroup --name MyVMName</code></p>
<p>To avoid charges for the Virtual Machine usage while not in use, remember to deallocate its resources from the <a href="https://portal.azure.com">Azure Portal</a> or use the following command from the Azure CLI:</p>
</li>
</ul>
<pre><code class="bash">az vm deallocate --resource-group MyResourceGroup --name MyVMName
</code></pre>

<h2 id="code-and-debug-from-visual-studio-code-and-remote-ssh">Code and debug from Visual Studio Code and Remote SSH<a class="headerlink" href="#code-and-debug-from-visual-studio-code-and-remote-ssh" title="Permanent link">#</a></h2>
<ul>
<li>Install Visual Studio Code</li>
Expand Down
196 changes: 108 additions & 88 deletions docker_ubuntu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
<li class="toctree-l3"><a class="reference internal" href="#misc-packaging-unreal-environments-in-airsim_source-containers">[Misc] Packaging Unreal Environments in airsim_source containers</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#specifying-an-airsim-settingsjson">Specifying an airsim settings.json</a>
<ul>
<li class="toctree-l4"><a class="reference internal" href="#airsim_binary-docker-image">airsim_binary docker image:</a>
</li>
<li class="toctree-l4"><a class="reference internal" href="#airsim_source-docker-image">airsim_source docker image:</a>
</li>
</ul>
</li>
</ul>
</li>
Expand Down Expand Up @@ -298,52 +304,58 @@ <h4 id="requirements">Requirements:<a class="headerlink" href="#requirements" ti
</ul>
<h4 id="build-the-docker-image">Build the docker image<a class="headerlink" href="#build-the-docker-image" title="Permanent link">#</a></h4>
<ul>
<li>
<p>Below are the default arguments. <br />
<li>Below are the default arguments. <br />
<code>--base_image</code>: This is image over which we'll install airsim. We've tested on Ubuntu 18.04 with CUDA 10.0.<br />
You can specify any <a href="https://hub.docker.com/r/nvidia/cudagl/">NVIDIA cudagl</a> at your own risk. <br />
<code>--target_image</code> is the desired name of your docker image. <br />
Defaults to <code>airsim_binary</code> with same tag as the base image
<code>$ 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</code></p>
</li>
<li>
<p>Verify you have an image by:
<code>$ docker images | grep airsim</code> </p>
</li>
Defaults to <code>airsim_binary</code> with same tag as the base image</li>
</ul>
<pre><code class="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
</code></pre>

<ul>
<li>Verify you have an image by:
<code>$ docker images | grep airsim</code> </li>
</ul>
<h4 id="running-an-unreal-binary-inside-a-docker-container">Running an unreal binary inside a docker container<a class="headerlink" href="#running-an-unreal-binary-inside-a-docker-container" title="Permanent link">#</a></h4>
<ul>
<li>
<p>Get <a href="https://github.com/Microsoft/AirSim/releases/tag/v1.2.0Linux">an unreal binary</a> or package your own project in Ubuntu. <br />
<li>Get <a href="https://github.com/Microsoft/AirSim/releases/tag/v1.2.0Linux">an unreal binary</a> or package your own project in Ubuntu. <br />
Let's take the Blocks binary as an example. <br />
You can download it by running
<code>$ cd Airsim/docker;
$ ./download_blocks_env_binary.sh</code></p>
</li>
<li>
<p>Running an unreal binary inside a docker container
The syntax is:
<code>$ ./run_airsim_image_binary.sh DOCKER_IMAGE_NAME UNREAL_BINARY_SHELL_SCRIPT UNREAL_BINARY_ARGUMENTS -- headless</code>
For blocks, you can do a <code>$ ./run_airsim_image_binary.sh airsim_binary:10.0-devel-ubuntu18.04 Blocks/Blocks.sh -windowed -ResX=1080 -ResY=720</code></p>
</li>
<li>
<p><code>DOCKER_IMAGE_NAME</code>: Same as <code>target_image</code> parameter in previous step. By default, enter <code>airsim_binary:10.0-devel-ubuntu18.04</code> </p>
</li>
You can download it by running</li>
</ul>
<pre><code class="bash"> $ cd Airsim/docker;
$ ./download_blocks_env_binary.sh
</code></pre>

<ul>
<li>Running an unreal binary inside a docker container
The syntax is:</li>
</ul>
<pre><code class="bash"> $ ./run_airsim_image_binary.sh DOCKER_IMAGE_NAME UNREAL_BINARY_SHELL_SCRIPT UNREAL_BINARY_ARGUMENTS -- headless
</code></pre>

<p>For blocks, you can do a <code>$ ./run_airsim_image_binary.sh airsim_binary:10.0-devel-ubuntu18.04 Blocks/Blocks.sh -windowed -ResX=1080 -ResY=720</code></p>
<ul>
<li><code>DOCKER_IMAGE_NAME</code>: Same as <code>target_image</code> parameter in previous step. By default, enter <code>airsim_binary:10.0-devel-ubuntu18.04</code> </li>
<li><code>UNREAL_BINARY_SHELL_SCRIPT</code>: for Blocks enviroment, it will be <code>Blocks/Blocks.sh</code></li>
<li>
<p><a href="https://docs.unrealengine.com/en-us/Programming/Basics/CommandLineArguments"><code>UNREAL_BINARY_ARGUMENTS</code></a>:
For airsim, most relevant would be <code>-windowed</code>, <code>-ResX</code>, <code>-ResY</code>. Click on link to see all options. </p>
</li>
<li>
<p>Running in Headless mode: <br />
Suffix <code>-- headless</code> at the end:</p>
</li>
</ul>
<pre><code class="bash">$ ./run_airsim_image_binary.sh Blocks/Blocks.sh -- headless
</code></pre>

<ul>
<li>Running in Headless mode: <br />
Suffix <code>-- headless</code> at the end:
<code>$ ./run_airsim_image_binary.sh Blocks/Blocks.sh -- headless</code></li>
<li><a href="https://github.com/Microsoft/AirSim/blob/master/docs/docker_ubuntu.md#airsim_binary-docker-image">Specifying a <code>settings.json</code></a></li>
</ul>
</li>
</ul>
<h2 id="source">Source<a class="headerlink" href="#source" title="Permanent link">#</a></h2>
<h4 id="requirements_1">Requirements:<a class="headerlink" href="#requirements_1" title="Permanent link">#</a></h4>
<ul>
Expand Down Expand Up @@ -384,78 +396,86 @@ <h4 id="building-airsim-inside-ue4-docker-container">Building AirSim inside UE4
Below are the default arguments. <br />
<code>--base_image</code>: This is image over which we'll install airsim. We've tested on <code>adamrehn/ue4-engine:4.19.2-cudagl10.0</code>. See <a href="https://adamrehn.com/docs/ue4-docker/building-images/available-container-images">ue4-docker</a> for other versions. <br />
<code>--target_image</code> is the desired name of your docker image. <br />
Defaults to <code>airsim_source</code> with same tag as the base image
<code>$ 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</code></li>
Defaults to <code>airsim_source</code> with same tag as the base image</li>
</ul>
<pre><code class="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
</code></pre>

<h4 id="running-airsim-container">Running AirSim container<a class="headerlink" href="#running-airsim-container" title="Permanent link">#</a></h4>
<ul>
<li>
<p>Run the airsim source image we built by:
<code>./run_airsim_image_source.sh airsim_source:4.19.2-cudagl10.0</code>
Syntax is <code>./run_airsim_image_source.sh DOCKER_IMAGE_NAME -- headless</code>
<li>Run the airsim source image we built by:</li>
</ul>
<pre><code class="bash"> ./run_airsim_image_source.sh airsim_source:4.19.2-cudagl10.0
</code></pre>

<p>Syntax is <code>./run_airsim_image_source.sh DOCKER_IMAGE_NAME -- headless</code>
<code>-- headless</code>: suffix this to run in optional headless mode. </p>
</li>
<li>
<p>Inside the container, you can see <code>UnrealEngine</code> and <code>AirSim</code> under <code>/home/ue4</code>. </p>
</li>
<ul>
<li>Inside the container, you can see <code>UnrealEngine</code> and <code>AirSim</code> under <code>/home/ue4</code>. </li>
<li>Start unreal engine inside the container: <br />
<code>ue4@HOSTMACHINE:~$ /home/ue4/UnrealEngine/Engine/Binaries/Linux/UE4Editor</code></li>
<li><a href="https://github.com/Microsoft/AirSim/blob/master/docs/docker_ubuntu.md#airsim_source-docker-image">Specifying an airsim settings.json</a></li>
<li>Continue with <a href="https://microsoft.github.io/AirSim/docs/build_linux/#build-unreal-environment">AirSim's Linux docs</a>. </li>
</ul>
<h4 id="misc-packaging-unreal-environments-in-airsim_source-containers">[Misc] Packaging Unreal Environments in <code>airsim_source</code> containers<a class="headerlink" href="#misc-packaging-unreal-environments-in-airsim_source-containers" title="Permanent link">#</a></h4>
<ul>
<li>
<p>Let's take the Blocks environment as an example. <br />
In the following script, specify the full path to your unreal uproject file by <code>project</code> and the directory where you want the binaries to be placed by <code>archivedirectory</code>
<code>$ /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</code></p>
<p>This would create a Blocks binary in <code>/home/ue4/Binaries/Blocks/</code>. <br />
You can test it by running <code>/home/ue4/Binaries/Blocks/LinuxNoEditor/Blocks.sh -windowed</code> </p>
</li>
<li>Let's take the Blocks environment as an example. <br />
In the following script, specify the full path to your unreal uproject file by <code>project</code> and the directory where you want the binaries to be placed by <code>archivedirectory</code> </li>
</ul>
<pre><code class="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
</code></pre>

<pre><code>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`
</code></pre>
<h3 id="specifying-an-airsim-settingsjson">Specifying an airsim settings.json<a class="headerlink" href="#specifying-an-airsim-settingsjson" title="Permanent link">#</a></h3>
<p>#### <code>airsim_binary</code> docker image:
- We're mapping the host machine's <code>PATH/TO/Airsim/docker/settings.json</code> to the docker container's <code>/home/airsim_user/Documents/AirSim/settings.json</code>. <br />
- Hence, we can load any settings file by simply modifying <code>PATH_TO_YOUR/settings.json</code> by modifying the following snippets in * <a href="https://github.com/Microsoft/AirSim/blob/master/docker/run_airsim_image_binary.sh"><code>run_airsim_image_binary.sh</code></a>
<code>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"</code>
#### <code>airsim_source</code> docker image:</p>
<h4 id="airsim_binary-docker-image"><code>airsim_binary</code> docker image:<a class="headerlink" href="#airsim_binary-docker-image" title="Permanent link">#</a></h4>
<ul>
<li>We're mapping the host machine's <code>PATH/TO/Airsim/docker/settings.json</code> to the docker container's <code>/home/airsim_user/Documents/AirSim/settings.json</code>. </li>
<li>Hence, we can load any settings file by simply modifying <code>PATH_TO_YOUR/settings.json</code> by modifying the following snippets in * <a href="https://github.com/Microsoft/AirSim/blob/master/docker/run_airsim_image_binary.sh"><code>run_airsim_image_binary.sh</code></a></li>
</ul>
<pre><code class="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=&quot;DISPLAY=$DISPLAY&quot; \
--env=&quot;QT_X11_NO_MITSHM=1&quot; \
--volume=&quot;/tmp/.X11-unix:/tmp/.X11-unix:rw&quot; \
-env=&quot;XAUTHORITY=$XAUTH&quot; \
--volume=&quot;$XAUTH:$XAUTH&quot; \
--runtime=nvidia \
--rm \
$DOCKER_IMAGE_NAME \
/bin/bash -c &quot;$UNREAL_BINARY_COMMAND&quot;
</code></pre>

<h4 id="airsim_source-docker-image"><code>airsim_source</code> docker image:<a class="headerlink" href="#airsim_source-docker-image" title="Permanent link">#</a></h4>
<ul>
<li>We're mapping the host machine's <code>PATH/TO/Airsim/docker/settings.json</code> to the docker container's <code>/home/airsim_user/Documents/AirSim/settings.json</code>. </li>
<li>Hence, we can load any settings file by simply modifying <code>PATH_TO_YOUR/settings.json</code> by modifying the following snippets in <a href="https://github.com/Microsoft/AirSim/blob/master/docker/run_airsim_image_source.sh"><code>run_airsim_image_source.sh</code></a>:
<code>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</code></li>
<li>Hence, we can load any settings file by simply modifying <code>PATH_TO_YOUR/settings.json</code> by modifying the following snippets in <a href="https://github.com/Microsoft/AirSim/blob/master/docker/run_airsim_image_source.sh"><code>run_airsim_image_source.sh</code></a>:</li>
</ul>
<pre><code class="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=&quot;DISPLAY=$DISPLAY&quot; \
--env=&quot;QT_X11_NO_MITSHM=1&quot; \
--volume=&quot;/tmp/.X11-unix:/tmp/.X11-unix:rw&quot; \
-env=&quot;XAUTHORITY=$XAUTH&quot; \
--volume=&quot;$XAUTH:$XAUTH&quot; \
--runtime=nvidia \
--rm \
$DOCKER_IMAGE_NAME
</code></pre>

</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions lidar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,10 @@ <h2 id="client-api">Client API<a class="headerlink" href="#client-api" title="Pe
* Lidar pose in the vehicle inertial frame (in NED, in meters)
* Can be used to transform points to other frames.</p>
<h3 id="python-examples">Python Examples<a class="headerlink" href="#python-examples" title="Permanent link">#</a></h3>
<p><a href="https://github.com/Microsoft/AirSim/tree/master/PythonClient//multirotor">drone_lidar.py</a>
<a href="https://github.com/Microsoft/AirSim/tree/master/PythonClient//car">car_lidar.py</a></p>
<ul>
<li><a href="https://github.com/Microsoft/AirSim/tree/master/PythonClient//multirotor">drone_lidar.py</a></li>
<li><a href="https://github.com/Microsoft/AirSim/tree/master/PythonClient//car">car_lidar.py</a></li>
</ul>
<h2 id="coming-soon">Coming soon<a class="headerlink" href="#coming-soon" title="Permanent link">#</a></h2>
<ul>
<li>Visualization of lidar data on client side.</li>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6b0f4b7

Please sign in to comment.