← projects

project

Drone Simulator — ROS2 Flight Simulator

with Felipe Zanoni da Rosa

Drone Simulator — ROS2 Flight Simulator

A full virtual quadcopter, with its own physics and simulated sensors, for testing autopilot logic without a real drone.

What it is

A drone (quadcopter) flight simulator built to test navigation and obstacle-avoidance algorithms without the risk or cost of physical hardware. The virtual drone takes off, flies a slalom course avoiding obstacles, can perform maneuvers (like a flip), and automatically returns to its origin point to land — all rendered in real-time 3D.

How it works

The core is a ROS2 node running at 60 frames per second. On every frame, an autopilot (implemented as a state machine) decides the flight commands — takeoff, navigation, maneuver, return, and landing — which drive a simplified physics model of an X-configuration quadcopter with individual per-motor mixing. The simulator publishes GPS, IMU, and LIDAR data in the same formats real hardware would use over ROS2, letting any external system consume these sensors as if it were controlling an actual drone. The scene is rendered in 3D with VPython, showing the drone, the environment, and its flight trail.

Tech stack

  • Python 3 + ROS2 (rclpy)
  • VPython for 3D visualization
  • NumPy for physics and vector math

Technical highlights

  • A complete flight state machine: takeoff, obstacle-avoiding navigation, maneuver, return-to-launch, and landing
  • Quadcopter physics model with individual motor mixing (throttle, roll, pitch, yaw)
  • Simulated sensors (GPS, IMU, LIDAR) published as standard ROS2 topics, ready to be consumed by any external node
  • Collision detection against obstacles and arena boundaries, ending the mission on a crash
  • Real-time 3D visualization with a flight trail
ZZZZ