MPC Drone Trajectory Planner — 2D Sample-Cloud MPPI
Interactive 2D Model Predictive Path Integral (MPPI) planner: unlike the 3D version's single blended flight horizon rendered with a camera, this planar model draws the entire population of sampled control rollouts bending around an obstacle, with a live softmax-weight histogram and effective-sample-size readout exposing the importance-sampling math directly.
This 2D companion to the 3D MPC drone planner keeps the exact same control algorithm — sampling-based Model Predictive Path Integral control (MPPI) driving a double-integrator drone around an obstacle toward a moving reference — but computes and renders it as a genuinely planar object instead of a 3D camera scene. Rather than showing only the final blended flight horizon, this version draws the entire population of sampled rollouts each replan, faded by its own softmax importance weight, alongside a live weight histogram and an effective-sample-size readout that exposes exactly how concentrated or diffuse the MPPI sampling distribution is at any instant. Tune the prediction horizon, sample count and obstacle-avoidance weight to watch the sample cloud collapse around the handful of rollouts that best thread the obstacle.
Interactive 2D Model Predictive Path Integral (MPPI) planner: a planar double-integrator drone replans a sampled control horizon in real time to track a reference path while avoiding an obstacle. Unlike the 3D version's single blended flight horizon rendered with a camera, this model draws the entire population of sampled rollouts bending around the obstacle, with a live softmax-weight histogram and effective-sample-size readout exposing the importance-sampling math directly.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install