Class MinimumEffort

Nested Relationships

Inheritance Relationships

Base Type

Class Documentation

class MinimumEffort : public OpenSoT::Task<Eigen::MatrixXd, Eigen::VectorXd>

The MinimumEffort class implements a task that tries to bring the robot in a minimum-effort posture.

Notice that the weight of the robot is not taken into account when computing effort on the legs (that is, the forces on the floating base are not projected on the contact points jacobians). Also, the minimum effort task is using a simple gradient worker, ComputeGTauGradient, which does not satisfy contact points constraints while performing the configuration vector needed to numerically compute the gradient. In particular, the gravity vector is computed considering a support foot always in contact with the ground. This means in general the minimum effort task should be used together with a cartesian task on the swing foot, imeplemented through the OpenSoT::tasks::velocity::Cartesian class. You can take a look at an implementation example in example_minimum_effort.cpp

Public Types

typedef std::shared_ptr<MinimumEffort> Ptr

Public Functions

MinimumEffort(const XBot::ModelInterface &robot_model, const double step = 1E-3)
~MinimumEffort()
double computeEffort()

computeEffort

Returns

the effort at the actual configuration q (ast from latest update(q))

inline void setW(const Eigen::MatrixXd &W)

setW set a CONSTANT Weight matrix for the manipulability index

Parameters

W – weight matrix

inline const Eigen::MatrixXd &getW()

getW get a Weight matrix for the manipulability index

inline virtual void setLambda(double lambda)

Protected Functions

virtual void _update()

_update updates the minimum effort gradient.

@detail It also updates the state on the internal robot model so that successive calls to the computeEffort() function will take into account the updated posture of the robot.

Parameters

x – the actual posture of the robot

Protected Attributes

const XBot::ModelInterface &_model
Eigen::VectorXd _q
ComputeGTauGradient _gTauGradientWorker
double _step
Eigen::VectorXd _gradient
Eigen::VectorXd _deltas
class ComputeGTauGradient : public CostFunction

The ComputeGTauGradient class implements a worker class to computes the effort for a certain configuration.

It will take into account the robot as standing on a flat floor, and while computing the gradient, we will assume a foot is on the ground. Notice that the way we compute the gradient does not satisfy the constraints of both flat foot on the ground. So in general this simple implementation of the gradient worker needs to be used in a minimum effort task together with a constraint (or a higher priority task) for the swing foot.

Public Functions

inline ComputeGTauGradient(const XBot::ModelInterface &robot_model)
inline virtual double compute(const Eigen::VectorXd &q)

compute value of function in x

Parameters

x

Returns

scalar

inline void setW(const Eigen::MatrixXd &W)
inline const Eigen::MatrixXd &getW() const

Public Members

XBot::ModelInterface::Ptr _robot
const XBot::ModelInterface &_model
Eigen::MatrixXd _W
Eigen::VectorXd _tau
Eigen::VectorXd _tau_lim