This is the WIP Awareness, Anticipation and Adaptation System (A3Sys) used for AIRSHIP project. Where we test the usage of the SysSelf metacontroller for the autonomous operation of the Wing-In-Ground drone.
A more extensive overview of the project is being written in Typst inside the doc/ directory. Should you want to compile the document to a PDF, install typst into your system and then compile the document with typst c doc/AIRSHIP_D7.2.pdf.
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 -t fms:latest .We will create an privileged, rootless container. For the moment, we will run a simple init program (initcnt) to keep the container available in the background and configure the system to use the host graphics.
podman run -d --privileged --userns=keep-id -v $XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR -v /dev/dri:/dev/dri:rslave -v /tmp:/run/host/tmp:slave -v ./ros_pkg:/home/oper/fms/src/a3sys:Z --hostname=fms --name fms 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_dev 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 a3sys project directory as a volume inside the container. Requiring us to manually build it.
oper@fms $ cd fms
oper@fms $ colcon build --packages-up-to a3sys
oper@fms $ source install/local_setup.bash
oper@fms $ mkdir sims
oper@fms $ cd sims
oper@fms $ ros2 launch a3sys sim_launch.pyYou should then see the logs of the simulation starting, the ardupilot initializing and the autonomic_handler initializing the reasoner while the drone is stationary. All the logs are stored in the default directory ~/.ros/log/.
To develop the package it is best not to build it with colcon. Just apply the overlay for the dependencies, then move into the source directory of a3sys and modify locally the PYTHONPATH to add that source.
oper@fms $ cd fms; source install/local_setup.bash
oper@fms $ cd src/a3sys
oper@fms $ PYTHONPATH=$PYTHONPATH:$PWD python a3sys/autonomic_handler.py --ros-args -p reasoning_rate:=3.0 -p ontology_file:=config/airship.owlIf you want to connect to the simulated drone with the Ground Control Station software Mission Planner you need to select in the top right corner UDP connection to 127.0.0.1:14550.
Should you have a problem running a GUI inside the container with "Authorization required, but no authorization protocol specified" error, then you should extend the X permission in the host with the following command.
$ xhost +local:$HOSTNAME