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>
30 #include <tsid/utils/stop-watch.hpp>
32 #include <dynamic-graph/signal-helper.h>
34 #include <sot/core/matrix-geometry.hh>
35 #include <sot/core/robot-utils.hh>
68 :
public ::dynamicgraph::Entity {
69 DYNAMIC_GRAPH_ENTITY_DECL();
76 dynamicgraph::Vector);
78 jointsTorquesDerivative,
79 dynamicgraph::Vector);
81 dynamicgraph::Vector);
86 dynamicgraph::Vector);
90 dynamicgraph::Vector);
93 dynamicgraph::Vector);
95 KdVel, dynamicgraph::Vector);
97 KiVel, dynamicgraph::Vector);
99 dynamicgraph::Vector);
107 dynamicgraph::Vector);
120 smoothSignDq, dynamicgraph::Vector);
122 torque_error_integral,
123 dynamicgraph::Vector);
138 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
139 const char* =
"",
int = 0) {
140 logger_.stream(t) << (
"[" + name +
"] " + msg) <<
'\n';
144 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
153 void init(
const double& timestep,
const std::string& robotRef);
155 void reset_integral();
158 virtual void display(std::ostream& os)
const;
void sendMsg(const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0)
DECLARE_SIGNAL_IN(motorParameterKf_p, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(KpTorque, dynamicgraph::Vector)
desired joint velocities
Eigen::VectorXd m_current_des
DECLARE_SIGNAL_IN(coulomb_friction_compensation_percentage, dynamicgraph::Vector)
integral error saturation
DECLARE_SIGNAL_IN(motorParameterKv_p, dynamicgraph::Vector)
RobotUtilShrPtr m_robot_util
integral of the velocity error
Eigen::VectorXd m_currentErrIntegral
integral of the torque error
DECLARE_SIGNAL_OUT(u, dynamicgraph::Vector)
MotorModel motorModel
integral of the torque tracking error
DECLARE_SIGNAL_IN(KdTorque, dynamicgraph::Vector)
integral gain for torque feedback controller
DECLARE_SIGNAL_IN(motorParameterKt_p, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(jointsVelocities, dynamicgraph::Vector)
q
DECLARE_SIGNAL_OUT(torque_error_integral, dynamicgraph::Vector)
smooth approximation of sign(dq)
DECLARE_SIGNAL_IN(jointsTorquesDesired, dynamicgraph::Vector)
estimated joints torques derivative dtau
DECLARE_SIGNAL_IN(motorParameterKa_n, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(jointsTorques, dynamicgraph::Vector)
ddq
DECLARE_SIGNAL_IN(jointsTorquesDerivative, dynamicgraph::Vector)
estimated joints torques tau
DECLARE_SIGNAL_IN(jointsAccelerations, dynamicgraph::Vector)
dq
DECLARE_SIGNAL_IN(KdVel, dynamicgraph::Vector)
derivative gain for torque feedback controller
Eigen::VectorXd m_dqErrIntegral
integral of the current error
DECLARE_SIGNAL_IN(motorParameterKt_n, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(KiVel, dynamicgraph::Vector)
derivative gain for velocity feedback
DECLARE_SIGNAL_IN(motorParameterKf_n, dynamicgraph::Vector)
Eigen::VectorXd m_tauErrIntegral
DECLARE_SIGNAL_IN(dq_des, dynamicgraph::Vector)
desired joints torques tauDes
DECLARE_SIGNAL_IN(KiTorque, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(torque_integral_saturation, dynamicgraph::Vector)
integral gain for velocity feedback
Eigen::VectorXd m_tau_star
timestep of the controller
DECLARE_SIGNAL_IN(motorParameterKv_n, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(motorParameterKa_p, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(polySignDq, dynamicgraph::Vector)
DECLARE_SIGNAL_OUT(smoothSignDq, dynamicgraph::Vector)
Desired current.
DECLARE_SIGNAL_IN(jointsPositions, dynamicgraph::Vector)
#define SOTJOINTTORQUECONTROLLER_EXPORT