Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
Signed-off-by: oguzkaganozt <[email protected]>
  • Loading branch information
oguzkaganozt committed Mar 6, 2024
1 parent c77dd04 commit 83c88b9
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/autowarefoundation/openadk:latest-devel
FROM ghcr.io/autowarefoundation/autoware-openadk:latest-devel

ENV SHELL /bin/bash

Expand Down
3 changes: 3 additions & 0 deletions ansible/roles/tensorrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ This role installs TensorRT and cuDNN following [this page](https://docs.nvidia.

## Manual Installation

For Universe, the `cudnn_version` and `tensorrt_version` variables should be copied from
[amd64.env](../../../amd64.env) or [arm64.env](../../../arm64.env) depending on the architecture used.

```bash
wget -O /tmp/amd64.env https://raw.githubusercontent.com/autowarefoundation/autoware/main/amd64.env && source /tmp/amd64.env

Expand Down
100 changes: 81 additions & 19 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,74 @@
# Open AD Kit: Containerized Workloads for the Autoware
# Open AD Kit: Containerized Workloads for Autoware

Open AD Kit offers two types of Docker image to let you get started with the Autoware quickly: `devel` and `runtime`.
Open AD Kit offers two types of Docker image to let you get started with Autoware quickly: `devel` and `runtime`.

1. The `devel` image contains the development environment and enables you to build and develop Autoware from source. Keep in mind that 'devel' image always include more recent changes than the 'runtime' image to provide the latest development environment.
2. The `runtime` image contains only runtime executables and enables you to try out Autoware quickly. 'runtime' image is more stable than 'devel' image and is recommended for production use.
1. The `devel` image enables you to develop Autoware without setting up the local development environment.
2. The `runtime` image contains only runtime executables and enables you to try out Autoware quickly.

**Note**: Before proceeding, confirm and agree with the [NVIDIA Deep Learning Container license](https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license). By pulling and using the Autoware Open AD Kit images, you accept the terms and conditions of the license.
!!! info

Before proceeding, confirm and agree with the [NVIDIA Deep Learning Container license](https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license). By pulling and using the Autoware Open AD Kit images, you accept the terms and conditions of the license.

## Prerequisites

- Docker
- NVIDIA Container Toolkit (optional)
- NVIDIA CUDA 12 compatible GPU Driver (optional)
- NVIDIA Container Toolkit (preferred)
- NVIDIA CUDA 12 compatible GPU Driver (preferred)

The [setup script](../setup-dev-env.sh) will install all required dependencies with the setup script:

```bash
./setup-dev-env.sh --docker
./setup-dev-env.sh -y docker
```

To install without NVIDIA GPU support:
To install without **NVIDIA GPU** support:

```bash
./setup-dev-env.sh --docker --no-nvidia
./setup-dev-env.sh -y --no-nvidia docker
```

!!! info

GPU acceleration is required for some features such as object detection and traffic light detection/classification. For details of how to enable these features without a GPU, refer to the [Running Autoware without CUDA](../how-to-guides/others/running-autoware-without-cuda.md).

## Usage

### Runtime
### Runtime Setup

You can use `run.sh` to run the Autoware runtime container with the map data:

```bash
./docker/run.sh --map-path path_to_map_data
```

**Note**: You can use `--no-nvidia` to run without NVIDIA GPU support, and `--headless` to run without display that means no RViz visualization.
!!! info

You can use `--no-nvidia` to run without NVIDIA GPU support, and `--headless` to run without display that means no RViz visualization.

For more launch options you can edit the launch command `--launch-cmd`:
For more launch options you can edit the launch command with `--launch-cmd` option:

```bash
./docker/run.sh --map-path path_to_map_data --launch-cmd "ros2 launch autoware_launch autoware.launch.xml map_path:=/autoware_map vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit"
```

### Using Development Container
#### Run Autoware simulator

```bash
./docker/run.sh --devel
```
Inside the container, you can run the Autoware simulation by following these tutorials:

[Planning Simulation](../../tutorials/ad-hoc-simulation/planning-simulation.md)

**Note**: By default workspace mounted on the container will be current directory, you can change the workspace path by `--workspace path_to_workspace`. For development environments without NVIDIA GPU support use `--no-nvidia`.
[Rosbag Replay Simulation](../../tutorials/ad-hoc-simulation/rosbag-replay-simulation.md).

### Development Setup

You can use [VS Code Remote Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) to develop Autoware in the containerized environment with ease. Or you can use `run.sh` manually to run the Autoware development container with the workspace mounted.

#### Using VS Code Remote Containers for Development

Get the Visual Studio Code's [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
And reopen the workspace in the container by selecting `Remote-Containers: Reopen in Container` from the Command Palette (`F1`).

By default devcontainer assumes NIVIDA GPU support, you can change this by deleting these lines within `.devcontainer/devcontainer.json`:
By default devcontainer assumes NVIDIA GPU support, you can change this by deleting these lines within `.devcontainer/devcontainer.json`:

```json
"hostRequirements": {
Expand All @@ -68,6 +80,56 @@ By default devcontainer assumes NIVIDA GPU support, you can change this by delet
"--gpus", "all"
```

#### Using `run.sh` for Development

```bash
./docker/run.sh --devel --workspace path_to_workspace
```

!!! info

You should mount the workspace you are working on with `--workspace path_to_workspace`. For a development environment without NVIDIA GPU support use `--no-nvidia`.

#### Creating a new workspace

If you don't have a workspace yet, you can create a new workspace with following steps:

1. Create the `src` directory and clone repositories into it.

```bash
mkdir src
vcs import src < autoware.repos
```

2. Update dependent ROS packages.

The dependency of Autoware may change after the Docker image was created.
In that case, you need to run the following commands to update the dependency.

```bash
sudo apt update
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
```

3. Build the workspace.

```bash
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
```

If there is any build issue, refer to [Troubleshooting](../../support/troubleshooting/index.md#build-issues).

> **To Update the Workspace**
>
> ```bash
> cd autoware
> git pull
> vcs import src < autoware.repos
> vcs pull src
> ```
## Building Docker images from scratch
If you want to build these images locally for development purposes, run the following command:
Expand Down
20 changes: 12 additions & 8 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ print_help() {
echo -e "${RED}Usage:${NC} run.sh [OPTIONS] [LAUNCH_CMD](optional)"
echo -e "Options:"
echo -e " ${GREEN}--help/-h${NC} Display this help message"
echo -e " ${GREEN}--map-path${NC} Specify the path to the map files (mandatory if no custom launch command is provided)"
echo -e " ${GREEN}--map-path${NC} Specify to mount map files into /autoware_map (mandatory if no custom launch command is provided)"
echo -e " ${GREEN}--no-nvidia${NC} Disable NVIDIA GPU support"
echo -e " ${GREEN}--devel${NC} Use the latest development version of Autoware"
echo -e " ${GREEN}--headless${NC} Run Autoware in headless mode (default: false)"
echo -e " ${GREEN}--workspace${NC} Specify the workspace path to mount into container"
echo -e " ${GREEN}--workspace${NC} Specify to mount the workspace into /workspace"
echo ""
}

Expand Down Expand Up @@ -98,17 +98,21 @@ set_variables() {
# Mount map path if provided
MAP="-v ${MAP_PATH}:/autoware_map:ro"

# Set default launch command if not provided
if [ "$LAUNCH_CMD" == "" ]; then
LAUNCH_CMD=${DEFAULT_LAUNCH_CMD}
fi

# Set workspace path if provided with current user and group
# Set workspace path if provided and login with local user
if [ "$WORKSPACE_PATH" != "" ]; then
USER_ID="-e LOCAL_UID=$(id -u) -e LOCAL_GID=$(id -g) -e LOCAL_USER=$(id -un) -e LOCAL_GROUP=$(id -gn)"
WORKSPACE="-v ${WORKSPACE_PATH}:/workspace"
fi

# Set default launch command if not provided
if [ "$LAUNCH_CMD" == "" ]; then
if [ "$WORKSPACE_PATH" != "" ]; then
LAUNCH_CMD="/bin/bash"
else
LAUNCH_CMD=${DEFAULT_LAUNCH_CMD}
fi
fi

# Set image based on option
if [ "$option_devel" == "true" ]; then
IMAGE="ghcr.io/autowarefoundation/autoware-openadk:latest-devel"
Expand Down

0 comments on commit 83c88b9

Please sign in to comment.