Add or remove a contact. More...
#include <mc_tasks/AddRemoveContactTask.h>
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::Robots & | robots |
unsigned int | robotIndex |
unsigned int | envIndex |
std::shared_ptr< mc_solver::BoundedSpeedConstr > | constSpeedConstr |
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 |
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.
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
robots | Robots involved in the task |
constSpeedConstr | Used by the solver to constraint the surface movement |
contact | Contact that will be added/removed |
direction | Direction of displacement |
speed | Speed of the displacement |
stiffness | Stiffness of the task |
weight | Weight of the task |
userT_0_s | If provided, overrides the chosen normal direction |
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.
solver | Solver where the task will be used |
contact | Contact that will be added/removed |
direction | Direction of displacement |
speed | Speed of the displacement |
stiffness | Stiffness of the task |
weight | Weight of the task |
userT_0_s | if provided, overrides the chosen normal direction |
|
overridevirtual |
Get the current task's dim weight vector.
Implements mc_tasks::MetaTask.
|
overridevirtual |
Set the task's dimension weight vector.
It is the caller responsibility to ensure the dimensionality fits the underlying tasks' error function
dimW | The new tasks's dimension weight vector |
Implements mc_tasks::MetaTask.
void mc_tasks::AddRemoveContactTask::direction | ( | double | direction | ) |
Set the displacement direction.
direction | Direction of the displacement |
|
overridevirtual |
Returns the task error.
The vector's dimensions depend on the underlying task
Implements mc_tasks::MetaTask.
|
inline |
Get the desired dislacement speed.
|
overridevirtual |
Returns the task velocity.
The vector's dimensions depend on the underlying task
Implements mc_tasks::MetaTask.
void mc_tasks::AddRemoveContactTask::speed | ( | double | s | ) |
Set the desired dislacement speed.
|
inline |
Get the task stiffness.
Eigen::Vector3d mc_tasks::AddRemoveContactTask::velError | ( | ) |
Get the velocity error.
|
inline |
Get the task weight.
std::string mc_tasks::AddRemoveContactTask::bodyId |
std::shared_ptr<mc_solver::BoundedSpeedConstr> mc_tasks::AddRemoveContactTask::constSpeedConstr |
double mc_tasks::AddRemoveContactTask::direction_ |
Eigen::Matrix6d mc_tasks::AddRemoveContactTask::dofMat |
unsigned int mc_tasks::AddRemoveContactTask::envIndex |
mc_rtc::void_ptr mc_tasks::AddRemoveContactTask::impl_ |
Eigen::Vector3d mc_tasks::AddRemoveContactTask::normal |
unsigned int mc_tasks::AddRemoveContactTask::robotBodyIndex |
unsigned int mc_tasks::AddRemoveContactTask::robotIndex |
const mc_rbdyn::Robots& mc_tasks::AddRemoveContactTask::robots |
mc_rbdyn::SurfacePtr mc_tasks::AddRemoveContactTask::robotSurf |
double mc_tasks::AddRemoveContactTask::speed_ |
Eigen::Vector6d mc_tasks::AddRemoveContactTask::speedMat |
double mc_tasks::AddRemoveContactTask::stiffness_ |
Eigen::Vector3d mc_tasks::AddRemoveContactTask::targetSpeed |
sva::PTransformd mc_tasks::AddRemoveContactTask::targetTf |
double mc_tasks::AddRemoveContactTask::targetVelWeight |
double mc_tasks::AddRemoveContactTask::weight_ |