I started building a 3D drone racing simulator in Python to better understand physics-based motion and control systems.
The goal is to eventually get to a full rigid-body drone model, but I’m starting simple and building up.
Right now, the system treats the drone as a point mass:
State: position + velocity
Forces: gravity, thrust, and air drag
Motion follows Newton’s law (F = ma)
A PD controller drives the drone through a set of 3D gates by minimizing position error and damping velocity.
To evaluate performance, I added metrics like lap time, energy usage, tracking error, and a final score that combines them.
For visualization, I’m using Plotly to render the 3D trajectory and gate positions, which makes it much easier to debug control behaviour.
The first major upgrade was adding a basic orientation layer. Instead of just plotting a point, I compute a forward direction from velocity so the drone “faces” where it is moving.
Right now, orientation is derived from motion. The next step is flipping that relationship so orientation starts affecting motion. This is through roll, pitch, and yaw.
The next update will focus on adding real rotational dynamics and moving toward a rigid-body model instead of a point mass.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.