6 #ifndef __sot_torque_control_JointTorqueController_H__ 7 #define __sot_torque_control_JointTorqueController_H__ 13 #if defined(joint_torque_controller_EXPORTS) 14 #define SOTJOINTTORQUECONTROLLER_EXPORT __declspec(dllexport) 16 #define SOTJOINTTORQUECONTROLLER_EXPORT __declspec(dllimport) 19 #define SOTJOINTTORQUECONTROLLER_EXPORT 29 #include <pinocchio/fwd.hpp> 31 #include <tsid/utils/stop-watch.hpp> 33 #include <dynamic-graph/signal-helper.h> 34 #include <sot/core/matrix-geometry.hh> 35 #include <sot/core/robot-utils.hh> 68 DYNAMIC_GRAPH_ENTITY_DECL();
71 DECLARE_SIGNAL_IN(jointsPositions, dynamicgraph::Vector);
72 DECLARE_SIGNAL_IN(jointsVelocities, dynamicgraph::Vector);
73 DECLARE_SIGNAL_IN(jointsAccelerations, dynamicgraph::Vector);
74 DECLARE_SIGNAL_IN(jointsTorques, dynamicgraph::Vector);
75 DECLARE_SIGNAL_IN(jointsTorquesDerivative, dynamicgraph::Vector);
76 DECLARE_SIGNAL_IN(jointsTorquesDesired, dynamicgraph::Vector);
79 DECLARE_SIGNAL_IN(dq_des, dynamicgraph::Vector);
80 DECLARE_SIGNAL_IN(KpTorque, dynamicgraph::Vector);
81 DECLARE_SIGNAL_IN(KiTorque, dynamicgraph::Vector);
82 DECLARE_SIGNAL_IN(KdTorque, dynamicgraph::Vector);
83 DECLARE_SIGNAL_IN(KdVel, dynamicgraph::Vector);
84 DECLARE_SIGNAL_IN(KiVel, dynamicgraph::Vector);
85 DECLARE_SIGNAL_IN(torque_integral_saturation, dynamicgraph::Vector);
91 DECLARE_SIGNAL_IN(coulomb_friction_compensation_percentage, dynamicgraph::Vector);
92 DECLARE_SIGNAL_IN(motorParameterKt_p, dynamicgraph::Vector);
93 DECLARE_SIGNAL_IN(motorParameterKt_n, dynamicgraph::Vector);
94 DECLARE_SIGNAL_IN(motorParameterKf_p, dynamicgraph::Vector);
95 DECLARE_SIGNAL_IN(motorParameterKf_n, dynamicgraph::Vector);
96 DECLARE_SIGNAL_IN(motorParameterKv_p, dynamicgraph::Vector);
97 DECLARE_SIGNAL_IN(motorParameterKv_n, dynamicgraph::Vector);
98 DECLARE_SIGNAL_IN(motorParameterKa_p, dynamicgraph::Vector);
99 DECLARE_SIGNAL_IN(motorParameterKa_n, dynamicgraph::Vector);
100 DECLARE_SIGNAL_IN(polySignDq, dynamicgraph::Vector);
102 DECLARE_SIGNAL_OUT(u, dynamicgraph::Vector);
103 DECLARE_SIGNAL_OUT(smoothSignDq, dynamicgraph::Vector);
104 DECLARE_SIGNAL_OUT(torque_error_integral, dynamicgraph::Vector);
118 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
const char* =
"",
int = 0) {
119 logger_.stream(t) << (
"[" + name +
"] " + msg) <<
'\n';
123 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
131 void init(
const double& timestep,
const std::string& robotRef);
133 void reset_integral();
136 virtual void display(std::ostream& os)
const;
144 #endif // #ifndef __sot_torque_control_JointTorqueController_H__
RobotUtilShrPtr m_robot_util
integral of the velocity error
Eigen::VectorXd m_tauErrIntegral
Eigen::VectorXd m_dqErrIntegral
integral of the current error
void sendMsg(const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0)
Eigen::VectorXd m_currentErrIntegral
integral of the torque error
#define SOTJOINTTORQUECONTROLLER_EXPORT
MotorModel motorModel
integral of the torque tracking error
Eigen::VectorXd m_tau_star
timestep of the controller
Eigen::VectorXd m_current_des