movement_primitives.base.PointToPointMovement#
- class movement_primitives.base.PointToPointMovement(n_pos_dims, n_vel_dims)#
Bases:
ABC
Base class for point to point movements (discrete motions).
- Parameters:
- n_pos_dimsint
Number of dimensions of the position that will be controlled.
- n_vel_dimsint
Number of dimensions of the velocity that will be controlled.
- Attributes:
- n_dimsint
Number of state space dimensions.
- n_vel_dimsint
Number of velocity dimensions.
- tfloat
Current time.
- last_tfloat
Time during last step.
- start_yarray, shape (n_dims,)
Initial state.
- start_ydarray, shape (n_vel_dims,)
Initial velocity.
- start_yddarray, shape (n_vel_dims,)
Initial acceleration.
- goal_yarray, shape (n_dims,)
Goal state.
- goal_ydarray, shape (n_vel_dims,)
Goal velocity.
- goal_yddarray, shape (n_vel_dims,)
Goal acceleration.
- current_yarray, shape (n_dims,)
Current state.
- current_ydarray, shape (n_vel_dims,)
Current velocity.
Methods
configure
([t, start_y, start_yd, start_ydd, ...])Set meta parameters.
n_steps_open_loop
(last_y, last_yd, n_steps)Perform 'n_steps' steps.
step
(last_y, last_yd)Perform step.
- configure(t=None, start_y=None, start_yd=None, start_ydd=None, goal_y=None, goal_yd=None, goal_ydd=None)#
Set meta parameters.
- Parameters:
- tfloat, optional
Time at current step.
- start_yarray, shape (n_dims,)
Initial state.
- start_ydarray, shape (n_vel_dims,)
Initial velocity.
- start_yddarray, shape (n_vel_dims,)
Initial acceleration.
- goal_yarray, shape (n_dims,)
Goal state.
- goal_ydarray, shape (n_vel_dims,)
Goal velocity.
- goal_yddarray, shape (n_vel_dims,)
Goal acceleration.
- Raises:
- ValueError
If the length of the configured meta parameter is not correct.
- n_steps_open_loop(last_y, last_yd, n_steps)#
Perform ‘n_steps’ steps.
- Parameters:
- last_yarray, shape (n_dims,)
Last state.
- last_ydarray, shape (n_dims,)
Last time derivative of state (e.g., velocity).
- n_stepsint
Number of steps.
- Returns:
- yarray, shape (n_dims,)
Next state.
- ydarray, shape (n_dims,)
Next time derivative of state (e.g., velocity).
- abstract step(last_y, last_yd)#
Perform step.
- Parameters:
- last_yarray, shape (n_dims,)
Last state.
- last_ydarray, shape (n_dims,)
Last time derivative of state (e.g., velocity).
- Returns:
- yarray, shape (n_dims,)
Next state.
- ydarray, shape (n_dims,)
Next time derivative of state (e.g., velocity).