pyrcf.components.controllers.gravity_compensated_joint_pd_controller
Classes
An extension of the JointPDController that adds gravity compensation |
Module Contents
- class pyrcf.components.controllers.gravity_compensated_joint_pd_controller.GravityCompensatedPDController(kp: numpy.ndarray | float, kd: numpy.ndarray | float, pinocchio_interface: pyrcf.utils.kinematics_dynamics.pinocchio_interface.PinocchioInterface, 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, ramp_gravity_torques: bool = True)
Bases:
pyrcf.components.controllers.joint_pd_controller.JointPDControllerAn extension of the JointPDController that adds gravity compensation torques to the commands.
- _ramp_gravity
- _pin_iface
- _compensate = True
- _j_id_offset
- toggle_compensation(enable: bool = None)
Enable or disable gravity compensation by applying additional torque commands to compensate robot’s static weight.
- Parameters:
enable (bool, optional) – True to enable, False to disable. Defaults to None, (when None provided, will automatically toggle between enable/disable).
- 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: