rotor
Torch rotor dynamics for batched simulation.
Classes:
| Name | Description |
|---|---|
RotorDynamics |
Batched rotor dynamics model. |
RotorDynamics
RotorDynamics(params: VehicleParams = VehicleParams(), num_envs: int = 1, device: str | device = 'cpu')
Bases: DynamicsBase
Batched rotor dynamics model.
Initialize batched rotor dynamics on the specified device.
Methods:
| Name | Description |
|---|---|
randomize |
Randomize rotor runtime parameters from nominal values. |
update |
Calculate the output thrust and torque for each motor based on the motor commands. |
reset |
Resets the rotor model to initial conditions. |
Attributes:
| Name | Type | Description |
|---|---|---|
params |
VehicleParams
|
Vehicle parameters for the dynamics model. |
params
instance-attribute
params: VehicleParams = params
Vehicle parameters for the dynamics model.
randomize
randomize(env_ids: slice | Sequence[int] | Tensor | None = None, randomization: dict[str, tuple[float, float]] | None = None) -> None
Randomize rotor runtime parameters from nominal values.
update
update(commands: Tensor) -> torch.Tensor
Calculate the output thrust and torque for each motor based on the motor commands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Tensor
|
Command tensor for each motor. Shape: (num_envs, 4) |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
torch.Tensor: Thrust and torque tensor for each motor. Shape: (num_envs, 8) |
reset
reset(env_ids: slice | Sequence[int] | Tensor) -> None
Resets the rotor model to initial conditions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
slice | Sequence[int] | Tensor
|
The environment ids to reset. |
required |