Class CartesianPositionConstraint

Inheritance Relationships

Base Type

Class Documentation

class CartesianPositionConstraint : public OpenSoT::Constraint<Eigen::MatrixXd, Eigen::VectorXd>

The CartesianPositionConstraint class implements a constraint of the type \(A_{\text{Cartesian}}J_{\text{EE}}\dot{q} \leq b_{\text{Cartesian}}-A_{\text{Cartesian}}x_{\text{Cartesian}}\) where \(x \in \mathbb{R}^3\) is the position of the link controlled by the Cartesian task, \(A_{\text{Cartesian}} \in \mathbb{R}^{n\times3}\) and \(b_{\text{Cartesian}} \in \mathbb{R}^{n}\) The matrix \(A_{\text{Cartesian}}\) and the vector \(b_{\text{Cartesian}}\) together represent a plane expressed in the \emph{Cartesian} task frame of reference.

We constraint therefore implies we restrict the link movements to be on one side of such plane. In particular, each plane (constraint) can be described as a row of plane coefficients in the matrix \(D=\left[ A_{\text{Cartesian}} , -b_{\text{Cartesian}}\right]\), with \(D\in\mathbb{R}^{n\times4}\). NOTICE It is adviced to apply this constraint only to \emph{Cartesian} tasks that are expressed in the \emph{world} frame of reference, to avoid unexpected behaviors.

Public Types

typedef std::shared_ptr<CartesianPositionConstraint> Ptr

Public Functions

CartesianPositionConstraint(const Eigen::VectorXd &x, OpenSoT::tasks::velocity::Cartesian::Ptr cartesianTask, const Eigen::MatrixXd &A_Cartesian, const Eigen::VectorXd &b_Cartesian, const double boundScaling = 1.0)

CartesianPositionConstraint.

Parameters
  • x – the current joint position of the robot

  • cartesianTask – the cartesian task which we want to bound

  • A_Cartesian – a matrix nx3 specifying the cartesian limits

  • b_Cartesian – a vector of size n specifying the cartesian limits

  • boundScaling – a parameter which is inversely proportional to the number of steps needed to reach the cartesian task limits.

CartesianPositionConstraint(const Eigen::VectorXd &x, OpenSoT::tasks::velocity::CoM::Ptr comTask, const Eigen::MatrixXd &A_Cartesian, const Eigen::VectorXd &b_Cartesian, const double boundScaling = 1.0)

CartesianPositionConstraint.

Parameters
  • x – the current joint position of the robot

  • comTask

  • A_Cartesian – a matrix nx3 specifying the cartesian limits

  • b_Cartesian – a vector of size n specifying the cartesian limits

  • boundScaling – a parameter which is inversely proportional to the number of steps needed to reach the cartesian task limits.

virtual void update()

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

void getCurrentPosition(Eigen::VectorXd &current_position)

getCurrentPosition return the current Cartesian position of the bounded Task

Parameters

current_position – a 3x1 position vector

void setAbCartesian(const Eigen::MatrixXd &A_Cartesian, const Eigen::VectorXd &b_Cartesian)

setAbCartesian update with new A_Cartesian and b_Cartesian

Parameters
  • A_Cartesian – new matrix nx3 specifying the cartesian limits

  • b_Cartesian – new vector of size n specifying the cartesian limits