ocra-recipes
Doxygen documentation for the ocra-recipes repository
|
Interface for controllers. More...
#include <Controller.h>
Classes | |
struct | Pimpl |
Public Member Functions | |
virtual | ~Controller ()=0 |
void | printInfo (int level, const std::string &filename) |
void | setMaxJointTorques (const Eigen::VectorXd &tau_max) |
const Eigen::VectorXd & | getMaxJointTorques () const |
void | addTask (std::shared_ptr< Task > task) |
void | addTasks (const std::vector< std::shared_ptr< Task >> &tasks) |
void | removeTask (const std::string &taskName) |
void | removeTasks (const std::vector< std::string > tasks) |
std::vector< std::string > | getTaskNames () |
std::string | getTaskPortName (const std::string &taskName) |
std::vector< std::string > | getTaskPortNames () |
void | addContactSet (const ContactSet &contacts) |
std::shared_ptr< Task > | getTask (const std::string &name) |
const std::shared_ptr< Task > | getTask (const std::string &name) const |
const std::map< std::string, std::shared_ptr< Task > > & | getTasks () const |
void | computeOutput (Eigen::VectorXd &tau) |
Computation of output torques based on the tasks added to the controller. More... | |
const Eigen::VectorXd & | computeOutput () |
std::shared_ptr< Task > | createContactTask (const std::string &name, PointContactFeature::Ptr feature, double mu, double margin) const |
Creates a contact task. More... | |
std::shared_ptr< Task > | createTask (const std::string &name, Feature::Ptr feature, Feature::Ptr featureDes) const |
Generic task creation. More... | |
std::shared_ptr< Task > | createTask (const std::string &name, Feature::Ptr feature) const |
Public Member Functions inherited from ocra::NamedInstance | |
NamedInstance (const std::string &name) | |
const std::string & | getName () const |
virtual | ~NamedInstance () |
Protected Member Functions | |
Controller (const std::string &name, Model &model) | |
const std::vector< std::shared_ptr< Task > > & | getActiveTasks () const |
void | setErrorFlag (int eflag) |
void | setErrorMessage (const std::string &msg) |
virtual void | doComputeOutput (Eigen::VectorXd &tau)=0 |
virtual void | doAddTask (std::shared_ptr< Task > task)=0 |
virtual void | doAddContactSet (const ContactSet &contacts)=0 |
virtual void | doSetMaxJointTorques (const Eigen::VectorXd &tauMax) |
virtual std::shared_ptr< Task > | doCreateTask (const std::string &name, Feature::Ptr feature, Feature::Ptr featureDes) const =0 |
virtual std::shared_ptr< Task > | doCreateTask (const std::string &name, Feature::Ptr feature) const =0 |
virtual std::shared_ptr< Task > | doCreateContactTask (const std::string &name, PointContactFeature::Ptr feature, double mu, double margin) const =0 |
enum | ErrorFlag { SUCCESS = 0, CRITICAL_ERROR = 1, STATIC_EQ_LOSS = 2, DYN_EQ_LOSS = 4, INSTABILITY = 8 + 1, OTHER = 16 } |
Error handling. More... | |
void | enableErrorHandling () |
void | disableErrorHandling () |
bool | isErrorHandlingEnabled () const |
const std::string & | getErrorMessage () const |
void | clearErrorFlag () |
int | getErrorFlag () const |
void | setMaxJointTorqueNorm (double maxTau) |
double | getMaxJointTorqueNorm () const |
void | setFixedLinkForOdometry (std::string newFixedLink) |
void | setUseOdometry (bool useOdometry) |
void | getFixedLinkForOdometry (std::string ¤tFixedLink) |
void | setContactState (int isInLeftSupport, int isInRightSupport) |
void | getContactState (int &leftSupport, int &rightSupport) |
Interface for controllers.
This class can be derived to implement control laws for a manikin.
Definition at line 53 of file Controller.h.
Error handling.
Enumerator | |
---|---|
SUCCESS | |
CRITICAL_ERROR | |
STATIC_EQ_LOSS | |
DYN_EQ_LOSS | |
INSTABILITY | |
OTHER |
Definition at line 95 of file Controller.h.
|
protected |
Definition at line 106 of file Controller.cpp.
|
pure virtual |
Definition at line 115 of file Controller.cpp.
void ocra::Controller::addContactSet | ( | const ContactSet & | contacts | ) |
Definition at line 209 of file Controller.cpp.
void ocra::Controller::addTask | ( | std::shared_ptr< Task > | task | ) |
Definition at line 184 of file Controller.cpp.
void ocra::Controller::addTasks | ( | const std::vector< std::shared_ptr< Task >> & | tasks | ) |
Definition at line 191 of file Controller.cpp.
void ocra::Controller::clearErrorFlag | ( | ) |
Definition at line 333 of file Controller.cpp.
void ocra::Controller::computeOutput | ( | Eigen::VectorXd & | tau | ) |
Computation of output torques based on the tasks added to the controller.
Calls the method doComputeOutput, which can be overloaded to implement specific control laws to realize the added tasks.
Definition at line 258 of file Controller.cpp.
const Eigen::VectorXd & ocra::Controller::computeOutput | ( | ) |
Definition at line 252 of file Controller.cpp.
std::shared_ptr< Task > ocra::Controller::createContactTask | ( | const std::string & | name, |
PointContactFeature::Ptr | feature, | ||
double | mu, | ||
double | margin | ||
) | const |
Creates a contact task.
The parameters describe the friction cone parameters for the force applied by the manikin on the environment.
Definition at line 378 of file Controller.cpp.
std::shared_ptr< Task > ocra::Controller::createTask | ( | const std::string & | name, |
Feature::Ptr | feature, | ||
Feature::Ptr | featureDes | ||
) | const |
Generic task creation.
Definition at line 354 of file Controller.cpp.
std::shared_ptr< Task > ocra::Controller::createTask | ( | const std::string & | name, |
Feature::Ptr | feature | ||
) | const |
Definition at line 365 of file Controller.cpp.
void ocra::Controller::disableErrorHandling | ( | ) |
Definition at line 318 of file Controller.cpp.
|
protectedpure virtual |
Implemented in wocra::WocraController, gocra::GHCJTController, and hocra::HocraController.
|
protectedpure virtual |
Implemented in wocra::WocraController.
|
protectedpure virtual |
Implemented in wocra::WocraController, and gocra::GHCJTController.
|
protectedpure virtual |
Implemented in wocra::WocraController, and gocra::GHCJTController.
|
protectedpure virtual |
Implemented in wocra::WocraController, and gocra::GHCJTController.
|
protectedpure virtual |
Implemented in wocra::WocraController, and gocra::GHCJTController.
|
protectedvirtual |
Definition at line 177 of file Controller.cpp.
void ocra::Controller::enableErrorHandling | ( | ) |
Definition at line 313 of file Controller.cpp.
|
protected |
Definition at line 394 of file Controller.cpp.
void ocra::Controller::getContactState | ( | int & | leftSupport, |
int & | rightSupport | ||
) |
Definition at line 306 of file Controller.cpp.
int ocra::Controller::getErrorFlag | ( | ) | const |
Definition at line 339 of file Controller.cpp.
const std::string & ocra::Controller::getErrorMessage | ( | ) | const |
Definition at line 328 of file Controller.cpp.
|
inline |
Definition at line 115 of file Controller.h.
double ocra::Controller::getMaxJointTorqueNorm | ( | ) | const |
Definition at line 349 of file Controller.cpp.
const VectorXd & ocra::Controller::getMaxJointTorques | ( | ) | const |
Definition at line 179 of file Controller.cpp.
std::shared_ptr< Task > ocra::Controller::getTask | ( | const std::string & | name | ) |
Definition at line 214 of file Controller.cpp.
const std::shared_ptr< Task > ocra::Controller::getTask | ( | const std::string & | name | ) | const |
Definition at line 247 of file Controller.cpp.
std::vector< std::string > ocra::Controller::getTaskNames | ( | ) |
Definition at line 219 of file Controller.cpp.
std::string ocra::Controller::getTaskPortName | ( | const std::string & | taskName | ) |
Definition at line 228 of file Controller.cpp.
std::vector< std::string > ocra::Controller::getTaskPortNames | ( | ) |
Definition at line 238 of file Controller.cpp.
const std::map< std::string, std::shared_ptr< Task > > & ocra::Controller::getTasks | ( | ) | const |
Definition at line 411 of file Controller.cpp.
bool ocra::Controller::isErrorHandlingEnabled | ( | ) | const |
Definition at line 323 of file Controller.cpp.
void ocra::Controller::printInfo | ( | int | level, |
const std::string & | filename | ||
) |
Definition at line 119 of file Controller.cpp.
void ocra::Controller::removeTask | ( | const std::string & | taskName | ) |
Definition at line 197 of file Controller.cpp.
void ocra::Controller::removeTasks | ( | const std::vector< std::string > | tasks | ) |
Definition at line 203 of file Controller.cpp.
|
inline |
Definition at line 116 of file Controller.h.
|
protected |
Definition at line 401 of file Controller.cpp.
|
protected |
Definition at line 406 of file Controller.cpp.
void ocra::Controller::setFixedLinkForOdometry | ( | std::string | newFixedLink | ) |
Definition at line 300 of file Controller.cpp.
void ocra::Controller::setMaxJointTorqueNorm | ( | double | maxTau | ) |
Definition at line 344 of file Controller.cpp.
void ocra::Controller::setMaxJointTorques | ( | const Eigen::VectorXd & | tau_max | ) |
Definition at line 172 of file Controller.cpp.
|
inline |
Definition at line 114 of file Controller.h.