ocra-recipes
Doxygen documentation for the ocra-recipes repository
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
gocra::GHCJTTask Class Reference

A generic abstract task for the GHCJT controller. More...

#include <GHCJTTask.h>

Inheritance diagram for gocra::GHCJTTask:
[legend]
Collaboration diagram for gocra::GHCJTTask:
[legend]

Classes

struct  Pimpl
 

Public Member Functions

 GHCJTTask (const std::string &taskName, const Model &innerModel, Feature::Ptr feature, Feature::Ptr featureDes)
 
 GHCJTTask (const std::string &taskName, const Model &innerModel, Feature::Ptr feature)
 
virtual ~GHCJTTask ()
 
const Eigen::VectorXd & getComputedForce () const
 
const Eigen::MatrixXd & getPriority () const
 
void setPriority (Eigen::MatrixXd &alpha)
 
int getTaskDimension () const
 
const std::string & getTaskName () const
 
void setIndexBegin (int index)
 
int getIndexBegin () const
 
void setIndexEnd (int index)
 
int getIndexEnd () const
 
void setProjector (Eigen::MatrixXd &proj)
 
void setTaskiProjector (Eigen::MatrixXd &proj)
 
const Eigen::MatrixXd & getProjector () const
 
const Eigen::MatrixXd & getTaskiProjector () const
 
LinearFunctiongetInnerObjectiveFunction () const
 
const VariablegetVariable () const
 
- Public Member Functions inherited from ocra::Task
 Task (const std::string &name, std::shared_ptr< Model > model, Feature::Ptr feature, Feature::Ptr featureDes)
 
 Task (const std::string &name, std::shared_ptr< Model > model, Feature::Ptr feature)
 
virtual ~Task ()
 
TaskState getTaskState ()
 
TaskState getDesiredTaskState ()
 
void setDesiredTaskState (const TaskState &newDesiredTaskState)
 
void setDesiredTaskStateDirect (const TaskState &newDesiredTaskState)
 
int getHierarchyLevel ()
 
void setHierarchyLevel (int level)
 
void update ()
 
void setMetaTaskType (Task::META_TASK_TYPE newMetaTaskType)
 
Task::META_TASK_TYPE getMetaTaskType ()
 
std::string getMetaTaskTypeAsString ()
 
void setTaskType (Task::TYPETASK newTaskType)
 
Task::TYPETASK getTaskType ()
 
void activateAsObjective ()
 
void activateAsConstraint ()
 
void deactivate ()
 
bool isActiveAsObjective () const
 
bool isActiveAsConstraint () const
 
void setDesiredMassToActualOne ()
 
void setDesiredMass (double Md)
 
void setDesiredMass (const Eigen::VectorXd &Md)
 
void setDesiredMass (const Eigen::MatrixXd &Md)
 
void setDamping (double B)
 
void setDamping (const Eigen::VectorXd &B)
 
void setDamping (const Eigen::MatrixXd &B)
 
void setStiffness (double K)
 
void setStiffness (const Eigen::VectorXd &K)
 
void setStiffness (const Eigen::MatrixXd &K)
 
void setAutoGains (double freq)
 
void setAutoGains (double freq, double massSaturation)
 
bool isDesiredMassTheActualOne () const
 
const Eigen::MatrixXd & getDesiredMass () const
 
const Eigen::MatrixXd & getDesiredMassInverse () const
 
const Eigen::MatrixXd & getDamping () const
 
const Eigen::MatrixXd & getStiffness () const
 
void activateContactMode ()
 
void deactivateContactMode ()
 
bool isContactModeActive () const
 
bool isBodyContactConstraint () const
 
bool isPointContactTask () const
 
double getFrictionCoeff () const
 
double getMargin () const
 
const Eigen::Vector3d & getFrictionConstraintOffset () const
 
void setFrictionCoeff (double coeff)
 
void setMargin (double margin)
 
void setFrictionConstraintOffset (const Eigen::Vector3d &offset)
 
void setWeight (double weight)
 
void setWeight (const Eigen::VectorXd &weight)
 
const Eigen::VectorXd & getWeight () const
 
int getDimension () const
 
const Eigen::VectorXd & getOutput () const
 
const Eigen::VectorXd & getError () const
 
const Eigen::VectorXd & getErrorDot () const
 
const Eigen::VectorXd & getErrorDdot () const
 
const Eigen::VectorXd & getEffort () const
 
const Eigen::MatrixXd & getJacobian () const
 
