DocsCLI
Overview
The as2 command for building, testing and moving around a source workspace, and fetching example projects.
The as2 command wraps the everyday tasks of working on Aerostack2 from source. It builds and tests
packages from any directory, jumps to a package's folder, and downloads the example projects.
For source workspaces
The CLI works in a colcon workspace built from source against a ROS 2 install in /opt/ros. It
doesn't apply to Pixi or Docker installs.
Set up
Point AEROSTACK2_PATH at the Aerostack2 folder inside your workspace and load the CLI from your
shell's startup file. It works in bash and zsh, with tab completion in bash:
source /opt/ros/humble/setup.bash
export AEROSTACK2_PATH=$HOME/aerostack2_ws/src/aerostack2
source $AEROSTACK2_PATH/as2_cli/setup_env.bashsetup_env.bash defines the as2 command and sources the workspace's install/setup.bash once
it's built. The workspace is taken as the folder two levels above AEROSTACK2_PATH.
It also sets AEROSTACK2_SIMULATION_DRONE_ID, which many launch files use as the default
namespace, to drone_sim_<user>_0. The value is kept in as2_cli/env_variables.bash, where you can
change it.
Commands
| Command | What it does |
|---|---|
as2 build | Builds the workspace, or a package and what it depends on |
as2 test | Runs the tests of the workspace or of one package |
as2 clean | Removes build output, for some packages or the whole workspace |
as2 list | Lists the packages in the workspace |
as2 cd | Goes to a package's folder, a project's folder or the Aerostack2 folder |
as2 project | Lists and downloads the example projects |
Every command except as2 cd prints its help with -h. Short flags can be combined, so -dv is
the same as -d -v.
Last updated on November 3, 2026