BipedalLocomotion::System::LinearTask class

LinearTask describes a Linear Task element.

The LinearTask is described by a matrix $A$ and a vector $b$ . This class describes both a linear equality constraint and a linear inequality constraint. In case of equality constraint $ A $ and $ b $ represents: $ Ax = b$ In case of inequality constraint $ A $ and $ b $ represents: $ Ax \le b $

Derived classes

struct BipedalLocomotion::IK::IKLinearTask
IKLinearTask specializes a LinearTask in the case of Inverse Kinematics.
struct BipedalLocomotion::TSID::TSIDLinearTask
TSIDLinearTask specializes a LinearTask in the case of Task based Inverse Dynamics.

Public types

enum class Type { equality, inequality }
Type of the task.

Constructors, destructors, conversion operators

~LinearTask() defaulted virtual
Destructor.

Public functions

auto setVariablesHandler(const System::VariablesHandler& variablesHandler) -> bool virtual
Set the set of variables required by the task.
auto initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> paramHandler) -> bool virtual
Initialize the task.
auto update() -> bool virtual
Update the content of the task.
auto getA() const -> Eigen::Ref<const Eigen::MatrixXd>
Get the matrix A.
auto getB() const -> Eigen::Ref<const Eigen::VectorXd>
Get the vector b.
auto getDescription() const -> const std::string&
Get the description of the task.
auto size() const -> std::size_t pure virtual
Get the size of the task.
auto type() const -> Type pure virtual
Get the type of the task.
auto isValid() const -> bool pure virtual
Determines the validity of the objects retrieved with getA() and getB()
auto getResidual(Eigen::Ref<const Eigen::VectorXd> solution) const -> Eigen::VectorXd
Compute the residual of the task.

Protected functions

auto subA(const System::VariablesHandler::VariableDescription& description) -> iDynTree::MatrixView<double>
Extract the submatrix A associated to a given variable.
auto subA(const System::VariablesHandler::VariableDescription& description) const -> iDynTree::MatrixView<const double>
Extract the submatrix A associated to a given variable.

Protected variables

Eigen::MatrixXd m_A
Task Matrix.
Eigen::VectorXd m_b
Task Vector.
std::string m_description
String describing the content of the task.

Enum documentation

enum class BipedalLocomotion::System::LinearTask::Type

Type of the task.

Namely an equality or an inequality task.

Function documentation

bool BipedalLocomotion::System::LinearTask::setVariablesHandler(const System::VariablesHandler& variablesHandler) virtual

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::System::LinearTask::initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> paramHandler) virtual

Initialize the task.

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

bool BipedalLocomotion::System::LinearTask::update() virtual

Update the content of the task.

Returns True in case of success, false otherwise.

Eigen::Ref<const Eigen::MatrixXd> BipedalLocomotion::System::LinearTask::getA() const

Get the matrix A.

Returns a const reference to the matrix A.

Eigen::Ref<const Eigen::VectorXd> BipedalLocomotion::System::LinearTask::getB() const

Get the vector b.

Returns a const reference to the vector b.

const std::string& BipedalLocomotion::System::LinearTask::getDescription() const

Get the description of the task.

Returns a string containing the description of the task.

std::size_t BipedalLocomotion::System::LinearTask::size() const pure virtual

Get the size of the task.

Returns the size of the task.

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

Type BipedalLocomotion::System::LinearTask::type() const pure virtual

Get the type of the task.

Returns the size of the task.

Namely equality or inequality.

bool BipedalLocomotion::System::LinearTask::isValid() const pure virtual

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

Returns True if the objects are valid, false otherwise.

Eigen::VectorXd BipedalLocomotion::System::LinearTask::getResidual(Eigen::Ref<const Eigen::VectorXd> solution) const

Compute the residual of the task.

Returns the residual associated to the task

The residual is defined as

\[ r = A x - b \]

where $x$ is the solution of the ILinearTaskSolver