Controls an end-effector relatively to another frame. More...
#include <mc_tasks/RelativeEndEffectorTask.h>
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::RobotFrame & | frame () 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::PositionTask > | positionTask |
std::shared_ptr< mc_tasks::OrientationTask > | orientationTask |
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 |
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.
mc_tasks::RelativeEndEffectorTask::RelativeEndEffectorTask | ( | const mc_rbdyn::RobotFrame & | frame, |
const mc_rbdyn::Frame & | relative, | ||
double | stiffness = 10.0 , |
||
double | weight = 1000.0 |
||
) |
Constructor.
frame | Control frame |
relative | Relative frame |
stiffness | Task stiffness |
weight | Task weight |
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.
bodyName | Name of the body to control |
robots | Robots controlled by this task |
robotIndex | Index of the robot controlled by this task |
relBodyName | Name of the body relatively to which the end-effector is controlled. If empty, defaults to the robot's base. |
stiffness | Task stiffness |
weight | Task weight |
|
overridevirtual |
Increment the target position.
dtr | Change in target position |
Reimplemented from mc_tasks::EndEffectorTask.
|
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.
|
overridevirtual |
Returns the current target positions.
Reimplemented from mc_tasks::EndEffectorTask.
|
overridevirtual |
Reset the task.
Set the task objective to the current end-effector position
Reimplemented from mc_tasks::EndEffectorTask.
|
overridevirtual |
Change the target position.
tf | New target position |
Reimplemented from mc_tasks::EndEffectorTask.