17 #ifndef __sot_torque_control_parameter_server_H__
18 #define __sot_torque_control_parameter_server_H__
25 #if defined(__sot_torque_parameter_server_H__)
26 #define SOTParameterServer_EXPORT __declspec(dllexport)
28 #define SOTParameterServer_EXPORT __declspec(dllimport)
31 #define SOTParameterServer_EXPORT
38 #include <dynamic-graph/signal-helper.h>
44 #include "boost/assign.hpp"
54 #define CTRL_MODE_TRANSITION_TIME_STEP 1000.0
57 :
public ::dynamicgraph::Entity {
59 DYNAMIC_GRAPH_ENTITY_DECL();
70 void init(
const double &dt,
const std::string &urdfFile,
71 const std::string &robotRef);
83 void setNameToId(
const std::string &jointName,
const double &jointId);
89 const dynamicgraph::Vector &lq,
90 const dynamicgraph::Vector &uq);
92 const double &forceId);
105 template <
typename Type>
107 const Type &ParameterValue) {
108 if (!m_initSucceeded) {
109 DYNAMIC_GRAPH_ENTITY_WARNING(*
this)
110 <<
"Cannot set parameter " << ParameterName <<
" to "
111 << ParameterValue <<
" before initialization!\n";
115 m_robot_util->set_parameter<Type>(ParameterName, ParameterValue);
118 template <
typename Type>
120 if (!m_initSucceeded) {
121 DYNAMIC_GRAPH_ENTITY_WARNING(*
this)
122 <<
"Cannot get parameter " << ParameterName
123 <<
" before initialization!\n";
124 throw std::runtime_error(
"Cannot get parameter before initialization");
126 return m_robot_util->get_parameter<Type>(ParameterName);
Definition: parameter-server.hh:57
void setFootFrameName(const std::string &, const std::string &)
virtual void display(std::ostream &os) const
void setRightFootSoleXYZ(const dynamicgraph::Vector &)
void setImuJointName(const std::string &)
void init_simple(const double &dt)
void setParameter(const std::string &ParameterName, const Type &ParameterValue)
Definition: parameter-server.hh:106
void setJoints(const dynamicgraph::Vector &)
double m_dt
true if the entity has been successfully initialized
Definition: parameter-server.hh:140
void setHandFrameName(const std::string &, const std::string &)
void updateJointCtrlModesOutputSignal()
Type getParameter(const std::string &ParameterName)
Definition: parameter-server.hh:119
bool m_initSucceeded
Definition: parameter-server.hh:139
double m_sleep_time
Definition: parameter-server.hh:146
void setForceLimitsFromId(const double &jointId, const dynamicgraph::Vector &lq, const dynamicgraph::Vector &uq)
Command related to ForceUtil.
bool convertJointNameToJointId(const std::string &name, unsigned int &id)
bool isJointInRange(unsigned int id, double q)
~ParameterServer()
Definition: parameter-server.hh:65
RobotUtilShrPtr m_robot_util
Definition: parameter-server.hh:137
bool m_is_first_iter
Definition: parameter-server.hh:144
int m_iter
true at the first iteration, false otherwise
Definition: parameter-server.hh:145
void init(const double &dt, const std::string &urdfFile, const std::string &robotRef)
void setForceNameToForceId(const std::string &forceName, const double &forceId)
void setJointLimitsFromId(const double &jointId, const double &lq, const double &uq)
bool m_emergency_stop_triggered
control loop time period
Definition: parameter-server.hh:141
void setRightFootForceSensorXYZ(const dynamicgraph::Vector &)
void setNameToId(const std::string &jointName, const double &jointId)
Commands related to joint name and joint id.
ParameterServer(const std::string &name)
std::shared_ptr< RobotUtil > RobotUtilShrPtr
Accessors - This should be changed to RobotUtilPtrShared.
Definition: robot-utils.hh:299
Definition: abstract-sot-external-interface.hh:17
#define SOTParameterServer_EXPORT
Definition: parameter-server.hh:31