This is the WIP Awareness, Anticipation and Adaptation System (A3S) used for AIRSHIP project. Where we test the usage of the SysSelf metacontroller for the autonomous operation of the Wing-In-Ground drone.
The environment used to develop, build and test the system is a container running Ubuntu 22 with ROS 2. The container tool used here is Podman. Although all container related sources are OCI compliant, so Docker should also work.
The image used will be based on ROS2 Humble taken from the OSRF Docker images. Building Ardupilot for our use case.
cd <project_directory>
podman build --cpuset-cpus=0-7 -t fms:latest .The --cpuset-cpus=0-7 is an optional argument to specify which CPUS speficially are allowed to to be used by the building process. This helps preventing resource starvation in intensive tasks such as the Ardupilot compilation.
We will create an unprivileged, rootless container. For the moment, we will run a simple init program (initcnt) to keep the container available in the background.
podman run -d --userns=keep-id --cpuset-cpus=2-12 -v ./ros_pkg:/home/oper/fms/src/a3s:Z --hostname=fms --name fms_dev localhost/fms:latest initcnt
podman ps # Check that the created container is running.Note that to enable the host-container volume to work with a host OS having SELinux labels for the directories (such as Fedora) we have to append a :Z to the volume path.
You can then enter the container with the following command.
podman exec -it -u root fms login oper # Login as user "oper".We enter through login to initialize the environment as usual, that is, sourcing ~/.profile, ~/.bashrc etc. Still, all configuration is intended to place all the setup required in the ~/.bashrc with the intention of allowing a simpler entrypoint.
As this is currently a development environment, we are mounting the a3s project directory as a volume inside the container. Which means that now is the time the build it.
oper@fms $ cd fms
oper@fms $ colcon build --packages-up-to a3s
oper@fms $ source install/local_setup.bash
oper@fms $ mkdir sims
oper@fms $ cd sims
oper@fms $ ros2 launch a3s mission_launch.pyYou should then see the logs of the simulation starting, the ardupilot initializing and the mission manager providing waypoints and commanding the drone to takeoff. All the logs are stored in the default directory ~/.ros/log/.