mc_tasks::AddRemoveContactTask Struct Reference

Add or remove a contact. More...

#include <mc_tasks/AddRemoveContactTask.h>

Inheritance diagram for mc_tasks::AddRemoveContactTask:
Collaboration diagram for mc_tasks::AddRemoveContactTask:

Public Member Functions

 AddRemoveContactTask (const mc_rbdyn::Robots &robots, std::shared_ptr< mc_solver::BoundedSpeedConstr > constSpeedConstr, const mc_rbdyn::Contact &contact, double direction, double speed=0.01, double stiffness=2, double weight=1000, Eigen::Vector3d *userT_0_s=nullptr)
 General constructor. More...
 
 AddRemoveContactTask (const mc_solver::QPSolver &solver, const mc_rbdyn::Contact &contact, double direction, double speed=0.01, double stiffness=2, double weight=1000, Eigen::Vector3d *userT_0_s=nullptr)
 General constructor with self-managed bounded speed constraint. More...
 
void direction (double direction)
 Set the displacement direction. More...
 
double speed ()
 Get the desired dislacement speed. More...
 
void speed (double s)
 Set the desired dislacement speed. More...
 
double stiffness ()
 Get the task stiffness. More...
 
double weight ()
 Get the task weight. More...
 
Eigen::Vector3d velError ()
 Get the velocity error. More...
 
void dimWeight (const Eigen::VectorXd &dimW) override
 Set the task's dimension weight vector. More...
 
Eigen::VectorXd dimWeight () const override
 Get the current task's dim weight vector. More...
 
Eigen::VectorXd eval () const override
 Returns the task error. More...
 
Eigen::VectorXd speed () const override
 Returns the task velocity. More...
 
- Public Member Functions inherited from mc_tasks::MetaTask
 MetaTask ()
 
virtual ~MetaTask ()
 
const std::string & type () const
 
virtual void name (const std::string &name)
 
const std::string & name () const
 
virtual void load (mc_solver::QPSolver &solver, const mc_rtc::Configuration &config)
 Load parameters from a Configuration object. More...
 
size_t iterInSolver () const noexcept
 Get the number of iterations since the task was added to the solver. More...
 
void resetIterInSolver () noexcept
 Set the number of iterations since the task was added to the solver to zero. More...
 
void incrementIterInSolver () noexcept
 Increment the number of iterations since the task was added to the solver. More...
 
Backend backend () const noexcept
 

Public Attributes

const mc_rbdyn::Robotsrobots
 
unsigned int robotIndex
 
unsigned int envIndex
 
std::shared_ptr< mc_solver::BoundedSpeedConstrconstSpeedConstr
 
mc_rbdyn::SurfacePtr robotSurf
 
unsigned int robotBodyIndex
 
sva::PTransformd targetTf
 
std::string bodyId
 
Eigen::Matrix6d dofMat
 
Eigen::Vector6d speedMat
 
Eigen::Vector3d normal
 
double stiffness_
 
double weight_
 
double speed_
 
double direction_
 
Eigen::Vector3d targetSpeed
 
mc_rtc::void_ptr impl_
 
double targetVelWeight
 

Additional Inherited Members

- Public Types inherited from mc_tasks::MetaTask
using Backend = mc_solver::QPSolver::Backend
 
- Protected Member Functions inherited from mc_tasks::MetaTask
virtual void addToLogger (mc_rtc::Logger &)
 
virtual void removeFromLogger (mc_rtc::Logger &)
 
virtual void addToGUI (mc_rtc::gui::StateBuilder &)
 
virtual void removeFromGUI (mc_rtc::gui::StateBuilder &)
 
virtual std::function< bool(const mc_tasks::MetaTask &task, std::string &)> buildCompletionCriteria (double dt, const mc_rtc::Configuration &config) const
 
- Static Protected Member Functions inherited from mc_tasks::MetaTask
static void addToSolver (MetaTask &t, mc_solver::QPSolver &solver)
 
static void removeFromSolver (MetaTask &t, mc_solver::QPSolver &solver)
 
static void update (MetaTask &t, mc_solver::QPSolver &solver)
 
static void addToLogger (MetaTask &t, mc_rtc::Logger &logger)
 
static void removeFromLogger (MetaTask &t, mc_rtc::Logger &logger)
 
static void addToGUI (MetaTask &t, mc_rtc::gui::StateBuilder &gui)
 
static void removeFromGUI (MetaTask &t, mc_rtc::gui::StateBuilder &gui)
 
static void ensureHasJoints (const mc_rbdyn::Robot &robot, const std::vector< std::string > &joints, const std::string &prefix)
 
- Protected Attributes inherited from mc_tasks::MetaTask
Backend backend_
 
std::string type_
 
std::string name_
 
size_t iterInSolver_ = 0
 

Detailed Description

Add or remove a contact.

The goal of this task is to move a robot's surface towards a contact or away from a contact depending on construction parameters.

The robot's surface will move along its normal axis. It is the programmer responsibility to stop the task when the desired destination has been reached.

Constructor & Destructor Documentation

◆ AddRemoveContactTask() [1/2]

