#include <sot/talos_balance/talos-control-manager.hh>
Public Member Functions | |
TalosControlManager (const std::string &name) | |
void | addCtrlMode (const std::string &name) |
safe motor control More... | |
void | addEmergencyStopSIN (const std::string &name) |
void | ctrlModes () |
DECLARE_SIGNAL_IN (u_max, dynamicgraph::Vector) | |
DECLARE_SIGNAL_OUT (u, dynamicgraph::Vector) | |
max motor control More... | |
DECLARE_SIGNAL_OUT (u_safe, dynamicgraph::Vector) | |
raw motor control More... | |
virtual void | display (std::ostream &os) const |
void | getCtrlMode (const std::string &jointName) |
void | init (const double &dt, const std::string &robotRef) |
void | resetProfiler () |
void | setCtrlMode (const std::string &jointName, const std::string &ctrlMode) |
void | setCtrlMode (const int jid, const CtrlMode &cm) |
void | setSleepTime (const double &seconds) |
Commands related to joint name and joint id. More... | |
Public Attributes | |
std::vector< dynamicgraph::SignalPtr< dynamicgraph::Vector, int > * > | m_ctrlInputsSIN |
std::vector< dynamicgraph::SignalPtr< bool, int > *> | m_emergencyStopVector |
std::vector< dynamicgraph::Signal< dynamicgraph::Vector, int > * > | m_jointsCtrlModesSOUT |
emergency stop inputs. If one is true, control is set to zero forever More... | |
Protected Member Functions | |
bool | convertJointNameToJointId (const std::string &name, unsigned int &id) |
bool | convertStringToCtrlMode (const std::string &name, CtrlMode &cm) |
counters used for the transition between two ctrl modes More... | |
void | updateJointCtrlModesOutputSignal () |
Protected Attributes | |
std::vector< std::string > | m_ctrlModes |
time to sleep at every iteration (to slow down simulation) More... | |
double | m_dt |
true if the entity has been successfully initialized More... | |
bool | m_emergency_stop_triggered |
control loop time period More... | |
bool | m_initSucceeded |
bool | m_is_first_iter |
true if an emergency condition as been triggered either by an other entity, or by control limit violation More... | |
int | m_iter |
true at the first iteration, false otherwise More... | |
std::vector< CtrlMode > | m_jointCtrlModes_current |
existing control modes More... | |
std::vector< CtrlMode > | m_jointCtrlModes_previous |
control mode of the joints More... | |
std::vector< int > | m_jointCtrlModesCountDown |
previous control mode of the joints More... | |
size_t | m_numDofs |
RobotUtilShrPtr | m_robot_util |
double | m_sleep_time |
Definition at line 73 of file talos-control-manager.hh.
TalosControlManager | ( | const std::string & | name | ) |
Definition at line 60 of file talos-control-manager.cpp.
References TalosControlManager::addCtrlMode(), TalosControlManager::addEmergencyStopSIN(), TalosControlManager::ctrlModes(), TalosControlManager::getCtrlMode(), TalosControlManager::init(), INPUT_SIGNALS, TalosControlManager::m_emergency_stop_triggered, OUTPUT_SIGNALS, TalosControlManager::resetProfiler(), and TalosControlManager::setCtrlMode().
void addCtrlMode | ( | const std::string & | name | ) |
safe motor control
Commands related to the control mode.
Definition at line 258 of file talos-control-manager.cpp.
References TalosControlManager::m_ctrlInputsSIN, TalosControlManager::m_ctrlModes, TalosControlManager::m_jointsCtrlModesSOUT, and TalosControlManager::updateJointCtrlModesOutputSignal().
Referenced by TalosControlManager::TalosControlManager().
void addEmergencyStopSIN | ( | const std::string & | name | ) |
Definition at line 382 of file talos-control-manager.cpp.
References TalosControlManager::m_emergencyStopVector.
Referenced by TalosControlManager::TalosControlManager().
|
protected |
Definition at line 436 of file talos-control-manager.cpp.
References TalosControlManager::m_numDofs, and TalosControlManager::m_robot_util.
Referenced by TalosControlManager::getCtrlMode(), and TalosControlManager::setCtrlMode().
|
protected |
counters used for the transition between two ctrl modes
Definition at line 422 of file talos-control-manager.cpp.
References TalosControlManager::m_ctrlModes.
Referenced by TalosControlManager::setCtrlMode().
void ctrlModes | ( | ) |
Definition at line 286 of file talos-control-manager.cpp.
References TalosControlManager::m_ctrlModes.
Referenced by TalosControlManager::TalosControlManager().
DECLARE_SIGNAL_IN | ( | u_max | , |
dynamicgraph::Vector | |||
) |
DECLARE_SIGNAL_OUT | ( | u | , |
dynamicgraph::Vector | |||
) |
max motor control
DECLARE_SIGNAL_OUT | ( | u_safe | , |
dynamicgraph::Vector | |||
) |
raw motor control
|
virtual |
Definition at line 481 of file talos-control-manager.cpp.
void getCtrlMode | ( | const std::string & | jointName | ) |
Definition at line 347 of file talos-control-manager.cpp.
References TalosControlManager::convertJointNameToJointId(), TalosControlManager::m_jointCtrlModes_current, and TalosControlManager::m_numDofs.
Referenced by TalosControlManager::TalosControlManager().
void init | ( | const double & | dt, |
const std::string & | robotRef | ||
) |
Initialize
dt | control interval |
urdfFile | path to the URDF model of the robot |
Definition at line 112 of file talos-control-manager.cpp.
References TalosControlManager::m_dt, TalosControlManager::m_emergency_stop_triggered, TalosControlManager::m_initSucceeded, TalosControlManager::m_jointCtrlModes_current, TalosControlManager::m_jointCtrlModes_previous, TalosControlManager::m_jointCtrlModesCountDown, TalosControlManager::m_numDofs, and TalosControlManager::m_robot_util.
Referenced by TalosControlManager::TalosControlManager().
void resetProfiler | ( | ) |
Definition at line 364 of file talos-control-manager.cpp.
References getStatistics(), and Statistics::reset_all().
Referenced by TalosControlManager::TalosControlManager().
void setCtrlMode | ( | const std::string & | jointName, |
const std::string & | ctrlMode | ||
) |
Definition at line 292 of file talos-control-manager.cpp.
References TalosControlManager::convertJointNameToJointId(), TalosControlManager::convertStringToCtrlMode(), TalosControlManager::m_numDofs, and TalosControlManager::updateJointCtrlModesOutputSignal().
Referenced by TalosControlManager::TalosControlManager().
void setCtrlMode | ( | const int | jid, |
const CtrlMode & | cm | ||
) |
Definition at line 322 of file talos-control-manager.cpp.
References CTRL_MODE_TRANSITION_TIME_STEP, CtrlMode::id, TalosControlManager::m_jointCtrlModes_current, TalosControlManager::m_jointCtrlModes_previous, and TalosControlManager::m_jointCtrlModesCountDown.
void setSleepTime | ( | const double & | seconds | ) |
Commands related to joint name and joint id.
Set the mapping between urdf and sot.
Definition at line 375 of file talos-control-manager.cpp.
References TalosControlManager::m_sleep_time.
|
protected |
Definition at line 396 of file talos-control-manager.cpp.
References TalosControlManager::m_jointCtrlModes_current, TalosControlManager::m_jointCtrlModes_previous, TalosControlManager::m_jointCtrlModesCountDown, TalosControlManager::m_jointsCtrlModesSOUT, and TalosControlManager::m_numDofs.
Referenced by TalosControlManager::addCtrlMode(), dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), and TalosControlManager::setCtrlMode().
std::vector<dynamicgraph::SignalPtr<dynamicgraph::Vector,int>*> m_ctrlInputsSIN |
Definition at line 91 of file talos-control-manager.hh.
Referenced by TalosControlManager::addCtrlMode(), and dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION().
|
protected |
time to sleep at every iteration (to slow down simulation)
Definition at line 135 of file talos-control-manager.hh.
Referenced by TalosControlManager::addCtrlMode(), TalosControlManager::convertStringToCtrlMode(), and TalosControlManager::ctrlModes().
|
protected |
true if the entity has been successfully initialized
Definition at line 129 of file talos-control-manager.hh.
Referenced by TalosControlManager::init().
|
protected |
control loop time period
Definition at line 130 of file talos-control-manager.hh.
Referenced by dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), TalosControlManager::init(), and TalosControlManager::TalosControlManager().
std::vector< dynamicgraph::SignalPtr<bool,int>* > m_emergencyStopVector |
Definition at line 92 of file talos-control-manager.hh.
Referenced by TalosControlManager::addEmergencyStopSIN(), and dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION().
|
protected |
Definition at line 128 of file talos-control-manager.hh.
Referenced by dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), and TalosControlManager::init().
|
protected |
true if an emergency condition as been triggered either by an other entity, or by control limit violation
Definition at line 131 of file talos-control-manager.hh.
Referenced by dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION().
|
protected |
true at the first iteration, false otherwise
Definition at line 132 of file talos-control-manager.hh.
|
protected |
existing control modes
Definition at line 136 of file talos-control-manager.hh.
Referenced by dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), TalosControlManager::getCtrlMode(), TalosControlManager::init(), TalosControlManager::setCtrlMode(), and TalosControlManager::updateJointCtrlModesOutputSignal().
|
protected |
control mode of the joints
Definition at line 137 of file talos-control-manager.hh.
Referenced by dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), TalosControlManager::init(), TalosControlManager::setCtrlMode(), and TalosControlManager::updateJointCtrlModesOutputSignal().
|
protected |
previous control mode of the joints
Definition at line 138 of file talos-control-manager.hh.
Referenced by dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), TalosControlManager::init(), TalosControlManager::setCtrlMode(), and TalosControlManager::updateJointCtrlModesOutputSignal().
std::vector<dynamicgraph::Signal<dynamicgraph::Vector,int>*> m_jointsCtrlModesSOUT |
emergency stop inputs. If one is true, control is set to zero forever
Definition at line 93 of file talos-control-manager.hh.
Referenced by TalosControlManager::addCtrlMode(), and TalosControlManager::updateJointCtrlModesOutputSignal().
|
protected |
Definition at line 127 of file talos-control-manager.hh.
Referenced by TalosControlManager::convertJointNameToJointId(), dynamicgraph::sot::talos_balance::DEFINE_SIGNAL_OUT_FUNCTION(), TalosControlManager::getCtrlMode(), TalosControlManager::init(), TalosControlManager::setCtrlMode(), and TalosControlManager::updateJointCtrlModesOutputSignal().
|
protected |
Definition at line 126 of file talos-control-manager.hh.
Referenced by TalosControlManager::convertJointNameToJointId(), and TalosControlManager::init().
|
protected |
Definition at line 133 of file talos-control-manager.hh.
Referenced by TalosControlManager::setSleepTime().