Drone Obstacle Avoidance
cbfpy.examples.drone_demo
Drone Obstacle Avoidance Demo
We use velocity control, which can be easily applied to other drones (for instance, PX4-controlled quadrotors can take in velocity commands)
The CBF uses a reduced model of the drone dynamics, while the simulation environment does reflect a (somewhat-accurate) model of the true drone dynamics
Here, our state is the position and velocity of the drone: z = [position, velocity] and the control input is the velocity of the drone: u = [velocity]
We also incorporate the state of the obstacle as an additional input to the CBF: z_obs = [position, velocity]
Note: since there is gravity in this simulation, the obstacle will fall to the ground initially. This is fine: just use the mouse to drag it around near the drone to see the CBF response
See https://danielpmorton.github.io/drone_fencing/ for a demo of this on real hardware, and see the "point robot obstacle avoidance" demo in CBFpy for a simplified version of this demo
DroneConfig
Bases: CBFConfig
Config for the drone obstacle avoidance / safe set containment demo
Source code in cbfpy/examples/drone_demo.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|