Skip to content

Commit 0e841a3

Browse files
committed
Update docs
1 parent c1eb41f commit 0e841a3

2 files changed

Lines changed: 10 additions & 13 deletions

File tree

drone_models/core.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,27 @@ def wrapper(
5353
def parametrize(
5454
fn: Callable[P, R], drone_model: str, xp: ModuleType | None = None, device: str | None = None
5555
) -> Callable[P, R]:
56-
"""Parametrize a controller function with the default controller parameters for a drone model.
56+
"""Parametrize a dynamics function with the default dynamics parameters for a drone model.
5757
5858
Args:
59-
fn: The controller function to parametrize.
59+
fn: The dynamics function to parametrize.
6060
drone_model: The drone model to use.
6161
xp: The array API module to use. If not provided, numpy is used.
6262
device: The device to use. If none, the device is inferred from the xp module.
6363
6464
Example:
6565
```python
66-
controller_fn = parametrize(state2attitude, drone_model="cf2x_L250")
67-
command_rpyt, int_pos_err = controller_fn(
68-
pos=pos,
69-
quat=quat,
70-
vel=vel,
71-
ang_vel=ang_vel,
72-
cmd=cmd,
73-
ctrl_errors=(int_pos_err,),
74-
ctrl_freq=100,
66+
from drone_models.core import parametrize
67+
from drone_models.first_principles import dynamics
68+
69+
dynamics_fn = parametrize(dynamics, drone_model="cf2x_L250")
70+
pos_dot, quat_dot, vel_dot, ang_vel_dot, rotor_vel_dot = dynamics_fn(
71+
pos=pos, quat=quat, vel=vel, ang_vel=ang_vel, cmd=cmd, rotor_vel=rotor_vel
7572
)
7673
```
7774
7875
Returns:
79-
The parametrized controller function with all keyword argument only parameters filled in.
76+
The parametrized dynamics function with all keyword argument only parameters filled in.
8077
"""
8178
try:
8279
xp = np if xp is None else xp

drone_models/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Utility functions for the drone models and controllers."""
1+
"""Utility functions for the drone models."""
22

33
from types import ModuleType
44
from typing import Any

0 commit comments

Comments
 (0)