examples/drone/README.md
This directory contains examples of drone simulations using the Genesis framework.
interactive_drone.py)A real-time interactive drone simulation where you can control the drone using keyboard inputs:
Run with:
python interactive_drone.py -v -m
fly.py)A pre-programmed drone flight simulation that follows a predefined trajectory stored in fly_traj.pkl.
Run with:
python fly.py -v -m
hover_env.py, hover_train.py, hover_eval.py)The hover environment (hover_env.py) is designed to train a drone to maintain a stable hover position by reaching randomly generated target points. The environment includes:
Acknowledgement: The reward design is inspired by Champion-level drone racing using deep reinforcement learning (Nature 2023)
At this stage, we have defined the environments. Now, we use the PPO implementation from rsl-rl to train the policy. First, install all Python dependencies via pip:
pip install tensorboard "rsl-rl-lib>=5.0.0"
Train the drone hovering policy using the HoverEnv environment.
Run with:
python hover_train.py -e drone-hovering -B 8192 --max_iterations 301
Train with visualization:
python hover_train.py -e drone-hovering -B 8192 --max_iterations 301 -v
Evaluate the trained drone hovering policy.
Run with:
python hover_eval.py -e drone-hovering --ckpt 300 --record
Note: If you experience slow performance or encounter other issues
during evaluation, try removing the --record option.
For the latest updates, detailed documentation, and additional resources, visit this repository: GenesisDroneEnv.
quadcopter_controller.py & fly_route.py)A PID-based controller to provide stable point-to-point flight without controlling each rotor. Parameters
have been tuned for controlled flight but not optimized. Stored in fly_route.py. Run fly_route.py to
test.
Run with:
python fly_route.py
urdf/drones/cf2x.urdf)-m flagThe interactive drone uses differential RPM control: