pyrcf.components.controllers.joint_pd_controller

Classes

JointPDController

Tracks joint position and velocity reference provided in local_plan message directly.

Module Contents

class pyrcf.components.controllers.joint_pd_controller.JointPDController(kp: numpy.ndarray | float, kd: numpy.ndarray | float, hold_position_at_start: bool = True, gain_ramp_up_time: float = 0.0, ramp_start_kp: numpy.ndarray | float = 0.0, ramp_start_kd: numpy.ndarray | float = 0.0)

Bases: pyrcf.components.controllers.controller_base.ControllerBase

Tracks joint position and velocity reference provided in local_plan message directly.

_target_kp
_target_kd
_hold_position
_ramp_duration
_ramp_start_kp
_ramp_start_kd
_on_ramp_target
_ramp_factor = 1.0
_duration_in_ctrl_mode = 0.0
_ramping_complete = False
_robot_cmd: pyrcf.core.types.RobotCmd = None
update(robot_state: pyrcf.core.types.RobotState, local_plan: pyrcf.core.types.LocalMotionPlan, t: float = None, dt: float = None) pyrcf.core.types.RobotCmd

The main control update method to be called in the loop.

This method will be called after the global plan and local plan are generated in the loop.

This method should be implemented by any controller implementation.

Parameters:
  • robot_state (RobotState) – The current state information from the robot.

  • local_plan (LocalMotionPlan) – the latest local plan generated by the local planner used in the loop.

  • t (float, optional) – the current time signature of the control loop. Defaults to None (controllers may or may not need this).

  • dt (float, optional) – the time since the last control loop. Defaults to None (controllers may or may not need this).

Raises:

NotImplementedError – Raised if this method is not implemented by the child class.

Returns:

The output control command to be sent to the robot.

Return type:

RobotCmd