mc_tasks::RelativeEndEffectorTask Struct Reference

Controls an end-effector relatively to another frame. More...

#include <mc_tasks/RelativeEndEffectorTask.h>

Inheritance diagram for mc_tasks::RelativeEndEffectorTask:
Collaboration diagram for mc_tasks::RelativeEndEffectorTask:

Public Member Functions

 RelativeEndEffectorTask (const mc_rbdyn::RobotFrame &frame, const mc_rbdyn::Frame &relative, double stiffness=10.0, double weight=1000.0)
 Constructor. More...
 
 RelativeEndEffectorTask (const std::string &bodyName, const mc_rbdyn::Robots &robots, unsigned int robotIndex, const std::string &relBodyName="", double stiffness=10.0, double weight=1000.0)
 Constructor. More...
 
void reset () override
 Reset the task. More...
 
void add_ef_pose (const sva::PTransformd &dtr) override
 Increment the target position. More...
 
void set_ef_pose (const sva::PTransformd &tf) override
 Change the target position. More...
 
sva::PTransformd get_ef_pose () override
 Returns the current target positions. More...
 
- Public Member Functions inherited from mc_tasks::EndEffectorTask
 EndEffectorTask (const mc_rbdyn::RobotFrame &frame, double stiffness=2.0, double weight=1000.0)
 Constructor. More...
 
 EndEffectorTask (const std::string &bodyName, const mc_rbdyn::Robots &robots, unsigned int robotIndex, double stiffness=2.0, double weight=1000.0)
 Constructor. 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...
 
void selectActiveJoints (mc_solver::QPSolver &solver, const std::vector< std::string > &activeJointsName, const std::map< std::string, std::vector< std::array< int, 2 >>> &activeDofs={}) override
 Setup an active joints selector. More...
 
void selectUnactiveJoints (mc_solver::QPSolver &solver, const std::vector< std::string > &unactiveJointsName, const std::map< std::string, std::vector< std::array< int, 2 >>> &unactiveDofs={}) override
 Setup an unactive joints selector. More...
 
void resetJointsSelector (mc_solver::QPSolver &solver) override
 Reset active joints selection. More...
 
Eigen::VectorXd eval () const override
 Returns the task error. More...
 
Eigen::VectorXd speed () const override
 Returns the task velocity. More...
 
void load (mc_solver::QPSolver &solver, const mc_rtc::Configuration &config) override
 Load parameters from a Configuration object. More...
 
void name (const std::string &name) override
 
virtual void name (const std::string &name)
 
const std::string & name () const
 
- Public Member Functions inherited from mc_tasks::MetaTask
 MetaTask ()
 
virtual ~MetaTask ()
 
const std::string & type () const
 
const std::string & name () const
 
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
 

Protected Member Functions

void addToGUI (mc_rtc::gui::StateBuilder &gui) override
 
- Protected Member Functions inherited from mc_tasks::EndEffectorTask
void removeFromSolver (mc_solver::QPSolver &solver) override
 Remove the task from a solver. More...
 
void addToSolver (mc_solver::QPSolver &solver) override
 Add the task to a solver. More...
 
void addToLogger (mc_rtc::Logger &logger) override
 
void removeFromLogger (mc_rtc::Logger &logger) override
 
const mc_rbdyn::RobotFrameframe () const noexcept
 
- Protected Member Functions inherited from mc_tasks::MetaTask
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
 

Additional Inherited Members

- Public Types inherited from mc_tasks::MetaTask
using Backend = mc_solver::QPSolver::Backend
 
- Public Attributes inherited from mc_tasks::EndEffectorTask
std::shared_ptr< mc_tasks::PositionTaskpositionTask
 
std::shared_ptr< mc_tasks::OrientationTaskorientationTask
 
sva::PTransformd curTransform
 
- 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

Controls an end-effector relatively to another frame.

This task is the relative counter-part to mc_tasks::EndEffectorTask. The difference is that the control is done relatively to a given frame rather than the world frame.

Constructor & Destructor Documentation

◆ RelativeEndEffectorTask() [1/2]

mc_tasks::RelativeEndEffectorTask::RelativeEndEffectorTask ( const mc_rbdyn::RobotFrame frame,
const mc_rbdyn::Frame relative,
double  stiffness = 10.0,
double  weight = 1000.0 
)

Constructor.

Parameters
frameControl frame
relativeRelative frame
stiffnessTask stiffness
weightTask weight

◆ RelativeEndEffectorTask() [2/2]

mc_tasks::RelativeEndEffectorTask::RelativeEndEffectorTask ( const std::string &  bodyName,
const mc_rbdyn::Robots robots,
unsigned int  robotIndex,
const std::string &  relBodyName = "",
double  stiffness = 10.0,
double  weight = 1000.0 
)

Constructor.

Parameters
bodyNameName of the body to control
robotsRobots controlled by this task
robotIndexIndex of the robot controlled by this task
relBodyNameName of the body relatively to which the end-effector is controlled. If empty, defaults to the robot's base.
stiffnessTask stiffness
weightTask weight

Member Function Documentation

◆ add_ef_pose()

void mc_tasks::RelativeEndEffectorTask::add_ef_pose ( const sva::PTransformd &  dtr)
overridevirtual

Increment the target position.

Parameters
dtrChange in target position

Reimplemented from mc_tasks::EndEffectorTask.

◆ addToGUI()

void mc_tasks::RelativeEndEffectorTask::addToGUI ( mc_rtc::gui::StateBuilder )
overrideprotectedvirtual

Add elements to the GUI through the helper

This will be called by the solver when the task is added.

The default implementation adds the type of the task under the {"Tasks", name_} category.

Reimplemented from mc_tasks::EndEffectorTask.

◆ get_ef_pose()

sva::PTransformd mc_tasks::RelativeEndEffectorTask::get_ef_pose ( )
overridevirtual

Returns the current target positions.

Returns
Current target position

Reimplemented from mc_tasks::EndEffectorTask.

◆ reset()

void mc_tasks::RelativeEndEffectorTask::reset ( )
overridevirtual

Reset the task.

Set the task objective to the current end-effector position

Reimplemented from mc_tasks::EndEffectorTask.

◆ set_ef_pose()

void mc_tasks::RelativeEndEffectorTask::set_ef_pose ( const sva::PTransformd &  tf)
overridevirtual

Change the target position.

Parameters
tfNew target position

Reimplemented from mc_tasks::EndEffectorTask.


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