geo
Torch-based Geometric Controller for batched simulation.
Based on Lee, Leok, McClamroch (CDC 2010). Uses scipy.spatial.transform.Rotation (SCIPY_ARRAY_API=1) for SO(3) operations on torch tensors. hat/vee remain pure torch (not in scipy).
Classes:
| Name | Description |
|---|---|
GeoControl |
Batched geometric controller tracking position/velocity/attitude/body-rate. |
GeoControl
GeoControl(params: VehicleParams = VehicleParams(), control_mask: dict | None = None, gains: dict | None = None, limits: dict | None = None, *, num_envs: int = 1, device: str | device = 'cpu')
Bases: ControllerBase
Batched geometric controller tracking position/velocity/attitude/body-rate.
Target/state are dicts mapping semantic keys to batched tensors (N, *).
Rotation is resolved from the state dict in order of preference:
att_rotmat → att_quat → att_rotvec → att_euler.
control_mask is a dict mapping state keys to per-channel bool lists, e.g.
{"pos": [1,1,1], "vel": [1,1,1], "att_euler": [1,1,1], "ang_vel": [1,1,1]}.
Initialize gains, mass, inertia as batched tensors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
VehicleParams
|
Vehicle parameters. |
VehicleParams()
|
|
dict | None
|
Dict mask mapped to state keys. Channels not listed
or masked as |
None
|
|
dict | None
|
Dict with keys |
None
|
|
dict | None
|
Optional controller limits dict (reserved, no-op for GeoControl). |
None
|
|
int
|
Number of parallel environments. |
1
|
|
str | device
|
Torch device. |
'cpu'
|
Methods:
| Name | Description |
|---|---|
reset |
Reset controller state (stateless — no-op). |
gains_to_randomization_ranges |
Build min/max gain ranges from defaults, scaled by ± scale. |
randomize |
Randomize controller gains and physical parameters. |
update |
Compute batched |
Attributes:
| Name | Type | Description |
|---|---|---|
params |
VehicleParams
|
Vehicle parameters for the controller. |
control_mask |
dict
|
Control mask dict mapped to state keys, used in update(). |
params
instance-attribute
params: VehicleParams = params
Vehicle parameters for the controller.
control_mask
instance-attribute
control_mask: dict = control_mask if control_mask is not None else {}
Control mask dict mapped to state keys, used in update().
reset
reset(env_ids=None) -> None
Reset controller state (stateless — no-op).
gains_to_randomization_ranges
classmethod
gains_to_randomization_ranges(gains=None, scale=0.2)
Build min/max gain ranges from defaults, scaled by ± scale.
randomize
randomize(env_ids=None, gains=None, limits=None, params=None) -> None
Randomize controller gains and physical parameters.
update
update(target: dict, state: dict) -> torch.Tensor
Compute batched (N, 4) [thrust, Mx, My, Mz] from target and state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
Dict with batched tensors for desired state channels. |
required |
|
dict
|
Dict: |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
|