This project is designed to simulate and control multiple drones in a PX4-based simulation environment. The system allows for the integration of various drone types, trajectory planning using G-codes, and interaction via ROS 2 for advanced multi-agent robotics systems.
This work is part of my dissertation research. In the future, detailed textual descriptions of the proposed approaches and algorithms will be added, along with additional features and extended capabilities to enhance the system's functionality.
---For more details on system architecture, components, and usage, refer to the Main Documentation.
This project provides a modular and extensible framework for simulating drones in a PX4-based environment. Key components include:
- Drone controllers for managing the logic and behavior of drones.
- G-code implementation for defining drone trajectories and actions.
- Dockerized environment for consistent setup and deployment.
- Multi-drone message protocols for inter-drone communication and state management.
This project is currently under active development.
New features, improvements, and bug fixes are being added regularly. Contributions and feedback are welcome to help refine and expand the system further.
- G-Code System:
- Supports commands like linear motion, circular interpolation, takeoff, landing, etc.
- Easily extendable for custom drone actions.
- Multi-Drone Simulation:
- Simulate and control multiple drones simultaneously.
- Real-time state monitoring and command execution.
- ROS2 Integration:
- Full compatibility with ROS2 for node-based drone control.
- Custom message types for inter-drone communication.
- Docker Support:
- Simplifies setup and deployment of the simulation environment.
- Extensible Controllers:
- Base classes for creating custom drone types (e.g., X500, R1 Rover).
- Clone the repository:
git clone https://github.com/AntonSHBK/px4_multi_drone_sim.git cd px4_multi_drone_sim
- Build the Docker container:
docker-compose up --build
- Launch the simulation (inside container workspace
/workplace/src
):colcon build --packages-select px4_msgs colcon build --packages-select multi_drone multi_drone_msg ros2 launch multi_drone test_run.launch.py
ros2 topic pub --once /id_1_x500/in/command_json std_msgs/msg/String "{data: '{
\"name\": \"G20\",
\"counter\": 1,
\"x\": 10.0,
\"y\": 5.0,
\"z\": -10.0,
\"yaw\": 1.57,
\"velocity\": 2.0,
\"coordinate_system\": \"global_ENU\"
}'}"
ros2 topic pub --once /id_1_x500/in/command_json std_msgs/msg/String "{data: '{
\"name\": \"G21\",
\"counter\": 2,
\"start_point\": [0.0, 0.0, 0.0],
\"end_point\": [5.0, 10.0, -10.0],
\"velocity\": 1.5,
\"yaw\": 1.57,
\"coordinate_system\": \"global_ENU\"
}'}"
See the documentation. documentation for other commands.
Use these commands to control the drones and implement complex trajectories. Modify parameters as needed for your specific requirements.
-
ROS 2 Humble (on Ubuntu 22.04)
Install via official guide. -
PX4 v1.14
Clone and checkout:git clone https://github.com/PX4/PX4-Autopilot.git cd ./PX4-Autopilot git checkout v1.14.4 git submodule sync --recursive git submodule update --init --recursive
-
px4_msgs v1.14
git clone https://github.com/PX4/px4_msgs.git cd px4_msgs git checkout release/1.14
-
Docker
Install via Docker guide. -
Python Libraries
pip install scipy numpy
-
Terminal Emulator:
gnome-terminal
,xterm
, orkonsole
for PX4 SITL. -
X Server for Docker Visualization:
Use XLaunch (Windows), XQuartz (macOS), orxhost
on Linux for GUI support in Docker.
Enable X11 forwarding:xhost +local:docker
Refer to fast_commands.md
for a list of quick commands and their descriptions.
We welcome contributions! Feel free to open issues or submit pull requests.
@misc{px4_multi_drone_sim,
author = {Anton Pisarenko},
title = {PX4 Multi-Drone Simulation Project},
year = {2024},
month = {December},
howpublished = {\url{https://github.com/AntonSHBK/px4_multi_drone_sim}},
note = {Accessed: 2024-12-24}
}
For questions or support, please contact:
- Name: Pisarenko Anton
- Email: [email protected]
- Telegram: antonSHBK