Peng is a minimal Rust-based quadrotor simulation pipeline. It includes a simulator, controller, and planner, providing a basic framework for simulating quadrotor dynamics and control.
cargo install rerun-cli
cargo install peng_quad
peng_quad config/quad.yaml
cargo install rerun-cli
git clone https://github.com/makeecat/Peng.git && cd Peng
cargo run --release config/quad.yaml
You can configure the simulation through config file, see quad.yaml for example.
Please follow rerun troubleshooting if you are using Linux or WSL2.
Simulates realistic quadrotor dynamics with properties like position, velocity, orientation, angular velocity, mass, and inertia. Includes methods for updating dynamics with control inputs and simulating IMU readings and Depth map rendering.
Controls position and attitude with configurable gains for proportional, integral, and derivative terms. Handles both position and attitude control.
Includes multiple planners:
- Hover Planner
- Minimum Jerk Line Planner
- Lissajous Curve Planner
- Circular Trajectory Planner
- Landing Planner
- Obstacle Avoidance Planner
- Waypoint Planner
Simulates moving obstacles in the environment, with collision detection and avoidance capabilities based on potential field.
Logs comprehensive simulation data including quadrotor state, desired positions, IMU readings, and depth map rendering. Visualizes the simulation using the rerun library.
- Realistic quadrotor dynamics simulation
- IMU sensor simulation with configurable noise parameters
- Multiple trajectory planners for diverse flight patterns
- PID controller for position and attitude control
- Obstacle generation and avoidance
- Depth map rendering based on primitives
- Integration with rerun for real-time visualization
- Environment Effect simulation such as wind field
- Add motor speed simulation
- MPC controller
Peng is free, open source and permissively licensed! Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) at your option.
This means you can select the license you prefer!
Peng (traditional Chinese: 鵬; simplified Chinese: 鹏; pinyin: péng; Wade–Giles: p'eng) or Dapeng (大鵬) is a giant bird that transforms from a Kun (鯤; 鲲; kūn; k'un) giant fish in Chinese mythology.
The pipeline is designed to be minimal and for educational purpose. We chose the name Peng because our pipeline is flexible and can transform to suit different needs, just like the mythical bird.
Reference: https://en.wikipedia.org/wiki/Peng_(mythology)
I would like to thank tokei for providing the line count statistics! My goal is to keep the project minimal and easy to understand by keeping the code line count below 1500. The markdown lines are used for generating the documentation.
===============================================================================
Language Files Lines Code Comments Blanks
===============================================================================
SVG 1 1 1 0 0
TOML 1 31 30 0 1
YAML 1 103 95 0 8
-------------------------------------------------------------------------------
Markdown 4 267 0 201 66
|- BASH 1 6 6 0 0
|- Markdown 1 16 0 16 0
(Total) 289 6 217 66
-------------------------------------------------------------------------------
Rust 3 1503 1455 12 36
|- Markdown 1 303 0 303 0
(Total) 1806 1455 315 36
===============================================================================
Total 10 1905 1581 213 111
===============================================================================