robot_fingers.utils module

Utility classes/functions for the robot_fingers package.

class robot_fingers.utils.TimePrinter(interval_s: float = 3600.0)[source]

Bases: object

Regularly print the current date/time and the passed duration in hours.

interval_s

Print interval in seconds

start_time

Timestamp when the printer started

update() None[source]

Print time if the interval_s has passed since the last call.

robot_fingers.utils.min_jerk_trajectory(start_position: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], end_position: _SupportsArray[dtype] | _NestedSequence[_SupportsArray[dtype]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], num_steps: int) Iterator[ndarray[Any, dtype[ScalarType]]][source]

Generator for computing minimum jerk trajectories.

Example

To move from [0, 0, 0] to [1, 2, 3] over 1000 time steps:

for pos in min_jerk_trajectory([0, 0, 0], [1, 2, 3], 1000):
    robot.append_desired_action(Action(position=pos)
Parameters:
  • start_position – Joint positions where the trajectory starts.

  • end_position – Joint positions where the trajectory ends.

  • num_steps – Number of steps for the trajectory.