A comprehensive ROS 2 simulation environment for the FALCO drone using Gazebo 11, featuring advanced PID control systems and high-level position control capabilities.
- Introduction
- Prerequisites
- Setup
- Usage
- Control System Details
- Real Time System
- Configuration
- Troubleshooting
- Additional Information
This repository provides a complete simulation environment for the FALCO drone built on ROS 2 Humble and Gazebo 11. The simulation includes:
- Realistic drone physics and dynamics
- PID-based flight control system
- High-level position control interface
- Sensor simulation with noise modeling
- Safety mechanisms for autonomous operation
The system uses a well-defined transform tree for accurate positioning and control:
Before running the simulation, ensure you have:
- Docker installed on your system
- Basic knowledge of ROS 2 and Gazebo
- Terminal access with bash support
First, build the updated Docker image with all required packages:
cd Ros-2-Environment/ros2_env/docker
./build.shAfter building, start the Docker container:
cd Ros-2-Environment/ros2_env/docker/
./start_integrated.shNote: tmux needs to be installed each time you run the container due to the current Dockerfile configuration.
cd ros2_ws/
sudo apt-get update
sudo apt install tmuxIn a new tmux session, build the workspace and launch the simulation:
# Build the ROS 2 workspace
colcon build
# Source the environment (execute inside ros2_ws folder)
source install/setup.bash
# Launch the drone simulation with Gazebo
ros2 launch falco_drone_bringup falco_drone_bringup.launch.pyIn a new tmux session, start the position control node:
# Source the environment
source install/setup.bash
# Run the position control node
ros2 run falco_drone_control drone_position_controlThe drone_position_control node enables closed-loop pose and velocity control for reaching target positions through the self.move_drone_to_pose(...) method.
Publish an integer message for letting the drone to take off
ros2 topic pub /start_button std_msgs/msg/Int8 "data: 1" --onceThe FALCO drone uses a sophisticated control system implemented through Gazebo plugins. The main control components are located in ros2_env/ros2_ws/src/falco_drone/falco_drone_description/.
The core control system handles:
- Parameter Loading: Reads PID parameters from the SDF file
- Sensor Callbacks: Processes sensor data, cmd_vel, and pose data with noise modeling
- State Management: Handles takeoff, landing, and flight state operations
- Odometry Publishing: Publishes drone state as
nav_msgs/Odometrymessages in thebase_footprintframe - TF Publishing: Maintains the transform tree for visualization in Gazebo
- State Updates: Manages drone state transitions (flying, landing, taking off)
- Dynamics Updates: Applies PID control outputs to drone motors for desired flight behavior
The position control node provides:
- High-level position control interface
- Target position management
- Safety Features: Automatic landing mechanism when close to target altitude
- Landing timer (
self.landing_timer) for safe altitude proximity operations
Safety Note: The landing timer triggers automatically when the drone's vertical distance to the ground is close to the target altitude.
Currently not implemented yet, but the idea is to integrate ros topics feedbacks to the Teensy 4.1 serial port.
To customize drone parameters (mass, inertia, etc.):
-
Edit the XACRO file:
# Navigate to the URDF directory cd ros2_env/ros2_ws/src/falco_drone/falco_drone_description/urdf/ # Edit the drone parameters nano falco_drone.urdf.xacro
-
Generate updated URDF:
# Generate new URDF file ros2 run xacro xacro falco_drone.urdf.xacro > falco_drone.urdf
-
Generate updated SDF:
# Navigate to the models directory cd ../models/falco_drone/ # Generate new SDF file gz sdf -p ../../urdf/falco_drone.urdf > falco_drone.sdf
Important: Both URDF and SDF files must be regenerated after modifying the XACRO file to ensure changes take effect.
- Container Access Issues: Ensure Docker is properly installed and running
- Build Failures: Check that all dependencies are correctly installed in the Docker image
- Gazebo Models Missing: The simulation requires Gazebo models to be downloaded (see package-specific README)
- tmux Not Available: Remember to install tmux each time you start a new container
If you encounter missing Gazebo models, install them with:
curl -L https://github.com/osrf/gazebo_models/archive/refs/heads/master.zip -o /tmp/gazebo_models.zip \
&& unzip /tmp/gazebo_models.zip -d /tmp && mkdir -p ~/.gazebo/models/ && mv /tmp/gazebo_models-master/* ~/.gazebo/models/ \
&& rm -r /tmp/gazebo_models.zip- falco_drone_description: Contains drone models, plugins, and world files
- falco_drone_bringup: Launch files and configuration
- falco_drone_control: Control nodes and algorithms
- The current Dockerfile setup requires tmux to be installed manually each session
- Consider adding tmux to the Dockerfile for persistent installation
- All paths in this documentation use relative references from the repository root
For more detailed information about specific packages, refer to their individual README files in the respective package directories.


