tasks::qp::BoundedSpeedConstr Class Reference

#include <Tasks/QPConstr.h>

Inheritance diagram for tasks::qp::BoundedSpeedConstr:
Collaboration diagram for tasks::qp::BoundedSpeedConstr:

Public Member Functions

 BoundedSpeedConstr (const std::vector< rbd::MultiBody > &mbs, int robotIndex, double timeStep)
 
void addBoundedSpeed (const std::vector< rbd::MultiBody > &mbs, const std::string &bodyName, const Eigen::Vector3d &bodyPoint, const Eigen::MatrixXd &dof, const Eigen::VectorXd &speed)
 
void addBoundedSpeed (const std::vector< rbd::MultiBody > &mbs, const std::string &bodyName, const Eigen::Vector3d &bodyPoint, const Eigen::MatrixXd &dof, const Eigen::VectorXd &lowerSpeed, const Eigen::VectorXd &upperSpeed)
 
bool removeBoundedSpeed (const std::string &bodyName)
 
void resetBoundedSpeeds ()
 Remove all bounded speed constraint. More...
 
std::size_t nrBoundedSpeeds () const
 
void updateBoundedSpeeds ()
 Reallocate A and b matrix. More...
 
virtual void updateNrVars (const std::vector< rbd::MultiBody > &mbs, const SolverData &data) override
 
virtual void update (const std::vector< rbd::MultiBody > &mbs, const std::vector< rbd::MultiBodyConfig > &mbc, const SolverData &data) override
 
virtual std::string nameGenInEq () const override
 
virtual std::string descGenInEq (const std::vector< rbd::MultiBody > &mb, int line) override
 
virtual int maxGenInEq () const override
 
virtual const Eigen::MatrixXd & AGenInEq () const override
 
virtual const Eigen::VectorXd & LowerGenInEq () const override
 
virtual const Eigen::VectorXd & UpperGenInEq () const override
 
- Public Member Functions inherited from tasks::qp::ConstraintFunction< GenInequality >
virtual ~ConstraintFunction () override
 
void addToSolver (QPSolver &sol)
 
void addToSolver (const std::vector< rbd::MultiBody > &mbs, QPSolver &sol)
 
void removeFromSolver (QPSolver &sol)
 
- Public Member Functions inherited from tasks::qp::Constraint
virtual ~Constraint ()
 

Detailed Description

Constraint some link velocity in link frame by direct integration.

\[ S (\underline{v} - v) \leq S a \Delta_{dt} \leq S (\overline{v} - v) \]

with \( \underline{v} \) and \( \overline{v} \) the velocity lower and upper bound, \( v \) the link velocity in link frame, \( a \) the link acceleration in link frame and \( S \) the axis selection matrix.

Constructor & Destructor Documentation

◆ BoundedSpeedConstr()

tasks::qp::BoundedSpeedConstr::BoundedSpeedConstr ( const std::vector< rbd::MultiBody > &  mbs,
int  robotIndex,
double  timeStep 
)
Parameters
mbsMulti-robot system.
robotIndexConstrained robot Index in mbs.
timeStepTime step in second.

Member Function Documentation

◆ addBoundedSpeed() [1/2]

void tasks::qp::BoundedSpeedConstr::addBoundedSpeed ( const std::vector< rbd::MultiBody > &  mbs,
const std::string &  bodyName,
const Eigen::Vector3d &  bodyPoint,
const Eigen::MatrixXd &  dof,
const Eigen::VectorXd &  lowerSpeed,
const Eigen::VectorXd &  upperSpeed 
)

Add a bounded speed constraint. Don't forget to call updateBoundedSpeeds and QPSolver::updateConstrSize. You can also only call QPSolver::nrVars or QPSolver::updateConstrsNrVars or QPSolver::updateNrVars.

Parameters
mbsMulti-robot system (must be the same given in the constructor.
bodyIdConstrained body id in mbs[robotIndex].
bodyPointstatic translation applied on the link \( v = xlt(bodyPoint) v_{bodyId} \).
dof\( S \in \mathbb{R}^{n \times 6} \).
lowerSpeedLower velocity \( \underline{v} \in \mathbb{R}^{n} \).
upperSpeedUpper velocity \( \overline{v} \in \mathbb{R}^{n} \).

◆ addBoundedSpeed() [2/2]

void tasks::qp::BoundedSpeedConstr::addBoundedSpeed ( const std::vector< rbd::MultiBody > &  mbs,
const std::string &  bodyName,
const Eigen::Vector3d &  bodyPoint,
const Eigen::MatrixXd &  dof,
const Eigen::VectorXd &  speed 
)

Add a targeted speed constraint. Don't forget to call updateBoundedSpeeds and QPSolver::updateConstrSize. You can also only call QPSolver::nrVars or QPSolver::updateConstrsNrVars or QPSolver::updateNrVars.

Parameters
mbsMulti-robot system (must be the same given in the constructor.
bodyIdConstrained body id in mbs[robotIndex].
bodyPointstatic translation applied on the link \( v = xlt(bodyPoint) v_{bodyId} \).
dof\( S \in \mathbb{R}^{n \times 6} \).
speedTargeted velocity \( \underline{v} \in \mathbb{R}^{n} \) and \( \overline{v} \in \mathbb{R}^{n} \).

◆ AGenInEq()

virtual const Eigen::MatrixXd& tasks::qp::BoundedSpeedConstr::AGenInEq ( ) const
overridevirtual

◆ descGenInEq()

virtual std::string tasks::qp::BoundedSpeedConstr::descGenInEq ( const std::vector< rbd::MultiBody > &  mb,
int  line 
)
overridevirtual

◆ LowerGenInEq()

virtual const Eigen::VectorXd& tasks::qp::BoundedSpeedConstr::LowerGenInEq ( ) const
overridevirtual

◆ maxGenInEq()

virtual int tasks::qp::BoundedSpeedConstr::maxGenInEq ( ) const
overridevirtual

◆ nameGenInEq()

virtual std::string tasks::qp::BoundedSpeedConstr::nameGenInEq ( ) const
overridevirtual

◆ nrBoundedSpeeds()

std::size_t tasks::qp::BoundedSpeedConstr::nrBoundedSpeeds ( ) const
Returns
Number of bounded speed constraint.

◆ removeBoundedSpeed()

bool tasks::qp::BoundedSpeedConstr::removeBoundedSpeed ( const std::string &  bodyName)

Remove a bounded speed constraint.

Parameters
bodyNameRemove the constraint applied on bodyName.
Returns
true if the constraint has been removed false if bodyId was associated with no constraint.

◆ resetBoundedSpeeds()

void tasks::qp::BoundedSpeedConstr::resetBoundedSpeeds ( )

Remove all bounded speed constraint.

◆ update()

virtual void tasks::qp::BoundedSpeedConstr::update ( const std::vector< rbd::MultiBody > &  mbs,
const std::vector< rbd::MultiBodyConfig > &  mbc,
const SolverData data 
)
overridevirtual

Implements tasks::qp::Constraint.

◆ updateBoundedSpeeds()

void tasks::qp::BoundedSpeedConstr::updateBoundedSpeeds ( )

Reallocate A and b matrix.

◆ updateNrVars()

virtual void tasks::qp::BoundedSpeedConstr::updateNrVars ( const std::vector< rbd::MultiBody > &  mbs,
const SolverData data 
)
overridevirtual

Implements tasks::qp::Constraint.

◆ UpperGenInEq()

virtual const Eigen::VectorXd& tasks::qp::BoundedSpeedConstr::UpperGenInEq ( ) const
overridevirtual

The documentation for this class was generated from the following file: