Skip to content

geo

Geometric controllers and helpers for SE(3) tracking.

Classes:

Name Description
GeoControl

Python implementation of Geometric Controller.

GeometricAdaptiveController

Python implementation of Geometric Adaptive Controller.

L1_GeoControl

Python implementation of L1 Adaptive Geometric Controller.

Functions:

Name Description
euler_zyx_to_R

Convert ZYX Euler angles into a rotation matrix.

GeoControl

GeoControl(params: VehicleParams = VehicleParams(), control_mask: list[int] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], gains: dict | None = None)

Bases: ControllerBase

Python implementation of Geometric Controller.

Based on: Taeyoung Lee, Melvin Leok, and N.H. McClamroch. "Geometric Tracking Control of a Quadrotor UAV on SE(3)" [DOI: 10.1109/CDC.2010.5717652].

Initialize gains and error buffers.

Parameters:

Name Type Description Default

params

VehicleParams

Vehicle parameters.

VehicleParams()

control_mask

list[int]

Control mask for target/state channels.

[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

gains

dict | None

Optional geometric gains for keys x/v/R/W.

None

Methods:

Name Description
reset

Reset controller state.

update

Compute thrust and moments from target and state.

Attributes:

Name Type Description
params VehicleParams

Vehicle parameters for the controller.

control_mask ndarray | Tensor

unified control mask for target/state channels, used in update(). e.g. using 9~11 for attitude yaw control.

params instance-attribute

params: VehicleParams = params

Vehicle parameters for the controller.

control_mask instance-attribute

control_mask: ndarray | Tensor = control_mask

unified control mask for target/state channels, used in update(). e.g. using 9~11 for attitude yaw control.

reset

reset()

Reset controller state.

update

update(target: ndarray, state: ndarray) -> np.ndarray

Compute thrust and moments from target and state.

Parameters:

Name Type Description Default

target

ndarray

Desired state vector.

required

state

ndarray

Current state vector.

required

Returns:

Type Description
ndarray

np.ndarray: Control output ordered as [thrust, Mx, My, Mz].

GeometricAdaptiveController

GeometricAdaptiveController(params: VehicleParams = VehicleParams(), control_mask: list[int] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], gains: dict | None = None)

Bases: GeoControl

Python implementation of Geometric Adaptive Controller.

Based on: Farhad A. Goodarzi, Daewon Lee, and Taeyoung Lee. "Geometric Adaptive Tracking Control of a Quadrotor Unmanned Aerial Vehicle on SE(3) for Agile Maneuvers." [DOI: 10.1115/1.4030419].

Initialize adaptive gains and inherited geometry control.

Parameters:

Name Type Description Default

params

VehicleParams

Vehicle parameters.

VehicleParams()

control_mask

list[int]

Control mask for target/state channels.

[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

gains

dict | None

Optional geometric gains for keys x/v/R/W.

None

Methods:

Name Description
update

Adaptive geometric control using target/state vectors (GeoControl layout).

reset

Reset controller state.

Attributes:

Name Type Description
params VehicleParams

Vehicle parameters for the controller.

control_mask ndarray | Tensor

unified control mask for target/state channels, used in update(). e.g. using 9~11 for attitude yaw control.

params instance-attribute

params: VehicleParams = params

Vehicle parameters for the controller.

control_mask instance-attribute

control_mask: ndarray | Tensor = control_mask

unified control mask for target/state channels, used in update(). e.g. using 9~11 for attitude yaw control.

update

update(target: ndarray, state: ndarray) -> np.ndarray

Adaptive geometric control using target/state vectors (GeoControl layout).

Returns:

Type Description
ndarray

np.ndarray: Control output ordered as [thrust, Mx, My, Mz].

reset

reset()

Reset controller state.

L1_GeoControl

L1_GeoControl(params: VehicleParams = VehicleParams(), control_mask: list[int] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], gains: dict | None = None)

Bases: GeoControl

Python implementation of L1 Adaptive Geometric Controller.

Based on: Zhuohuan Wu, Sheng Cheng, Pan Zhao, Aditya Gahlawat, Kasey A. Ackerman, Arun Lakshmanan, Chengyu Yang, Jiahao Yu, Naira Hovakimyan. "L1Quad: L1 Adaptive Augmentation of Geometric Control for Agile Quadrotors with Performance Guarantees" [arXiv:2302.07208].

Initialize L1 adaptive parameters.

Parameters:

Name Type Description Default

params

VehicleParams

Vehicle parameters.

VehicleParams()

control_mask

list[int]

Control mask for target/state channels.

[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

gains

dict | None

Optional geometric gains for keys x/v/R/W.

None

Methods:

Name Description
update

L1-augmented geometric control using target/state vectors.

reset

Reset controller state.

Attributes:

Name Type Description
dt_L1

For large uncertainties ...

L1_params

Initialization of L1 inputs

params VehicleParams

Vehicle parameters for the controller.

control_mask ndarray | Tensor

unified control mask for target/state channels, used in update(). e.g. using 9~11 for attitude yaw control.

dt_L1 instance-attribute

dt_L1 = sim_dt

For large uncertainties ...

L1_params instance-attribute

L1_params = (As_v, As_omega, dt_L1, ctoffq1Thrust, ctoffq1Moment, ctoffq2Moment, mass, g, inertia)

Initialization of L1 inputs

params instance-attribute

params: VehicleParams = params

Vehicle parameters for the controller.

control_mask instance-attribute

control_mask: ndarray | Tensor = control_mask

unified control mask for target/state channels, used in update(). e.g. using 9~11 for attitude yaw control.

update

update(target: ndarray, state: ndarray) -> np.ndarray

L1-augmented geometric control using target/state vectors.

Parameters:

Name Type Description Default

target

ndarray

12-dim vector [x,y,z,vx,vy,vz,roll,pitch,yaw,wx,wy,wz].

required

state

ndarray

12-dim vector [x,y,z,vx,vy,vz,roll,pitch,yaw,wx,wy,wz].

required

Returns:

Type Description
ndarray

np.ndarray: Control output ordered as [thrust, Mx, My, Mz].

reset

reset()

Reset controller state.

euler_zyx_to_R

euler_zyx_to_R(yaw: float, pitch: float, roll: float) -> np.ndarray

Convert ZYX Euler angles into a rotation matrix.

Returns:

Type Description
ndarray

np.ndarray: 3x3 rotation matrix.