You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/airstack-cli/docker_usage.md
+41-36Lines changed: 41 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Launch Workflow with Docker and Docker Compose
2
2
3
-
To mimic interacting with multiple real world robots, we use Docker Compose to manage Docker containers that isolate the simulation, each robot, and the ground control station.
3
+
At its core, the `airstack` CLI is simply a wrapper around Docker Compose. `airstack up` is equivalent to `docker compose up -d`, and `airstack down` is equivalent to `docker compose down`.
4
+
5
+
Docker Compose is useful to mimic interacting with multiple robots in a simulated environment, such as Isaac Sim, while isolating each robot's environment and the ground control station.
4
6
5
7
The details of the docker compose setup is in the project root's `docker-compose.yaml`.
6
8
@@ -13,7 +15,7 @@ In essence, the compose file launches:
13
15
all get created on the same default Docker bridge network.
14
16
This lets them communicate with ROS2 on the same network.
15
17
16
-
Each robot has its own ROS_DOMAIN_ID.
18
+
Each robot has its own ROS_DOMAIN_ID, which is extracted from the container name, e.g. `airstack-robot-1` has `ROS_DOMAIN_ID=1`. See the robot `.bashrc` for details.
17
19
18
20
## Pull Images
19
21
@@ -42,33 +44,27 @@ docker compose build
42
44
Start
43
45
44
46
```bash
45
-
docker compose up --scale robot=[NUM_ROBOTS] -d
47
+
airstack up # or equivalently: docker compose up -d
46
48
47
49
# see running containers
48
-
docker ps -a
49
-
```
50
-
51
-
Stop
52
-
53
-
```bash
54
-
docker compose stop
50
+
airstack status # or equivalently: docker ps -a
55
51
```
56
52
57
53
Remove
58
54
59
55
```bash
60
-
docker compose down
56
+
airstack down # or equivalently: docker compose down
61
57
```
62
58
63
59
Launch only specific services:
64
60
65
61
```bash
66
62
# only robot
67
-
docker compose up robot --scale robot=[NUM_ROBOTS] -d
63
+
airstack up robot # or equivalently: docker compose up robot -d
68
64
# only isaac
69
-
docker compose up isaac-sim -d
65
+
airstack up isaac-sim # or equivalently: docker compose up isaac-sim -d
70
66
# only ground control station
71
-
docker compose up gcs -d
67
+
airstack up gcs # or equivalently: docker compose up gcs -d
72
68
```
73
69
74
70
@@ -79,9 +75,7 @@ Start a bash shell in the Isaac Sim container:
79
75
80
76
```bash
81
77
# if the isaac container is already running, execute a bash shell in it
The previous `docker compose up` launches robot_bringup in a tmux session. To attach to the session within the docker container, e.g. to inspect output, run `tmux attach`.
96
+
To launch more than one robot, prepend with the `NUM_ROBOTS=[NUM]` environment variable, e.g. to launch 2 robots (along with the ground control station and Isaac Sim):
97
+
```bash
98
+
NUM_ROBOTS=2 airstack up
99
+
airstack connect robot-1 # to connect to robot 1
100
+
airstack connect robot-2 # to connect to robot 2
101
+
```
102
+
103
+
The previous `docker compose up` launches robot_bringup in a tmux session. To attach to the session within the docker container, e.g. to inspect output, run `tmux a`.
103
104
104
105
The following commands are available within the robot container:
The available aliases within the container are currently the same.
@@ -181,27 +182,31 @@ docker compose up autotest
181
182
This command will spin up a `robot` container, build the ROS2 workspace, source the workspace and run all the configured tests for the provided packages using `colcon test`. Excessive output log from the build process is presently piped away to preserve readability.
182
183
183
184
## Docker Compose Variable Overrides
184
-
Sometimes you may want to test different configurations of the autonomy stack. For example, you may want to disable automatically playing the sim on startup,
185
-
or to change a child launch file.
186
-
187
-
The `docker compose` workflow is designed to support these overrides for local development.
188
-
`docker compose` uses `.env` files to set docker-compose variables that get propagated and interpolated into `docker-compose.yaml` files.
189
-
See the [docker compose documentation](https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/) for more details.
185
+
As mentioned above, the `airstack` CLI is a wrapper around Docker Compose.
186
+
Therefore, it supports [variable interpolation](https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/) in the `docker-compose.yaml` file, allowing you to adjust project settings by modifying environment variables.
190
187
191
-
The default `.env` file is in the project root directory.
192
-
When no `--env-file` argument is passed to `docker compose`, it automatically uses this default `.env` file.
193
-
194
-
To override the default `.env` file, you can pass the `--env-file` argument to `docker compose` with a path to your custom `.env` file.
188
+
For example, to disable playing the simulation on startup, you can set the `PLAY_SIM_ON_START` variable to `false`:
189
+
```bash
190
+
PLAY_SIM_ON_START=false airstack up
191
+
```
195
192
196
-
For example, this command disables playing the simulation on startup by overriding the `PLAY_SIM_ON_START` variable:
193
+
To change the Isaac Sim scene:
197
194
```bash
198
-
docker compose --env-file .env --env-file overrides/no_play_sim_on_start.env up -d
195
+
ISAAC_SIM_SCENE=path/to/your_scene.usd airstack up
199
196
```
200
197
201
-
As another example, this command changes the perception launch file to `perception_no_macvo.launch.xml`:
198
+
A list of all available environment variables is in the default `.env` file in the project root directory, which allows specifying all the variables in one place.
199
+
When no `--env-file` argument is passed to `docker compose`, it automatically uses this default `.env` file.
200
+
201
+
The top-level env file is reproduced below:
202
202
```bash
203
-
docker compose --env-file .env --env-file overrides/no_macvo.env up -d
203
+
--8<-- ".env"
204
204
```
205
205
206
+
To override the default `.env` file, you can pass the `--env-file` argument with the syntax `airstack --env-file [env_file] up` (or `docker compose --env-file [env_file] up -d`).
207
+
208
+
Multiple `--env-file` arguments can be passed to compose overriding sets of variables.env` file.
209
+
When overriding, the default `.env` file must be loaded first. The overrides are applied on top of it.
210
+
211
+
206
212
207
-
When overriding, the default `.env` file must be loaded first. The overrides are applied on top of it.
Copy file name to clipboardExpand all lines: docs/development/airstack-cli/extending.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Extending the AirStack CLI
1
+
# Advanced: Extending the AirStack CLI
2
2
3
3
The AirStack CLI tool is designed to be easily extensible through modules. This guide explains how to create new modules and add commands to the AirStack CLI.
Copy file name to clipboardExpand all lines: docs/development/airstack-cli/index.md
+33-25Lines changed: 33 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ The AirStack CLI tool is designed to be:
11
11
-**Helpful**: Includes detailed help text and error messages
12
12
-**Extensible**: New commands can be added without modifying the core script
13
13
14
+
At its core, `airstack.sh` is simply a light wrapper around [docker compose](https://docs.docker.com/compose/), providing additional functionality and convenience for AirStack development.
15
+
14
16
## Basic Usage
15
17
16
18
```bash
@@ -29,6 +31,18 @@ To get help for a specific command:
29
31
./airstack.sh help<command>
30
32
```
31
33
34
+
## Adding to Shell Profile
35
+
36
+
For convenience, you can add the AirStack CLI to your shell profile to make it available from any directory:
37
+
38
+
```bash
39
+
./airstack.sh setup
40
+
# now you can use `airstack` instead of `./airstack.sh`
41
+
airstack commands
42
+
```
43
+
44
+
This will add the necessary aliases to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.) so you can use the `airstack` command from any directory.
45
+
32
46
## Core Commands
33
47
34
48
The AirStack CLI includes several built-in commands:
@@ -49,7 +63,7 @@ The AirStack CLI includes several built-in commands:
49
63
The `install` command sets up the necessary dependencies for AirStack development:
50
64
51
65
```bash
52
-
./airstack.sh install [options]
66
+
airstack install [options]
53
67
```
54
68
55
69
Options:
@@ -62,7 +76,7 @@ Options:
62
76
The `setup` command configures your environment for AirStack development:
63
77
64
78
```bash
65
-
./airstack.sh setup [options]
79
+
airstack setup [options]
66
80
```
67
81
68
82
Options:
@@ -75,19 +89,23 @@ The AirStack CLI provides several commands for managing Docker containers:
75
89
76
90
```bash
77
91
# Start services
78
-
./airstack.sh up [service...]
92
+
airstack up [service...]
93
+
airstack up robot # start only the robot service
94
+
airstack up isaac-sim # start only the Isaac Sim service
95
+
airstack up gcs # start only the Ground Control Station service
96
+
airstack up docs # start only the documentation service
79
97
80
98
# Stop services
81
-
./airstack.sh down [service...]
99
+
airstack down [service...]
82
100
83
101
# Show container status
84
-
./airstack.sh status
102
+
airstack status
85
103
86
-
# Connect to a container shell
87
-
./airstack.sh connect <container_name>
104
+
# Connect to a container shell, supports partial name matching
105
+
airstack connect <container_name>
88
106
89
107
# View container logs
90
-
./airstack.sh logs <container_name>
108
+
airstack logs <container_name>
91
109
```
92
110
93
111
## Module-Specific Commands
@@ -98,37 +116,27 @@ In addition to the core commands, the AirStack CLI includes several module-speci
98
116
99
117
```bash
100
118
# Run all configuration tasks
101
-
./airstack.sh config
119
+
airstack config
102
120
103
121
# Configure Isaac Sim
104
-
./airstack.sh config:isaac-sim
122
+
airstack config:isaac-sim
105
123
106
124
# Configure Nucleus
107
-
./airstack.sh config:nucleus
125
+
airstack config:nucleus
108
126
109
127
# Configure Git hooks
110
-
./airstack.sh config:git-hooks
128
+
airstack config:git-hooks
111
129
```
112
130
113
131
### WinTAK Commands
114
132
115
133
```bash
116
134
# Install WinTAK
117
-
./airstack.sh wintak:install
135
+
airstack wintak:install
118
136
119
137
# Start WinTAK VM
120
-
./airstack.sh wintak:start
138
+
airstack wintak:start
121
139
122
140
# Stop WinTAK VM
123
-
./airstack.sh wintak:stop
141
+
airstack wintak:stop
124
142
```
125
-
126
-
## Adding to Shell Profile
127
-
128
-
For convenience, you can add the AirStack CLI to your shell profile to make it available from any directory:
129
-
130
-
```bash
131
-
./airstack.sh setup
132
-
```
133
-
134
-
This will add the necessary aliases to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.) so you can use the `airstack` command from any directory.
Copy file name to clipboardExpand all lines: docs/robot/index.md
-10Lines changed: 0 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,16 +28,6 @@ At a high level, the launch files are organized as follows:
28
28
### Desktop vs Jetson
29
29
If you look at the `robot/docker/docker-compose.yaml` file, you'll see it contains two services. `robot` is meant for x86-64 desktop development whereas `robot_l4t` is meant to run on NVIDIA Jetson devices. Both extend a base service in `robot/docker/robot-base-docker-compose.yaml`.
30
30
31
-
### Environment Variables
32
-
Environment variables are used to configure the robot Docker container. The top level `AirStack/.env` file points to a `ROBOT_ENV_FILE_NAME` (default: `robot.env`), that in turn is used to load environment variables for the robot Docker container. The file that `ROBOT_ENV_FILE_NAME` points to gets added into the container under `robot/docker/robot-base-docker-compose.yaml`.
33
-
34
-
The environment variables can be used to trigger nodes to launch. For example, the `USE_MACVO` environmental variable is checked by `perception.launch.xml` to determine whether to launch the `macvo` node.
0 commit comments