Expand description
§Peng - A Minimal Quadrotor Autonomy Framework
A high-performance quadrotor autonomy framework written in Rust that provides real-time dynamics simulation, trajectory planning, and control with modern visualization capabilities.
§Features
§Real-time Simulation
- High-fidelity quadrotor dynamics with configurable parameters
- IMU and depth sensor simulation
- Optional RK4 integration for accurate dynamics
§Advanced Control
- PID control for position and attitude with tunable gains
- Integral windup prevention
- Support for different control frequencies
§Rich Trajectory Planning
- Minimum jerk line trajectory planner
- Lissajous curve planner
- Circular trajectory planner
- Obstacle avoidance planner
- Waypoint navigation planner
- Landing planner
§Visualization & Debug
- Real-time 3D visualization via rerun.io
- Depth map rendering
- State telemetry logging
- Configurable logging frequencies
§Performance
- Memory-safe and Efficient Rust implementation
- Multi-threaded depth rendering
§Example
use nalgebra::Vector3;
use peng_quad::{Quadrotor, SimulationError};
let (time_step, mass, gravity, drag_coefficient) = (0.01, 1.3, 9.81, 0.01);
let inertia_matrix = [0.0347563, 0.0, 0.0, 0.0, 0.0458929, 0.0, 0.0, 0.0, 0.0977];
let quadrotor = Quadrotor::new(time_step, mass, gravity, drag_coefficient, inertia_matrix);
Modules§
- config
- Configuration module
Structs§
- Camera
- Represents a camera in the simulation which is used to render the depth of the scene
- Circle
Planner - Planner for circular trajectories
- Hover
Planner - Planner for hovering at a fixed position
- Imu
- Represents an Inertial Measurement Unit (IMU) with bias and noise characteristics
- Landing
Planner - Planner for landing maneuvers
- Lissajous
Planner - Planner for Lissajous curve trajectories
- Maze
- Represents a maze in the simulation
- Minimum
Jerk Line Planner - Planner for minimum jerk trajectories along a straight line
- Minimum
Snap Waypoint Planner - Waypoint planner that generates a minimum snap trajectory between waypoints
- Obstacle
- Represents an obstacle in the simulation
- Obstacle
Avoidance Planner - Obstacle avoidance planner that uses a potential field approach to avoid obstacles
- PIDController
- PID controller for quadrotor position and attitude control
- Planner
Manager - Manages different trajectory planners and switches between them
- Planner
Step Config - Represents a step in the planner schedule.
- QPpoly
Traj Planner - Waypoint planner that generates a quadratic polynomial trajectory between waypoints
- Quadrotor
- Represents a quadrotor with its physical properties and state
- Trajectory
- A struct to hold trajectory data
Enums§
- Planner
Type - Enum representing different types of trajectory planners
- Simulation
Error - Represents errors that can occur during simulation
Traits§
- Planner
- Trait defining the interface for trajectory planners
Functions§
- color_
map_ fn - turbo color map function
- create_
planner - Creates a planner based on the configuration
- log_
data - Logs simulation data to the rerun recording stream
- log_
depth_ image - Log depth image data to the rerun recording stream
- log_
maze_ obstacles - Log the maze obstacles to the rerun recording stream
- log_
maze_ tube - Log the maze tube to the rerun recording stream
- log_
pinhole_ depth - creates pinhole camera
- log_
trajectory - log trajectory data to the rerun recording stream
- parse_
f32 - Helper function to parse f32 from YAML
- parse_
usize - Helper function to parse unsigned integer from YAML
- parse_
vector3 - Helper function to parse Vector3 from YAML
- ray_
cast - Casts a ray from the camera origin in the given direction
- update_
planner - Updates the planner based on the current simulation step and configuration