ORCA: Optimization-based framework for Robotic Control Applications
Public Member Functions | Protected Member Functions | List of all members
orca::constraint::LinearizedCoulombConstraint Class Reference

#include <LinearizedCoulombConstraint.h>

+ Inheritance diagram for orca::constraint::LinearizedCoulombConstraint:
+ Collaboration diagram for orca::constraint::LinearizedCoulombConstraint:

Public Member Functions

 LinearizedCoulombConstraint (const std::string &name)
 
double getFrictionCoeff () const
 
double getMargin () const
 
void setAngleOffset (double angle_offset)
 
void setFrictionCoeff (double coeff)
 
void setMargin (double margin)
 
void setConeOrientation (const Eigen::Matrix3d &R)
 
const Eigen::Matrix3d & getConeOrientation () const
 
void setNumberOfFaces (int nfaces)
 
- Public Member Functions inherited from orca::constraint::GenericConstraint
 GenericConstraint (const std::string &name, optim::ControlVariable control_var)
 Construct the double bounded function, and set its default state : activated. The lowerBound is set to -inf and the upper bound to +inf C is set to Zero by default. More...
 
virtual ~GenericConstraint ()
 Destructor. Also removes from problem if still active/inserted. More...
 
virtual void print () const
 
math::Size getSize () const
 Get the size of the constraint matrix (rows,cols) More...
 
int rows () const
 Get the number of rows of the constraint matrix. More...
 
int cols () const
 Get the number of column (it should be the size of the control variable chosen) of the constraint matrix. More...
 
virtual const Eigen::VectorXd & getLowerBound () const
 Returns the lower bound from the constraint function (alias) More...
 
virtual const Eigen::VectorXd & getUpperBound () const
 Returns the upperbound from the constraint function (alias) More...
 
virtual const Eigen::MatrixXd & getConstraintMatrix () const
 Returns the constraint matrix from the constraint function (alias) More...
 
const math::ConstraintFunctiongetConstraintFunction () const
 Get the underlying constraint function containing the 2 bound vectors and the constraint matrix. More...
 
- Public Member Functions inherited from orca::common::TaskBase
 TaskBase (const std::string &name, optim::ControlVariable control_var)
 
virtual ~TaskBase ()
 
bool isActivated () const
 
bool isComputing () const
 
bool setRobotModel (robot::RobotModel::Ptr robot)
 
optim::ControlVariable getControlVariable () const
 
virtual bool activate ()
 
virtual void update (double current_time, double dt)
 
virtual bool deactivate ()
 
virtual bool setProblem (std::shared_ptr< const orca::optim::Problem > problem)
 
bool hasProblem () const
 
bool hasRobot () const
 
bool dependsOnProblem () const
 
bool dependsOnWrench () const
 
bool dependsOnRobotJoints () const
 
bool dependsOnFloatingBase () const
 
bool hasWrench () const
 
bool isRobotInitialized () const
 
State getState () const
 
void setRampDuration (double ramp_time)
 
double getRampDuration () const
 
double getCurrentRampValue () const
 
double getStartTime () const
 
double getStopTime () const
 
std::shared_ptr< const optim::ProblemgetProblem () const
 
std::shared_ptr< const common::WrenchgetWrench () const
 
std::shared_ptr< const robot::RobotModelgetRobot () const
 
void addChild (TaskBase::Ptr e)
 Add a child/slave task that will be updated BEFORE the parent task. More...
 
bool hasParent () const
 Returns true if the task owned by a parent task. More...
 
bool hasChildren () const
 Returns true if the task has children. More...
 
const std::string & getParentName () const
 Returns the parent name if it exists, empty otherwise. More...
 
const std::string & getPrintableName () const
 Returns the name that include parent name if present. More...
 
void onResizedCallback (std::function< void(void)> cb)
 
void onActivationCallback (std::function< void(void)> cb)
 
void onActivatedCallback (std::function< void(void)> cb)
 
void onComputeBeginCallback (std::function< void(double, double)> cb)
 
void onComputeEndCallback (std::function< void(double, double)> cb)
 
void onDeactivationCallback (std::function< void(void)> cb)
 
void onDeactivatedCallback (std::function< void(void)> cb)
 
- Public Member Functions inherited from orca::common::ConfigurableOrcaObject
 ConfigurableOrcaObject (const std::string &config_name)
 
virtual ~ConfigurableOrcaObject ()
 
template<class T >
void addParameter (const std::string &param_name, Parameter< T > *param, ParamPolicy policy=ParamPolicy::Required, std::function< void()> on_loading_success=0)
 Returns true if all params added with have been set. More...
 
template<class T >
void addParameter (const std::string &param_name, T &param, ParamPolicy policy=ParamPolicy::Required, std::function< void()> on_loading_success=0)
 
ParameterBasegetParameter (const std::string &param_name)
 Returns a param via its name. More...
 
void printParameters () const
 Print all parameters to std::cout. More...
 
bool configureFromFile (const std::string &yaml_url)
 Configure the task from YAML/JSON file. It must contain all the required parameters. More...
 
bool configureFromString (const std::string &yaml_str)
 Configure the task from YAML/JSON string. It must contain all the required parameters. More...
 
bool isConfigured () const
 
const ParamMapgetParameters () const
 
void onConfigureSuccess (std::function< void()> f)
 
- Public Member Functions inherited from orca::common::OrcaObject
 OrcaObject (const std::string &name)
 
virtual ~OrcaObject ()
 
const std::string & getName () const
 
void setName (const std::string &name)
 

Protected Member Functions

virtual void onUpdateConstraintFunction (double current_time, double dt)
 
virtual void onResize ()
 
- Protected Member Functions inherited from orca::constraint::GenericConstraint
virtual void onCompute (double current_time, double dt)
 
void setConstraintMatrix (const Eigen::MatrixXd &newC)
 Replace the constraint matrix with a new one. More...
 
void setLowerBound (const Eigen::VectorXd &low)
 Replace the lower bound with a new one. More...
 
void setUpperBound (const Eigen::VectorXd &up)
 Replace the upper bound with a new one. More...
 
Eigen::MatrixXd & constraintMatrix ()
 Returns a reference to the constraint matrix from the constraint function (alias) More...
 
Eigen::VectorXd & upperBound ()
 
Eigen::VectorXd & lowerBound ()
 
math::ConstraintFunctionconstraintFunction ()
 Get a reference the underlying constraint function containing the 2 bound vectors and the constraint matrix. More...
 
- Protected Member Functions inherited from orca::common::TaskBase
virtual void resize ()
 
robot::RobotModel::Ptr robot ()
 
std::shared_ptr< Wrenchwrench ()
 
virtual void onResized ()
 
virtual void onActivation ()
 
virtual void onActivated ()
 
virtual bool rampUp (double time_since_start)
 
void setRampValue (double new_val)
 
virtual bool rampDown (double time_since_stop)
 
virtual void onDeactivation ()
 
virtual void onDeactivated ()
 

Additional Inherited Members

- Public Types inherited from orca::constraint::GenericConstraint
using Ptr = std::shared_ptr< GenericConstraint >
 
- Public Types inherited from orca::common::TaskBase
enum  State {
  Init = 0, Resized, Activating, Activated,
  Deactivating, Deactivated, Error
}
 Represents the internal state of the task. More...
 
using Ptr = std::shared_ptr< TaskBase >
 
- Public Types inherited from orca::common::ConfigurableOrcaObject
using Ptr = std::shared_ptr< ConfigurableOrcaObject >
 
using ParamMap = std::map< std::string, ParameterBase * >
 
- Public Attributes inherited from orca::common::TaskBase
orca::common::MutexRecursive mutex
 The recursive mutex that is locked during the update function. It is up to the external user to lock this mutex to protect the task attributes. More...
 

Constructor & Destructor Documentation

LinearizedCoulombConstraint::LinearizedCoulombConstraint ( const std::string &  name)

Constructor Build a linear function Af+b such as Af+b<=0 is a discretized cone with numberOfFaces conservatively representing a Coulomb friction cone with friction coefficient frictionCoeff. f is supposed to represent a 3-dimensionnal force in a local frame whose z-axis is the normal vector at the contact point (so that it is the axis of the cone). b should therefore be equal to zero (which is its default value, but could have its components set to another value to account for a (possibly negative) margin.

By default, the first edge of the cone will be in the xz plane. This can however be changed by setting the static parameter ANGLE_OFFSET to a non-zero value.

Precondition
f.getSize() == 3
numberOfFaces >= 3
frictionCoeff > 0

Member Function Documentation

const Eigen::Matrix3d & LinearizedCoulombConstraint::getConeOrientation ( ) const
double LinearizedCoulombConstraint::getFrictionCoeff ( ) const
double LinearizedCoulombConstraint::getMargin ( ) const
void LinearizedCoulombConstraint::onResize ( )
protectedvirtual
void LinearizedCoulombConstraint::onUpdateConstraintFunction ( double  current_time,
double  dt 
)
protectedvirtual
void LinearizedCoulombConstraint::setAngleOffset ( double  angle_offset)
void LinearizedCoulombConstraint::setConeOrientation ( const Eigen::Matrix3d &  R)
void LinearizedCoulombConstraint::setFrictionCoeff ( double  coeff)
void LinearizedCoulombConstraint::setMargin ( double  margin)
void LinearizedCoulombConstraint::setNumberOfFaces ( int  nfaces)

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