Introduction to GymFC
GymFC is an advanced framework designed to tune flight control systems, with a particular focus on attitude control in unmanned aerial vehicles (UAVs). Initially introduced in the manuscript "Reinforcement Learning for UAV Attitude Control," GymFC stands out by using simulation environments to develop neuro-flight attitude controllers that outperform conventional PID controllers. Over time, GymFC has evolved from merely synthesizing neuro-flight controllers to tuning traditional controllers as well.
GymFC serves as the primary method for creating controllers intended for use with Neuroflight, the first flight control firmware to incorporate neural network support. Further insights into GymFC's architecture and design can be found in Wil Koch's thesis, "Flight Controller Synthesis Via Deep Reinforcement Learning."
Features
GymFC is packed with features that make it a versatile tool for flight control system refinement. It supports sensors like IMUs, ESCs, and batteries, and it's flexible enough to work with any type of aircraft by adjusting the number of actuators and sensors. A notable feature is its independence from specific digital twins, as these are developed outside of GymFC, allowing for separate versioning.
Using Google protobuf, GymFC provides an API for aircraft digital twins to publish control signals and subscribe to sensor data. It also features a flexible agent interface, which accommodates controller development for various flight control systems. In addition, GymFC supports multiple versions of Gazebo, ensuring wide compatibility with different simulation environments.
Installation
Quick Start
Installing GymFC on an Ubuntu 18.04 system is straightforward. Run the following commands to install its dependencies and the GymFC package:
sudo MAKE_FLAGS=-j4 ./install_dependencies.sh
pip3 install .
Dependencies
GymFC requires Ubuntu 18.04 and relies on Gazebo v10.1.0, with Dart v6.7.0 for simulation. Both must be installed from source to ensure compatibility. Using the provided install_dependencies.sh
script simplifies the installation of these dependencies. However, due to the resource-intensive nature of building Gazebo, it’s recommended to allow the process significant system resources—at least when compiling.
Verifying Installation
To confirm a successful installation, GymFC requires an aircraft model to test. The NF1 racing quadcopter model, available in the examples directory, can be used for this purpose. Execute the test script to verify:
python3 tests/test_start_sim.py --verbose examples/gymfc_nf/twins/nf1/model.sdf
Any error messages regarding missing plugins may indicate the need for plugin installation or adjustments in the plugin path.
Getting Started
Creating a basic GymFC environment can start as follows:
from gymfc.envs.fc_env import FlightControlEnv
class MyEnv(FlightControlEnv):
def __init__(self, aircraft_config, config=None, verbose=False):
super().__init__(aircraft_config, config_filepath=config, verbose=verbose)
This simple initialization gives access to essential functions like step_sim
and reset
. For OpenAI integration, additional steps are needed.
Tutorials and Examples
GymFC provides tutorials, such as installation guides, with more to come. Additionally, users can explore provided modules or contribute their own by creating flight controllers, tuning modules, or digital twins following GymFC’s flexible framework.
Conclusion
GymFC is an invaluable tool for researchers and engineers focused on UAV flight control systems. Its modular design, support for various sensors and aircraft types, and compatibility with Gazebo make it a comprehensive solution for synthesizing and tuning flight controllers using deep reinforcement learning techniques.