Class CoM

Inheritance Relationships

Base Type

Class Documentation

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

The CoM class implements a task that tries to impose a position of the CoM w.r.t.

the world frame.

Public Types

typedef std::shared_ptr<CoM> Ptr

Public Functions

CoM(XBot::ModelInterface &robot, const std::string &id = "CoM")

CoM.

Parameters
  • x – the initial configuration of the robot

  • robot – the robot model

~CoM()
virtual void setReference(const Eigen::Vector3d &desiredPosition)

setReference sets a new reference for the CoM task.

It causes the task error to be recomputed immediately, without the need to call the _update(x) function. It also assumes a null desired velocity at the desired position, meaning we are trying to achieve a regulation task.

Parameters

desiredPose – the \(R^{3}\) vector describing the desired position for the CoM in the world coordinate frame

virtual void setReference(const KDL::Vector &desiredPosition)
virtual void setReference(const Eigen::Vector3d &desiredPosition, const Eigen::Vector3d &desiredVelocity)

setReference sets a new reference for the CoM task.

It causes the task error to be recomputed immediately, without the need to call the _update(x) function Notice how the setReference(desiredPosition, desiredVelocity) needs to be called before each _update(x) of the CoM task, since THE _update() RESETS THE FEED-FORWARD VELOCITY TERM for safety reasons.

Parameters
  • desiredPosition – the \(R^{3}\) vector describing the desired position of the CoM wrt world.

  • desireVelocity – is a \(R^{3}\) linear velocity vector describing the desired trajectory velocity, and it represents a feed-forward term in the CoM task computation. NOTICE how the velocities are in m/sample, instead of m/s. This means that if you have a linear velocity expressed in SI units, you have to call the function as setReference(desiredPosition, desiredVelocity*dt)

virtual void setReference(const KDL::Vector &desiredPosition, const KDL::Vector &desiredVelocity)
virtual const Eigen::Vector3d &getReference() const

getReference returns the CoM task reference

Returns

the CoM task reference \(R^3\) vector describing the actual CoM position in the world coordinate frame

virtual void getReference(Eigen::Vector3d &desiredPosition, Eigen::Vector3d &desiredVelocity) const

getReference gets the current reference and feed-forward velocity for the CoM task.

Parameters
  • desiredPosition – the \(R^{3}\) vector describing the desired position of the CoM in the world coordinate frame.

  • desireVelocity – is a \(R^{3}\) twist describing the desired trajectory velocity, and it represents a feed-forward term in the task computation

const Eigen::Vector3d &getCachedVelocityReference() const

getCachedVelocityReference can be used to get Velocity reference after update(), it will reset next update()

Returns

internal velcity reference

const Eigen::Vector3d &getActualPosition() const

getActualPosition returns the CoM actual position.

You need to call _update(x) for the position to change

Returns

the \(R^{3}\) vector describing the actual CoM position in the world coordinate frame

const std::string &getBaseLink() const

getBaseLink an utility function that always returns “world”

Returns

“world”

const std::string &getDistalLink() const

getDistalLink an utility function that always

Returns

virtual void setLambda(double lambda)
const Eigen::Vector3d &getError() const

getError returns the position error between actual and reference positions

Returns

a \(R^{3}\) vector describing cartesian error between actual and reference position

virtual bool reset()

reset set as actual Cartesian reference the actual pose

Returns

Public Static Functions

static bool isCoM(OpenSoT::Task<Eigen::MatrixXd, Eigen::VectorXd>::TaskPtr task)
static OpenSoT::tasks::velocity::CoM::Ptr asCoM(OpenSoT::Task<Eigen::MatrixXd, Eigen::VectorXd>::TaskPtr task)

Protected Functions

virtual void _update()

Updates the A, b, Aeq, beq, Aineq, b*Bound matrices.

virtual void _log(XBot::MatLogger2::Ptr logger)

_log can be used to log internal Task variables

Parameters

logger – a shared pointer to a MatLogger