const Eigen::VectorXd & getComputedForce () const
 
void disconnectFromController ()
 
void connectToController (std::shared_ptr< OneLevelSolver > _solver, const FullDynamicEquationFunction &dynamicEquation, bool useReducedProblem)
 
- Public Member Functions inherited from ocra::NamedInstance
 NamedInstance (const std::string &name)
 
const std::string & getName () const
 
virtual ~NamedInstance ()
 

Protected Member Functions

void connectToController (ocra::OneLevelSolver &_solver, SumOfLinearFunctions &seConstraint)
 
void disconnectFromController ()
 
void update ()
 
virtual void doGetOutput (Eigen::VectorXd &output) const
 
void addContactPointInModel ()
 
void removeContactPointInModel ()
 
virtual void doActivateContactMode ()
 
virtual void doDeactivateContactMode ()
 
virtual void doSetFrictionCoeff ()
 
virtual void doSetMargin ()
 
virtual void doSetWeight ()
 
virtual void doActivateAsObjective ()
 
virtual void doDeactivateAsObjective ()
 
virtual void doActivateAsConstraint ()
 
virtual void doDeactivateAsConstraint ()
 
void checkIfConnectedToController () const
 
- Protected Member Functions inherited from ocra::Task
Feature::Ptr getFeature () const
 
Feature::Ptr getFeatureDes () const
 
void doActivateAsObjective ()
 
void doActivateAsConstraint ()
 
void doActivateContactMode ()
 
void doDeactivateAsObjective ()
 
void doDeactivateAsConstraint ()
 
void doDeactivateContactMode ()
 
void doSetFrictionCoeff ()
 
void doSetMargin ()
 
void doSetWeight ()
 
void doGetOutput (Eigen::VectorXd &output) const
 
void addContactPointInModel ()
 
void removeContactPointInModel ()
 
void updateAccelerationTask ()
 
void updateTorqueTask ()
 
void updateForceTask ()
 
void updateCoMMomentumTask ()
 
void checkIfConnectedToController () const
 

Friends

class GHCJTController
 

Additional Inherited Members

- Public Types inherited from ocra::Task
enum  META_TASK_TYPE {
  UNKNOWN, POSITION, ORIENTATION, POSE,
  FORCE, COM, COM_MOMENTUM, PARTIAL_POSTURE,
  FULL_POSTURE, PARTIAL_TORQUE, FULL_TORQUE, POINT_CONTACT
}
 
enum  TYPETASK {
  UNKNOWNTASK, ACCELERATIONTASK, TORQUETASK, FORCETASK,
  COMMOMENTUMTASK
}
 

Detailed Description

A generic abstract task for the GHCJT controller.

Definition at line 41 of file GHCJTTask.h.

Constructor & Destructor Documentation

gocra::GHCJTTask::GHCJTTask ( const std::string &  taskName,
const Model innerModel,
Feature::Ptr  feature,
Feature::Ptr  featureDes 
)

Initialize a new GHCJT Task.

Parameters
nameThe name of the task
modelThe ocr::Model on which we will update the dynamic parameters
featureThe task feature, meaning what we want to control
featureDesThe desired task feature, meaning the goal we want to reach with the feature

Definition at line 144 of file GHCJTTask.cpp.

gocra::GHCJTTask::GHCJTTask ( const std::string &  taskName,
const Model innerModel,
Feature::Ptr  feature 
)

Initialize a new GHCJT Task.

Parameters
nameThe name of the task
modelThe ocra::Model on which we will update the dynamic parameters
featureThe task feature, meaning what we want to control

Definition at line 157 of file GHCJTTask.cpp.

gocra::GHCJTTask::~GHCJTTask ( )
virtual

Definition at line 165 of file GHCJTTask.cpp.

Member Function Documentation

void gocra::GHCJTTask::addContactPointInModel ( )
protected

Definition at line 223 of file GHCJTTask.cpp.

void gocra::GHCJTTask::checkIfConnectedToController ( ) const
protected

Definition at line 441 of file GHCJTTask.cpp.

void gocra::GHCJTTask::connectToController ( ocra::OneLevelSolver _solver,
SumOfLinearFunctions seConstraint 
)
protected

Definition at line 171 of file GHCJTTask.cpp.

void gocra::GHCJTTask::disconnectFromController ( )
protected

Definition at line 185 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doActivateAsConstraint ( )
protectedvirtual

Do activation of task as a constraint.

It means that the task should be full completed and no error may occur. Be aware that stong constraints may lead to system instability (very "sharp" solution that requires lot of energy).

Definition at line 345 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doActivateAsObjective ( )
protectedvirtual

Do activation of task as an objective.

It means that the task is not fully completed and a little error may occur.

Definition at line 309 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doActivateContactMode ( )
protectedvirtual

Do task activation when it is a contact task.

When this function is called, it adds a contact point in the model of contact contained in the xde Model instance, and it adds in the solver an inequality constraint that represents the limitation of the contact force that must remain inside the cone of friction.

Definition at line 256 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doDeactivateAsConstraint ( )
protectedvirtual

Do deactivation of task as a constraint.

objective is no more considered.

Definition at line 362 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doDeactivateAsObjective ( )
protectedvirtual

Do deactivation of task as an objective.

objective is no more considered.

Definition at line 327 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doDeactivateContactMode ( )
protectedvirtual

Do task deactivation when it is a contact task.

When this function is called, it removes the contact point in the model of contact, and it removes from the solver the friction cone inequality constraint.

Definition at line 274 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doGetOutput ( Eigen::VectorXd &  output) const
protectedvirtual

Definition at line 216 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doSetFrictionCoeff ( )
protectedvirtual

For contact task, do the setting of the coefficient of friction.

The cone of friction constraint is modified to represent a cone with this new coefficient of friction.

Definition at line 290 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doSetMargin ( )
protectedvirtual

For contact task, do the setting of the friction margin.

The cone of friction constraint is modified to represent a friction cone with this new margin.

Definition at line 299 of file GHCJTTask.cpp.

void gocra::GHCJTTask::doSetWeight ( )
protectedvirtual

Do set the weight of the task.

The weight in the objective function is modified.

Todo:
the getWeight() method of the task returns a matrix, but the setWeight() method of the objective requires a double value. I don't really know how to cope with this problem. For now the first value of the matrix is used.

Definition at line 383 of file GHCJTTask.cpp.

const Eigen::VectorXd & gocra::GHCJTTask::getComputedForce ( ) const

Definition at line 210 of file GHCJTTask.cpp.

int gocra::GHCJTTask::getIndexBegin ( ) const

Definition at line 478 of file GHCJTTask.cpp.

int gocra::GHCJTTask::getIndexEnd ( ) const

Definition at line 488 of file GHCJTTask.cpp.

LinearFunction * gocra::GHCJTTask::getInnerObjectiveFunction ( ) const

Definition at line 513 of file GHCJTTask.cpp.

const MatrixXd & gocra::GHCJTTask::getPriority ( ) const

Definition at line 451 of file GHCJTTask.cpp.

const MatrixXd & gocra::GHCJTTask::getProjector ( ) const

Definition at line 498 of file GHCJTTask.cpp.

int gocra::GHCJTTask::getTaskDimension ( ) const

Definition at line 463 of file GHCJTTask.cpp.

const MatrixXd & gocra::GHCJTTask::getTaskiProjector ( ) const

Definition at line 508 of file GHCJTTask.cpp.

const std::string & gocra::GHCJTTask::getTaskName ( ) const

Definition at line 468 of file GHCJTTask.cpp.

const Variable & gocra::GHCJTTask::getVariable ( ) const

Definition at line 518 of file GHCJTTask.cpp.

void gocra::GHCJTTask::removeContactPointInModel ( )
protected

Definition at line 235 of file GHCJTTask.cpp.

void gocra::GHCJTTask::setIndexBegin ( int  index)

Definition at line 473 of file GHCJTTask.cpp.

void gocra::GHCJTTask::setIndexEnd ( int  index)

Definition at line 483 of file GHCJTTask.cpp.

void gocra::GHCJTTask::setPriority ( Eigen::MatrixXd &  alpha)

Definition at line 457 of file GHCJTTask.cpp.

void gocra::GHCJTTask::setProjector ( Eigen::MatrixXd &  proj)

Definition at line 493 of file GHCJTTask.cpp.

void gocra::GHCJTTask::setTaskiProjector ( Eigen::MatrixXd &  proj)

Definition at line 503 of file GHCJTTask.cpp.

void gocra::GHCJTTask::update ( )
protected

Definition at line 396 of file GHCJTTask.cpp.

Friends And Related Function Documentation

friend class GHCJTController
friend

Definition at line 71 of file GHCJTTask.h.


The documentation for this class was generated from the following files: