Skip to content

Commit d2ebb67

Browse files
committed
Add more docs
1 parent 8d87df9 commit d2ebb67

25 files changed

+150
-23
lines changed

docs/challenge/deployment.rst

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
11
Deployment
2-
==========
2+
==========
3+
4+
The idea for the deployment is to have an environment that exactly matches the interfaces and observation space of the simulation. Since the action space for the controller is identical, controllers can be directly deployed on the real drone without any modifications.
5+
6+
.. warning::
7+
Please be aware that running a controller on the real drone may still exhibit significant differences compared to the simulation due to the sim2real gap.
8+
9+
Motion Tracking
10+
~~~~~~~~~~~~~~~
11+
We use a Vicon motion tracking system to track the motion of the drone. The Vicon system consists of several cameras that are placed around the track, and a base station that calculates object poses by triangulation. Gates, obstacles and the drone are all equipped with reflective markers, which can be tracked by the cameras. We use the Vicon bridge from ETH's ASL to send the poses into ROS.
12+
13+
Deploying Your Controller
14+
~~~~~~~~~~~~~~~~~~~~~~~~~
15+
To deploy your controller on the real drone, use the deployment script in the ``lsy_drone_racing/scripts`` folder. Before running the script, make sure to set the correct drone parameters in the Crazyswarm package. Place the drone on its start position, power it on, and launch the Crazyswarm ROS node with
16+
17+
.. code-block:: bash
18+
19+
roslaunch crazyswarm hover_swarm.launch
20+
21+
.. note::
22+
Make sure the drone has enough battery to complete the track. If a red LED is constantly turned on, the drone is low on battery. A blinking red LED indicates that the battery is sufficiently charged.
23+
24+
.. note::
25+
You should restart the drone after every flight to reset the internal state estimators and its command mode.
26+
27+
.. warning::
28+
Only turn on the drone once you placed it on the start position. The internal sensors of the drone are reset on power-on, and turning it on while you are still moving it around may cause internal estimators to drift.
29+
30+
This should open up an RViz window with the drone frame and the world frame. You can now launch your controller by running
31+
32+
.. code-block:: bash
33+
34+
python scripts/deploy_controller.py --controller <controller_name>
35+
36+
The deployment script will first check if the real track poses and the drone starting pose is within acceptable bounds of the configured track. If not, the script will print an error message and terminate. If the poses are correct, the drone will take off, fly through the track, print out the final lap time, and land automatically.

docs/challenge/overview.rst

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
Overview
2-
========
2+
========
3+
4+
Welcome to the LSY Drone Racing Project! This is a platform developed by the LSY Lab at the Technical University of Munich for testing and developing autonomous drone racing algorithms in simulation and deploy the same controller without any modification on real drones. You are not restricted to any specific algorithm, as long as your interfaces are compatible with our predefined controller interface.
5+
6+
The Drone
7+
~~~~~~~~~
8+
We use the Crazyflie nano quadcopter for our challenge. It is a small, low-cost drone that is easy to program and control. You can find more information about the drone at https://www.bitcraze.io/. Crazyflies have the advantage of being fully open-source and having a large community, which makes it easy to find libraries and tools for programming and controlling the drone. Furthermore, their low price reduces the barrier to entry for participants, and the loss of a drone during the competition is less painful.
9+
10+
The Track
11+
~~~~~~~~~
12+
Contrary to other drone racing challenges, we not only include gates in our tracks, but also obstacles designed to be avoided by the drones. The current iteration uses four gates and four obstacles. Gates have to be traversed in the correct order and in the correct direction. Passing a gate in the opposite direction will not count as a successful pass.
13+
14+
Project Goals
15+
~~~~~~~~~~~~~
16+
The goal of the project is to develop a controller that can navigate the drone through the track with the least possible time on a real Crazyflie drone. As previously mentioned, controllers have to be compatible with the predefined interface. Once you have designed a controller and verified its performance and safety in simulation, you can deploy it on the real hardware.
17+
18+
.. warning::
19+
While the interfaces are the same and we take great care to ensure that the simulation faithfully reproduces the real-world behavior of the drones, running a controller on the real drone is significantly different from running it in simulation. Be aware that unexpected behavior might occur, depending on the actual drone and the used controller, and further extensive tuning and testing may be necessary.

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# Mock imports on ReadTheDocs that are not available with pip
2929
if on_rtd:
30-
autodoc_mock_imports = ["pycffirmware"]
30+
autodoc_mock_imports = ["pycffirmware", "rospy", "rosgraph", "pycrazyswarm", "stable_baselines3", "tf2_msgs"]
3131

3232

3333
# Add any paths that contain templates here, relative to this directory.

docs/control/controller.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Controller
2-
==========
1+
control.controller
2+
==================
33

44
.. automodule:: lsy_drone_racing.control.controller
55
:members:

docs/control/index.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
lsy_drone_racing.control
2+
========================
3+
4+
.. automodule:: lsy_drone_racing.control
5+
16
.. toctree::
27
:hidden:
38

docs/control/ppo_controller.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PPO Controller
2-
==============
1+
control.ppo_controller
2+
======================
33

44
.. automodule:: lsy_drone_racing.control.ppo_controller
55
:members:

docs/control/trajectory_controller.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Trajectory Controller
2-
======================
1+
control.trajectory_controller
2+
=============================
33

44
.. automodule:: lsy_drone_racing.control.trajectory_controller
55
:members:

docs/envs/drone_racing_deploy_env.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
envs.drone_racing_deploy_env
2+
============================
3+
4+
.. automodule:: lsy_drone_racing.envs.drone_racing_deploy_env
5+
:members:

docs/envs/drone_racing_env.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
envs.drone_racing_env
2+
=====================
3+
4+
.. automodule:: lsy_drone_racing.envs.drone_racing_env
5+
:members:

docs/envs/index.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
lsy_drone_racing.envs
2+
=====================
3+
4+
.. automodule:: lsy_drone_racing.envs
5+
6+
.. toctree::
7+
:hidden:
8+
9+
drone_racing_env
10+
drone_racing_deploy_env

docs/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Docs are work in progress. Please check back later.
3434

3535
utils/index
3636

37+
vicon
38+
3739

3840
Indices and tables
3941
==================

docs/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
sphinx-book-theme==1.1.2
2-
stable-baselines3==2.3.0 # Required for PPO example controller

docs/sim/drone.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Drone
2-
=====
1+
sim.drone
2+
=========
33

44
.. automodule:: lsy_drone_racing.sim.drone
55
:members:

docs/sim/index.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
lsy_drone_racing.sim
2+
=====================
3+
4+
.. automodule:: lsy_drone_racing.sim
5+
16
.. toctree::
27
:hidden:
38

docs/sim/noise.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Noise
2-
=====
1+
sim.noise
2+
=========
33

44
.. automodule:: lsy_drone_racing.sim.noise
55
:members:

docs/sim/physics.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Physics
2-
=======
1+
sim.physics
2+
===========
33

44
.. automodule:: lsy_drone_racing.sim.physics
55
:members:

docs/sim/sim.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Sim
2-
===
1+
sim.sim
2+
=======
33

44
.. automodule:: lsy_drone_racing.sim.sim
55
:members:

docs/sim/symbolic.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Symbolic Model
2-
==============
1+
sim.symbolic
2+
============
33

44
.. automodule:: lsy_drone_racing.sim.symbolic
55
:members:

docs/utils/import_utils.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
utils.import_utils
2+
==================
3+
4+
.. automodule:: lsy_drone_racing.utils.import_utils
5+
:members:

docs/utils/index.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lsy_drone_racing.utils
2+
======================
3+
4+
.. automodule:: lsy_drone_racing.utils
5+
6+
.. toctree::
7+
:hidden:
8+
9+
utils
10+
ros_utils
11+
import_utils

docs/utils/ros_utils.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
utils.ros_utils
2+
===============
3+
4+
.. automodule:: lsy_drone_racing.utils.ros_utils
5+
:members:

docs/utils/utils.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
utils.utils
2+
===========
3+
4+
.. automodule:: lsy_drone_racing.utils.utils
5+
:members:

docs/vicon.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lsy_drone_racing.vicon
2+
======================
3+
4+
.. automodule:: lsy_drone_racing.vicon
5+
:members:

lsy_drone_racing/envs/__init__.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
"""Register environments."""
1+
"""This module contains the environments for the drone racing challenge.
2+
3+
Environments are split into simulation and real-world environments. The simulation environments use
4+
the simulation module to provide a realistic simulation of the drone racing challenge for training,
5+
testing and iterating on controller designs. The real-world environments mirror the interface of the
6+
simulation environments, but use the Vicon motion capture system to track the drone and race track
7+
elements in the lab, and sent the controller actions to the real drone.
8+
9+
Note:
10+
While the interfaces are the same and we try to keep the environments as similar as possible,
11+
the dynamics of the drone and all observations are subject to a sim2real gap. The transition
12+
between simulation and real-world may therefore require additional tuning of the controller
13+
design.
14+
"""
215

316
from gymnasium import register
417

lsy_drone_racing/envs/drone_racing_deploy_env.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
:mod:~lsy_drone_racing.envs.drone_racing module.
66
77
Key components:
8-
1. DroneRacingDeployEnv: A Gymnasium environment for controlling a real Crazyflie drone in a
8+
9+
- :class:~.DroneRacingDeployEnv: A Gymnasium environment for controlling a real Crazyflie drone in a
910
physical race track, using Vicon motion capture for positioning.
10-
2. DroneRacingThrustDeployEnv: A variant of DroneRacingDeployEnv that uses collective thrust
11+
- :class:~.DroneRacingThrustDeployEnv: A variant of DroneRacingDeployEnv that uses collective thrust
1112
and attitude commands for control.
1213
1314
These environments maintain consistent interfaces with their simulation counterparts

0 commit comments

Comments
 (0)