BipedalLocomotion::JointLevelControllers::PositionToTorqueController class

Position-to-torque Controller.

The PositionToTorqueController implements a position control strategy that directly computes joint torque commands from position errors.

The controller implements a proportional-derivative position control law:

\[ \tau = K_p \cdot (q_{ref} - q_{fb}) + K_d \cdot (0 - \dot{q}_{fb}) \]

where:

  • $ \tau $ is the output torque [Nm]
  • $ K_p $ is the proportional gain [Nm/rad]
  • $ K_d $ is the derivative gain [Nm/(rad/s)]
  • $ q_{ref} $ is the reference position [rad]
  • $ q_{fb} $ is the feedback position [rad]
  • $ \dot{q}_{fb} $ is the feedback velocity [rad/s]

Base classes

class PositionToJointController
Base class for Position-to-Joint Controllers.

Constructors, destructors, conversion operators

PositionToTorqueController()
Default constructor.
~PositionToTorqueController() virtual
Default destructor.

Public functions

auto advance() -> bool override
Advance the controller.
auto initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler) -> bool override
Initialize the advanceable.
auto setInput(const PositionToJointControllerInput& input) -> bool override
Set the input of the port.
auto getOutput() const -> Eigen::VectorXd& override
Get the output of the controller.
auto isOutputValid() const -> bool override
Check if the output is valid.

Function documentation

bool BipedalLocomotion::JointLevelControllers::PositionToTorqueController::advance() override

Advance the controller.

Returns The output of the controller

bool BipedalLocomotion::JointLevelControllers::PositionToTorqueController::initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler) override

Initialize the advanceable.

Parameters
handler A weak pointer to the parameters handler
Returns True if the initialization is successful.

Furthermore, the following optional parameters are supported:

Group NameDescriptionMandatory
torque_limitAn element for each joint contained in the joints_list parameter. Torque limit for each joint [Nm]No

bool BipedalLocomotion::JointLevelControllers::PositionToTorqueController::setInput(const PositionToJointControllerInput& input) override

Set the input of the port.

Parameters
input the input of the controller
Returns True in case of success and false otherwise

Eigen::VectorXd& BipedalLocomotion::JointLevelControllers::PositionToTorqueController::getOutput() const override

Get the output of the controller.

Returns The output of the controller

bool BipedalLocomotion::JointLevelControllers::PositionToTorqueController::isOutputValid() const override

Check if the output is valid.

Returns True if the output is valid, false otherwise