Integration testing suite for PX4 Autopilot with ROS 2, featuring containerized simulation and automated workflows.
PX4-PreFlight provides a complete testing framework for PX4 Autopilot development with ROS 2 integration. It includes Docker-based PX4 simulation infrastructure and GitHub Actions workflows for continuous integration testing.
PX4-PreFlight/
├── ros-px4-bridge-docker/ (Submodule) - ROS 2 + PX4 Docker environment
│ ├── scripts/ - Setup and runtime scripts
│ ├── Dockerfile - Container definition
│ └── .github/workflows/ - Docker build workflow
├── px4-flight-test-docker/ (Submodule) - Automated flight testing
│ ├── scripts/ - Flight test scripts
│ ├── Dockerfile - Container definition
│ └── .github/workflows/ - Flight test workflow
├── .github/workflows/
│ ├── full_integration.yml - Main CI/CD orchestrator
│ └── px4_ros_integration.yml - Reusable PX4+ROS2 test workflow
└── run_all_workflows_local.sh - Local testing script (using act)
ros-px4-bridge-docker (Submodule)
- Containerized PX4 SITL simulation environment
- ROS 2 Humble + Gazebo Garden + Micro XRCE-DDS Agent
- Build and runtime scripts for PX4 and ROS 2
- Reusable in any project requiring PX4 simulation
px4-flight-test-docker (Submodule)
- Automated flight testing with video recording
- Python-based flight test script (takeoff, hover, land)
- Built on top of px4-sim-docker
- Reusable workflow for automated testing
# Clone the repository with submodules
git clone --recursive https://github.com/derickcoder44/PX4-PreFlight.git
# Or if already cloned, initialize submodules
git submodule update --init --recursiveThe Docker environment can be used as a standalone submodule in other projects:
# Add to your project
git submodule add https://github.com/derickcoder44/ros-px4-bridge-docker.git
# Use the scripts
cd ros-px4-bridge-docker
./scripts/install_dependencies.sh
./scripts/build_px4.sh
./scripts/run_simulation.sh- Docker-Based Simulation: Containerized PX4 SITL with Gazebo Garden
- ROS 2 Integration: Full ROS 2 Humble support with px4_msgs and px4_ros_com
- Automated Testing: CI/CD workflows for PX4+ROS 2 integration testing
- Flight Testing: Python script for automated takeoff, hover, and landing tests
- Local Testing: Test GitHub Actions workflows locally with
act - Reusable Workflows: Modular workflow design for use in other projects
# Test all workflows locally using act
./run_all_workflows_local.sh
# This will:
# - Run full integration tests
# - Execute flight tests with video recording
# - Save artifacts to /tmp/act-artifacts/# Install dependencies (in container or local)
cd ros-px4-bridge-docker
./scripts/install_dependencies.sh
./scripts/install_gazebo.sh
./scripts/install_dds_agent.sh
# Prepare workspace
./scripts/prepare_workspace.sh
# Build PX4 and ROS
./scripts/build_px4.sh
./scripts/build_ros2.sh
# Run simulation
./scripts/run_dds_agent.sh # Terminal 1
./scripts/run_simulation.sh # Terminal 2The repository includes GitHub Actions workflows that run automatically on push and pull requests.
full_integration.yml - Main orchestrator workflow that:
- Builds Docker images (ros-bridge and px4-sim)
- Runs PX4+ROS 2 integration tests
- Executes flight tests with takeoff, hover, and landing
- Uploads artifacts (logs, videos) on failure
px4_ros_integration.yml - Reusable workflow that:
- Pulls pre-built container images from GHCR
- Starts DDS agent and PX4 SITL simulation
- Verifies ROS 2 topic communication
- Tests sensor data streaming from PX4 to ROS 2
# Update ros-px4-bridge-docker to latest
git submodule update --remote ros-px4-bridge-docker
# Update px4-flight-test-docker to latest
git submodule update --remote px4-flight-test-docker
# Commit submodule updates
git add ros-px4-bridge-docker px4-flight-test-docker
git commit -m "Update submodules to latest versions"- Test PX4 Autopilot changes with ROS 2 integration
- Verify SITL simulation with Gazebo
- Validate DDS communication between PX4 and ROS 2
- Test ROS 2 nodes with PX4 simulation
- Develop autonomous flight algorithms
- Prototype drone control systems
- Use reusable workflows in other repositories
- Automate PX4+ROS 2 testing in your projects
- Leverage Docker-based testing infrastructure
Contributions are welcome! The submodules have their own repositories:
- Contribute to ros-px4-bridge-docker
- Contribute to px4-flight-test-docker
See LICENSE file for details.