BipedalLocomotion::IK::DistanceTask class

The DistanceTask class controls the distance of a frame with respect the world origin, or another frame.

The task assumes perfect control of the robot velocity $\nu$ that contains the base linear and angular velocity expressed in mixed representation and the joint velocities. The task represents the following equation

\[ \frac{1}{d} p ^ \top J_p \nu = k (d ^ * - d) \]

where $p$ is the position of the target frame wrt the base or world frame. $d$ is the current distance. $J_p$ is the linear part of the robot jacobian. $k$ is the controller gain and $d ^ *$ is the desired distance.

Base classes

struct IKLinearTask
IKLinearTask specializes a LinearTask in the case of Inverse Kinematics.

Public functions

auto initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> paramHandler) -> bool override
Initialize the task.
auto setKinDyn(std::shared_ptr<iDynTree::KinDynComputations> kinDyn) -> bool override
Set the kinDynComputations object.
auto setVariablesHandler(const System::VariablesHandler& variablesHandler) -> bool override
Set the set of variables required by the task.
auto update() -> bool override
Update the content of the task.
auto setDesiredDistance(double desiredDistance) -> bool
setDesiredDistance Set the desired distance between the target and the reference frame
auto setSetPoint(double desiredDistance) -> bool
setSetPoint Set the desired distance between the target and the reference frame
auto getDistance() const -> double
Get the computed distance between the target frame and either the world origin, or the base origin.
auto size() const -> std::size_t override
Get the size of the task.
auto type() const -> Type override
The DistanceTask is an equality task.
auto isValid() const -> bool override
Determines the validity of the objects retrieved with getA() and getB()

Function documentation

bool BipedalLocomotion::IK::DistanceTask::initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> paramHandler) override

Initialize the task.

Parameters
paramHandler pointer to the parameters handler.
Returns True in case of success, false otherwise.

bool BipedalLocomotion::IK::DistanceTask::setKinDyn(std::shared_ptr<iDynTree::KinDynComputations> kinDyn) override

Set the kinDynComputations object.

Parameters
kinDyn pointer to a kinDynComputations object.
Returns True in case of success, false otherwise.

bool BipedalLocomotion::IK::DistanceTask::setVariablesHandler(const System::VariablesHandler& variablesHandler) override

Set the set of variables required by the task.

Parameters
variablesHandler reference to a variables handler.
Returns True in case of success, false otherwise.

The variables are stored in the System::VariablesHandler.

bool BipedalLocomotion::IK::DistanceTask::update() override

Update the content of the task.

Returns True in case of success, false otherwise.

bool BipedalLocomotion::IK::DistanceTask::setDesiredDistance(double desiredDistance)

setDesiredDistance Set the desired distance between the target and the reference frame

Parameters
desiredDistance The desired distance expressed in meters
Returns True in case of success, false otherwise.

bool BipedalLocomotion::IK::DistanceTask::setSetPoint(double desiredDistance)

setSetPoint Set the desired distance between the target and the reference frame

Parameters
desiredDistance The desired distance expressed in meters
Returns True in case of success, false otherwise.

It is equivalent to setDesiredDistance

double BipedalLocomotion::IK::DistanceTask::getDistance() const

Get the computed distance between the target frame and either the world origin, or the base origin.

Returns The computed distance

std::size_t BipedalLocomotion::IK::DistanceTask::size() const override

Get the size of the task.

Returns the size of the task.

(I.e the number of rows of the vector b)

Type BipedalLocomotion::IK::DistanceTask::type() const override

The DistanceTask is an equality task.

Returns the size of the task.

bool BipedalLocomotion::IK::DistanceTask::isValid() const override

Determines the validity of the objects retrieved with getA() and getB()

Returns True if the objects are valid, false otherwise.