mc_tasks::AddRemoveContactTask::AddRemoveContactTask ( const mc_rbdyn::Robots robots,
std::shared_ptr< mc_solver::BoundedSpeedConstr constSpeedConstr,
const mc_rbdyn::Contact contact,
double  direction,
double  speed = 0.01,
double  stiffness = 2,
double  weight = 1000,
Eigen::Vector3d *  userT_0_s = nullptr 
)

General constructor.

Constructs an AddRemoveContactTask using information passed by the programmer

Parameters
robotsRobots involved in the task
constSpeedConstrUsed by the solver to constraint the surface movement
contactContact that will be added/removed
directionDirection of displacement
speedSpeed of the displacement
stiffnessStiffness of the task
weightWeight of the task
userT_0_sIf provided, overrides the chosen normal direction

◆ AddRemoveContactTask() [2/2]

mc_tasks::AddRemoveContactTask::AddRemoveContactTask ( const mc_solver::QPSolver solver,
const mc_rbdyn::Contact contact,
double  direction,
double  speed = 0.01,
double  stiffness = 2,
double  weight = 1000,
Eigen::Vector3d *  userT_0_s = nullptr 
)

General constructor with self-managed bounded speed constraint.

Constructs an AddRemoveContactTask using information passed by the programmer. No mc_solver::BoundedSpeedConstr has to be passed. Instead the constraint is created and managed by the task.

Parameters
solverSolver where the task will be used
contactContact that will be added/removed
directionDirection of displacement
speedSpeed of the displacement
stiffnessStiffness of the task
weightWeight of the task
userT_0_sif provided, overrides the chosen normal direction

Member Function Documentation

◆ dimWeight() [1/2]

Eigen::VectorXd mc_tasks::AddRemoveContactTask::dimWeight ( ) const
overridevirtual

Get the current task's dim weight vector.

Implements mc_tasks::MetaTask.

◆ dimWeight() [2/2]

void mc_tasks::AddRemoveContactTask::dimWeight ( const Eigen::VectorXd &  dimW)
overridevirtual

Set the task's dimension weight vector.

It is the caller responsibility to ensure the dimensionality fits the underlying tasks' error function

Parameters
dimWThe new tasks's dimension weight vector

Implements mc_tasks::MetaTask.

◆ direction()

void mc_tasks::AddRemoveContactTask::direction ( double  direction)

Set the displacement direction.

Parameters
directionDirection of the displacement

◆ eval()

Eigen::VectorXd mc_tasks::AddRemoveContactTask::eval ( ) const
overridevirtual

Returns the task error.

The vector's dimensions depend on the underlying task

Implements mc_tasks::MetaTask.

◆ speed() [1/3]

double mc_tasks::AddRemoveContactTask::speed ( )
inline

Get the desired dislacement speed.

◆ speed() [2/3]

Eigen::VectorXd mc_tasks::AddRemoveContactTask::speed ( ) const
overridevirtual

Returns the task velocity.

The vector's dimensions depend on the underlying task

Implements mc_tasks::MetaTask.

◆ speed() [3/3]

void mc_tasks::AddRemoveContactTask::speed ( double  s)

Set the desired dislacement speed.

◆ stiffness()

double mc_tasks::AddRemoveContactTask::stiffness ( )
inline

Get the task stiffness.

◆ velError()

Eigen::Vector3d mc_tasks::AddRemoveContactTask::velError ( )

Get the velocity error.

Returns
Velocity error of the LinVelocity task

◆ weight()

double mc_tasks::AddRemoveContactTask::weight ( )
inline

Get the task weight.

Member Data Documentation

◆ bodyId

std::string mc_tasks::AddRemoveContactTask::bodyId

◆ constSpeedConstr

std::shared_ptr<mc_solver::BoundedSpeedConstr> mc_tasks::AddRemoveContactTask::constSpeedConstr

◆ direction_

double mc_tasks::AddRemoveContactTask::direction_

◆ dofMat

Eigen::Matrix6d mc_tasks::AddRemoveContactTask::dofMat

◆ envIndex

unsigned int mc_tasks::AddRemoveContactTask::envIndex

◆ impl_

mc_rtc::void_ptr mc_tasks::AddRemoveContactTask::impl_

◆ normal

Eigen::Vector3d mc_tasks::AddRemoveContactTask::normal

◆ robotBodyIndex

unsigned int mc_tasks::AddRemoveContactTask::robotBodyIndex

◆ robotIndex

unsigned int mc_tasks::AddRemoveContactTask::robotIndex

◆ robots

const mc_rbdyn::Robots& mc_tasks::AddRemoveContactTask::robots

◆ robotSurf

mc_rbdyn::SurfacePtr mc_tasks::AddRemoveContactTask::robotSurf

◆ speed_

double mc_tasks::AddRemoveContactTask::speed_

◆ speedMat

Eigen::Vector6d mc_tasks::AddRemoveContactTask::speedMat

◆ stiffness_

double mc_tasks::AddRemoveContactTask::stiffness_

◆ targetSpeed

Eigen::Vector3d mc_tasks::AddRemoveContactTask::targetSpeed

◆ targetTf

sva::PTransformd mc_tasks::AddRemoveContactTask::targetTf

◆ targetVelWeight

double mc_tasks::AddRemoveContactTask::targetVelWeight

◆ weight_

double mc_tasks::AddRemoveContactTask::weight_

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