ORCA: Optimization-based framework for Robotic Control Applications
Public Member Functions | Public Attributes | List of all members
orca::optim::Controller Class Reference

#include <Controller.h>

+ Inheritance diagram for orca::optim::Controller:
+ Collaboration diagram for orca::optim::Controller:

Public Member Functions

 Controller (const std::string &name)
 
 Controller (const std::string &name, std::shared_ptr< robot::RobotModel > robot, ResolutionStrategy resolution_strategy, QPSolverImplType solver_type)
 
void print () const
 
void setPrintLevel (int level)
 
std::shared_ptr< robot::RobotModelrobot ()
 
void setRobotModel (std::shared_ptr< robot::RobotModel > robot)
 
bool update (double current_time, double dt)
 
common::ReturnCode getReturnCode () const
 
bool addTask (std::shared_ptr< task::GenericTask > task)
 
bool addTaskFromString (const std::string &task_description)
 
bool addConstraintFromString (const std::string &task_description)
 
template<class T >
std::shared_ptr< T > addTask (const std::string &name)
 
std::shared_ptr< task::GenericTaskgetTask (const std::string &name, int level=0)
 
std::shared_ptr< task::GenericTaskgetTask (unsigned int index, int level=0)
 
bool addConstraint (std::shared_ptr< constraint::GenericConstraint > cstr)
 
template<class C >
std::shared_ptr< C > addConstraint (const std::string &name)
 
bool solutionFound () const
 
const Eigen::VectorXd & getSolution ()
 
const Eigen::VectorXd & getJointTorqueCommand (bool remove_gravity_torques=false, bool remove_coriolis_torques=false)
 
const Eigen::VectorXd & computeKKTTorques ()
 
const Eigen::VectorXd & getJointAccelerationCommand ()
 
void activateTasksAndConstraints ()
 
void activateTasks ()
 
void activateConstraints ()
 
void deactivateTasksAndConstraints ()
 
void deactivateTasks ()
 
void deactivateConstraints ()
 
bool tasksAndConstraintsDeactivated ()
 
std::shared_ptr< task::RegularisationTask< ControlVariable::X > > globalRegularization (int level=0)
 
void setUpdateCallback (std::function< void(double, double)> update_cb)
 
void removeGravityTorquesFromSolution (bool do_remove)
 
void removeCoriolisTorquesFromSolution (bool do_remove)
 
ResolutionStrategy getResolutionStrategy () const
 
- 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)
 

Public Attributes

common::MutexRecursive mutex
 The recursive mutex to protect the update function. More...
 

Additional Inherited Members

- Public Types inherited from orca::common::ConfigurableOrcaObject
using Ptr = std::shared_ptr< ConfigurableOrcaObject >
 
using ParamMap = std::map< std::string, ParameterBase * >
 

Constructor & Destructor Documentation

Controller::Controller ( const std::string &  name)
orca::optim::Controller::Controller ( const std::string &  name,
std::shared_ptr< robot::RobotModel robot,
ResolutionStrategy  resolution_strategy,
QPSolverImplType  solver_type 
)

Member Function Documentation

void Controller::activateConstraints ( )
void Controller::activateTasks ( )
void Controller::activateTasksAndConstraints ( )
bool Controller::addConstraint ( std::shared_ptr< constraint::GenericConstraint cstr)
template<class C >
std::shared_ptr<C> orca::optim::Controller::addConstraint ( const std::string &  name)
inline
bool Controller::addConstraintFromString ( const std::string &  task_description)
bool Controller::addTask ( std::shared_ptr< task::GenericTask task)
template<class T >
std::shared_ptr<T> orca::optim::Controller::addTask ( const std::string &  name)
inline
bool Controller::addTaskFromString ( const std::string &  task_description)
const Eigen::VectorXd & Controller::computeKKTTorques ( )
void Controller::deactivateConstraints ( )
void Controller::deactivateTasks ( )
void Controller::deactivateTasksAndConstraints ( )
const Eigen::VectorXd & Controller::getJointAccelerationCommand ( )
const Eigen::VectorXd & Controller::getJointTorqueCommand ( bool  remove_gravity_torques = false,
bool  remove_coriolis_torques = false 
)
ResolutionStrategy Controller::getResolutionStrategy ( ) const
common::ReturnCode Controller::getReturnCode ( ) const
const Eigen::VectorXd & Controller::getSolution ( )
std::shared_ptr< task::GenericTask > Controller::getTask ( const std::string &  name,
int  level = 0 
)
std::shared_ptr< task::GenericTask > Controller::getTask ( unsigned int  index,
int  level = 0 
)
std::shared_ptr< task::RegularisationTask< ControlVariable::X > > Controller::globalRegularization ( int  level = 0)
void Controller::print ( ) const
void Controller::removeCoriolisTorquesFromSolution ( bool  do_remove)
void Controller::removeGravityTorquesFromSolution ( bool  do_remove)
std::shared_ptr< robot::RobotModel > Controller::robot ( )
void Controller::setPrintLevel ( int  level)
void Controller::setRobotModel ( std::shared_ptr< robot::RobotModel robot)
void Controller::setUpdateCallback ( std::function< void(double, double)>  update_cb)
bool Controller::solutionFound ( ) const
bool Controller::tasksAndConstraintsDeactivated ( )
bool Controller::update ( double  current_time,
double  dt 
)

Member Data Documentation

common::MutexRecursive orca::optim::Controller::mutex
mutable

The recursive mutex to protect the update function.


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