This class implements the Stack of Task. It allows to deal with the priority of the controllers through the shell. The controllers can be either constraints either tasks. More...
#include <sot/core/sot.hh>
Public Member Functions | |
virtual const std::string & | getClassName () const |
Returns the name of this class. | |
Sot (const std::string &name) | |
Default constructor. | |
~Sot (void) | |
virtual void | defineFreeFloatingJoints (const unsigned int &jointIdFirst, const unsigned int &jointIdLast=-1) |
This method defines the part of the state vector which correspond to the free flyer of the robot. | |
virtual void | defineNbDof (const unsigned int &nbDof) |
virtual void | commandLine (const std::string &cmdLine, std::istringstream &cmdArgs, std::ostream &os) |
This method deals with the command line. The command given in argument is send to the stack of tasks by the shell. The command understood by sot are: | |
virtual std::ostream & | writeGraph (std::ostream &os) const |
This method write the priority between tasks in the output stream os. | |
Methods to handle the stack. | |
virtual void | push (TaskAbstract &task) |
Push the task in the stack. It has a lowest priority than the previous ones. If this is the first task, then it has the highest priority. | |
virtual TaskAbstract & | pop (void) |
Pop the task from the stack. This method removes the task with the smallest priority in the task. The other are projected in the null-space of their predecessors. | |
virtual bool | exist (const TaskAbstract &task) |
This method allows to know if a task exists or not. | |
virtual void | remove (const TaskAbstract &task) |
Remove a task regardless to its position in the stack. It removes also the signals connected to the output signal of this stack. | |
virtual void | removeDependency (const TaskAbstract &key) |
This method removes the output signals depending on this task. | |
virtual void | up (const TaskAbstract &task) |
This method makes the task to swap with the task having the immediate superior priority. | |
virtual void | down (const TaskAbstract &task) |
This method makes the task to swap with the task having the immediate inferior priority. | |
virtual void | clear (void) |
Remove all the tasks from the stack. | |
Methods to handle the constraints. | |
virtual void | addConstraint (Constraint &constraint) |
Add a constraint to the stack with the current level of priority. | |
virtual void | removeConstraint (const Constraint &constraint) |
Remove a constraint from the stack. | |
virtual void | clearConstraint (void) |
Remove all the constraints from the stack. | |
Methods to compute the control law following the | |
recursive definition of the stack of tasks. | |
virtual ml::Vector & | computeControlLaw (ml::Vector &control, const int &time) |
Compute the control law. | |
virtual ml::Matrix & | computeConstraintProjector (ml::Matrix &Proj, const int &time) |
Compute the projector of the constraint. | |
Static Public Member Functions | |
static ml::Matrix & | computeJacobianConstrained (const ml::Matrix &Jac, const ml::Matrix &K, ml::Matrix &JK, ml::Matrix &Jff, ml::Matrix &Jact) |
static ml::Matrix & | computeJacobianConstrained (const TaskAbstract &task, const ml::Matrix &K) |
static ml::Vector | taskVectorToMlVector (const VectorMultiBound &taskVector) |
Public Attributes | |
Methods to handle signals | |
SignalPtr< ml::Vector, int > | q0SIN |
Intrinsec velocity of the robot, that is used to initialized the recurence of the SOT (e.g. velocity comming from the other OpenHRP plugins). | |
SignalPtr< double, int > | inversionThresholdSIN |
This signal allow to change the threshold for the damped pseudo-inverse on-line. | |
SignalTimeDependent < ml::Matrix, int > | constraintSOUT |
Allow to get the result of the Constraint projector. | |
SignalTimeDependent < ml::Vector, int > | controlSOUT |
Allow to get the result of the computed control law. | |
Static Public Attributes | |
static const std::string | CLASS_NAME |
Specify the name of the class entity. | |
static const double | INVERSION_THRESHOLD_DEFAULT |
Threshold to compute the dumped pseudo inverse. | |
static const unsigned int | NB_JOINTS_DEFAULT |
Number of joints by default. | |
Protected Types | |
typedef std::list< TaskAbstract * > | StackType |
Defines a type for a list of tasks. | |
typedef std::list< Constraint * > | ConstraintListType |
Defines a type for a list of constraints. | |
Protected Attributes | |
StackType | stack |
This field is a list of controllers managed by the stack of tasks. | |
ConstraintListType | constraintList |
This field is a list of constraints managed by the stack of tasks. | |
unsigned int | ffJointIdFirst |
Defines an interval in the state vector of the robot which is the free flyer. | |
unsigned int | ffJointIdLast |
unsigned int | nbJoints |
Store the number of joints to be used in the command computed by the stack of tasks. | |
TaskAbstract * | taskGradient |
Store a pointer to compute the gradient. | |
ml::Matrix | Proj |
bool | recomputeEachTime |
Static Protected Attributes | |
static const unsigned int | FF_JOINT_ID_DEFAULT = 0 |
Defines a default joint. | |
Methods to display the stack of tasks. | |
virtual void | display (std::ostream &os) const |
SOTSOT_CORE_EXPORT friend std::ostream & | operator<< (std::ostream &os, const Sot &sot) |
This class implements the Stack of Task. It allows to deal with the priority of the controllers through the shell. The controllers can be either constraints either tasks.
typedef std::list<Constraint*> dynamicgraph::sot::Sot::ConstraintListType [protected] |
Defines a type for a list of constraints.
typedef std::list<TaskAbstract*> dynamicgraph::sot::Sot::StackType [protected] |
Defines a type for a list of tasks.
dynamicgraph::sot::Sot::Sot | ( | const std::string & | name | ) |
Default constructor.
dynamicgraph::sot::Sot::~Sot | ( | void | ) | [inline] |
virtual void dynamicgraph::sot::Sot::addConstraint | ( | Constraint & | constraint | ) | [virtual] |
Add a constraint to the stack with the current level of priority.
virtual void dynamicgraph::sot::Sot::clear | ( | void | ) | [virtual] |
Remove all the tasks from the stack.
virtual void dynamicgraph::sot::Sot::clearConstraint | ( | void | ) | [virtual] |
Remove all the constraints from the stack.
virtual void dynamicgraph::sot::Sot::commandLine | ( | const std::string & | cmdLine, |
std::istringstream & | cmdArgs, | ||
std::ostream & | os | ||
) | [virtual] |
This method deals with the command line. The command given in argument is send to the stack of tasks by the shell. The command understood by sot are:
Reimplemented from dynamicgraph::Entity.
Reimplemented in dynamicgraph::sot::SotH.
virtual ml::Matrix& dynamicgraph::sot::Sot::computeConstraintProjector | ( | ml::Matrix & | Proj, |
const int & | time | ||
) | [virtual] |
Compute the projector of the constraint.
virtual ml::Vector& dynamicgraph::sot::Sot::computeControlLaw | ( | ml::Vector & | control, |
const int & | time | ||
) | [virtual] |
Compute the control law.
Reimplemented in dynamicgraph::sot::SotH.
static ml::Matrix& dynamicgraph::sot::Sot::computeJacobianConstrained | ( | const ml::Matrix & | Jac, |
const ml::Matrix & | K, | ||
ml::Matrix & | JK, | ||
ml::Matrix & | Jff, | ||
ml::Matrix & | Jact | ||
) | [static] |
static ml::Matrix& dynamicgraph::sot::Sot::computeJacobianConstrained | ( | const TaskAbstract & | task, |
const ml::Matrix & | K | ||
) | [static] |
virtual void dynamicgraph::sot::Sot::defineFreeFloatingJoints | ( | const unsigned int & | jointIdFirst, |
const unsigned int & | jointIdLast = -1 |
||
) | [virtual] |
This method defines the part of the state vector which correspond to the free flyer of the robot.
virtual void dynamicgraph::sot::Sot::defineNbDof | ( | const unsigned int & | nbDof | ) | [virtual] |
Reimplemented in dynamicgraph::sot::SotH.
virtual void dynamicgraph::sot::Sot::display | ( | std::ostream & | os | ) | const [virtual] |
Display the stack of tasks in text mode as a tree.
Reimplemented from dynamicgraph::Entity.
virtual void dynamicgraph::sot::Sot::down | ( | const TaskAbstract & | task | ) | [virtual] |
This method makes the task to swap with the task having the immediate inferior priority.
virtual bool dynamicgraph::sot::Sot::exist | ( | const TaskAbstract & | task | ) | [virtual] |
This method allows to know if a task exists or not.
virtual const std::string& dynamicgraph::sot::Sot::getClassName | ( | void | ) | const [inline, virtual] |
Returns the name of this class.
Implements dynamicgraph::Entity.
Reimplemented in dynamicgraph::sot::WeightedSot, and dynamicgraph::sot::SotH.
virtual TaskAbstract& dynamicgraph::sot::Sot::pop | ( | void | ) | [virtual] |
Pop the task from the stack. This method removes the task with the smallest priority in the task. The other are projected in the null-space of their predecessors.
virtual void dynamicgraph::sot::Sot::push | ( | TaskAbstract & | task | ) | [virtual] |
Push the task in the stack. It has a lowest priority than the previous ones. If this is the first task, then it has the highest priority.
virtual void dynamicgraph::sot::Sot::remove | ( | const TaskAbstract & | task | ) | [virtual] |
Remove a task regardless to its position in the stack. It removes also the signals connected to the output signal of this stack.
virtual void dynamicgraph::sot::Sot::removeConstraint | ( | const Constraint & | constraint | ) | [virtual] |
Remove a constraint from the stack.
virtual void dynamicgraph::sot::Sot::removeDependency | ( | const TaskAbstract & | key | ) | [virtual] |
This method removes the output signals depending on this task.
static ml::Vector dynamicgraph::sot::Sot::taskVectorToMlVector | ( | const VectorMultiBound & | taskVector | ) | [static] |
virtual void dynamicgraph::sot::Sot::up | ( | const TaskAbstract & | task | ) | [virtual] |
This method makes the task to swap with the task having the immediate superior priority.
virtual std::ostream& dynamicgraph::sot::Sot::writeGraph | ( | std::ostream & | os | ) | const [virtual] |
This method write the priority between tasks in the output stream os.
Reimplemented from dynamicgraph::Entity.
SOTSOT_CORE_EXPORT friend std::ostream& operator<< | ( | std::ostream & | os, |
const Sot & | sot | ||
) | [friend] |
Wrap the previous method around an operator.
const std::string dynamicgraph::sot::Sot::CLASS_NAME [static] |
Specify the name of the class entity.
Reimplemented in dynamicgraph::sot::WeightedSot, and dynamicgraph::sot::SotH.
This field is a list of constraints managed by the stack of tasks.
Allow to get the result of the Constraint projector.
Allow to get the result of the computed control law.
const unsigned int dynamicgraph::sot::Sot::FF_JOINT_ID_DEFAULT = 0 [static, protected] |
Defines a default joint.
unsigned int dynamicgraph::sot::Sot::ffJointIdFirst [protected] |
Defines an interval in the state vector of the robot which is the free flyer.
unsigned int dynamicgraph::sot::Sot::ffJointIdLast [protected] |
const double dynamicgraph::sot::Sot::INVERSION_THRESHOLD_DEFAULT [static] |
Threshold to compute the dumped pseudo inverse.
This signal allow to change the threshold for the damped pseudo-inverse on-line.
const unsigned int dynamicgraph::sot::Sot::NB_JOINTS_DEFAULT [static] |
Number of joints by default.
unsigned int dynamicgraph::sot::Sot::nbJoints [protected] |
Store the number of joints to be used in the command computed by the stack of tasks.
ml::Matrix dynamicgraph::sot::Sot::Proj [protected] |
Projection used to compute the control law.
Intrinsec velocity of the robot, that is used to initialized the recurence of the SOT (e.g. velocity comming from the other OpenHRP plugins).
bool dynamicgraph::sot::Sot::recomputeEachTime [protected] |
Force the recomputation at each step.
StackType dynamicgraph::sot::Sot::stack [protected] |
This field is a list of controllers managed by the stack of tasks.
TaskAbstract* dynamicgraph::sot::Sot::taskGradient [protected] |
Store a pointer to compute the gradient.