Skip to content

Commit

Permalink
Document base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderFabisch committed Nov 28, 2023
1 parent 62cc160 commit 2e7ab74
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
52 changes: 45 additions & 7 deletions movement_primitives/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,44 @@ class PointToPointMovement(abc.ABC):
n_vel_dims : int
Number of dimensions of the velocity that will be controlled.
Attributes
----------
n_dims : int
Number of state space dimensions.
n_vel_dims : int
Number of velocity dimensions.
t : float
Current time.
last_t : float
Time during last step.
start_y : array, shape (n_dims,)
Initial state.
start_yd : array, shape (n_vel_dims,)
Initial velocity.
start_ydd : array, shape (n_vel_dims,)
Initial acceleration.
goal_y : array, shape (n_dims,)
Goal state.
goal_yd : array, shape (n_vel_dims,)
Goal velocity.
goal_ydd : array, shape (n_vel_dims,)
Goal acceleration.
current_y : array, shape (n_dims,)
Current state.
current_yd : array, shape (n_vel_dims,)
Current velocity.
"""
def __init__(self, n_pos_dims, n_vel_dims):
self.n_dims = n_pos_dims
Expand Down Expand Up @@ -43,25 +81,25 @@ def configure(
Parameters
----------
t : float, optional
Time at current step
Time at current step.
start_y : array, shape (n_dims,)
Initial state
Initial state.
start_yd : array, shape (n_vel_dims,)
Initial velocity
Initial velocity.
start_ydd : array, shape (n_vel_dims,)
Initial acceleration
Initial acceleration.
goal_y : array, shape (n_dims,)
Goal state
Goal state.
goal_yd : array, shape (n_vel_dims,)
Goal velocity
Goal velocity.
goal_ydd : array, shape (n_vel_dims,)
Goal acceleration
Goal acceleration.
"""
if t is not None:
self.t = t
Expand Down
11 changes: 10 additions & 1 deletion movement_primitives/dmp/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@


class DMPBase(PointToPointMovement):
"""Base class of Dynamical Movement Primitives (DMPs)."""
"""Base class of Dynamical Movement Primitives (DMPs).
Parameters
----------
n_pos_dims : int
Number of dimensions of the position that will be controlled.
n_vel_dims : int
Number of dimensions of the velocity that will be controlled.
"""
def __init__(self, n_pos_dims, n_vel_dims):
super(DMPBase, self).__init__(n_pos_dims, n_vel_dims)

Expand Down

0 comments on commit 2e7ab74

Please sign in to comment.