Point Robot: Safe Set
cbfpy.examples.point_robot_demo
Point Robot Safe-Set Containment Demo
Demo of a point robot in 3D constrained to lie within a box via a CBF safety filter on a PD controller
We define the state z as [x, y, z, vx, vy, vz] and the control u as [Fx, Fy, Fz]
The dynamics are that of a simple double integrator: z_dot = [vx, vy, vz, 0, 0, 0] + [0, 0, 0, Fx/m, Fy/m, Fz/m]
In matrix form, this can be expressed as z_dot = A z + B u with A and B as implemented in the config.
The safety constraints are set as an upper and lower bound on the position of the robot.
This is a relative-degree-2 system, so we use the RD2 version of the CBF constraints.
PointRobotConfig
Bases: CBFConfig
Configuration for the 3D 'point-robot-in-a-box' example.
Source code in cbfpy/examples/point_robot_demo.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
nominal_controller(z, z_des)
A simple PD controller for the point robot.
This is unsafe without the CBF, as there is no guarantee that the robot will stay within the safe region
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z |
ArrayLike
|
The current state of the robot [x, y, z, vx, vy, vz] |
required |
z_des |
ArrayLike
|
The desired state of the robot [x_des, y_des, z_des, vx_des, vy_des, vz_des] |
required |
Source code in cbfpy/examples/point_robot_demo.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|