Robotics Utilities

class util.robotics.PDController(stiffness, damping)

Implements a PDController

Parameters
  • mass (float) – The mass of the object to control

  • damping_ratio (float) – The damping ratio. Defaults to 1 (critically damped system)

  • step_response (float) – The response time. Defaults to 0.01 seconds.

get_control(pos_error, vel_error)

Return a force control given a position and a velocity error. If you want to use it for orientation control, use 2 log of the quaternion error for position error.

class util.robotics.Trajectory(t, pos, vel=[0, 0], acc=[0, 0])

Implements a 5-order trajectory

Parameters
  • t (tuple) – A tuple with the initial and final time of the trajectory

  • pos (tuple) – A tuple with the initial and final position of the trajectory

  • vel (tuple) – A tuple with the initial and final velocity of the trajectory. Defaults to [0, 0]

  • acc (tuple) – A tuple with the initial and final accelaration of the trajectory. Defaults to [0, 0]

pos(time)

Return the position of the trajectory for the given time. If the time is thresholded in initial and final.

vel(time)

Return the velocity of the trajectory for the given time. If the time is thresholded in initial and final.