This repository contains example RL environment for Drones. This project has been included in the official Genesis repository and documentation. This repository will continue to provide examples and may be updated with more complex features in the future.
Ensure you have installed the latest version of Genesis:
# Clone the Genesis repository
cd /your/path/to/store/theRepo/
git clone https://github.com/Genesis-Embodied-AI/Genesis.git
# Install Genesis
cd Genesis
pip install -e .
Installed all necessary dependencies.
# Install Requirements.
git submodule update --init --recursive
pip install -r requirements.txt
If you prefer, you can skip the training and proceed directly using the provided checkpoint logs/drone-demo/model_500.pt
.
python hover_eval.py -e drone-demo --ckpt 500 --record
Use the provided training script to start training the policy.
python hover_train.py -e drone-hovering -B 8192 --max_iterations 300
-e drone-hovering
: Specifies the experiment name as “drone-hovering”.-B 8192
: Sets the number of environments to 8192 for parallel training.--max_iterations 300
: Specifies the maximum number of training iterations to 300.-v
: Optional. Enables visualization during training.
If you enable the visualization, you will see:
To monitor the training process, launch TensorBoard
:
tensorboard --logdir logs
Use the provided evaluation script to evaluate the trained policy.
python hover_eval.py -e drone-hovering --ckpt 300 --record
-e drone-hovering
: Specifies the experiment name as “drone-hovering”.--ckpt 300
: Loads the trained policy from checkpoint 300.--record
: Optional. Records the evaluation and saves a video of the drone’s performance.
The evaluation script will visualize the drone’s performance and save a video if the --record
flag is set.
hover_env.mp4
By following this tutorial, you’ll be able to train and evaluate a basic drone hovering policy using Genesis. Have fun and enjoy!
This repository is inspired by the following work:
We acknowledge the contributions of these and future works that inspire and enhance the development of this repository.