6 #ifndef __sot_torque_control_current_controller_H__
7 #define __sot_torque_control_current_controller_H__
14 #if defined(__sot_torque_control_current_controller_H__)
15 #define SOTCURRENTCONTROLLER_EXPORT __declspec(dllexport)
17 #define SOTCURRENTCONTROLLER_EXPORT __declspec(dllimport)
20 #define SOTCURRENTCONTROLLER_EXPORT
27 #include <pinocchio/fwd.hpp>
31 #include <dynamic-graph/signal-helper.h>
34 #include <pinocchio/multibody/model.hpp>
35 #include <pinocchio/parsers/urdf.hpp>
36 #include <sot/core/matrix-geometry.hh>
37 #include <sot/core/robot-utils.hh>
39 #include <tsid/robots/robot-wrapper.hpp>
41 #include "boost/assign.hpp"
52 :
public ::dynamicgraph::Entity {
54 DYNAMIC_GRAPH_ENTITY_DECL();
65 void init(
const double& dt,
const std::string& robotRef,
66 const unsigned int& currentOffsetIters);
69 DECLARE_SIGNAL_IN(i_des, dynamicgraph::Vector);
70 DECLARE_SIGNAL_IN(i_measured, dynamicgraph::Vector);
71 DECLARE_SIGNAL_IN(i_sens_gains,
72 dynamicgraph::Vector);
74 kp_current, dynamicgraph::Vector);
76 ki_current, dynamicgraph::Vector);
79 i_max, dynamicgraph::Vector);
83 dynamicgraph::Vector);
84 DECLARE_SIGNAL_IN(u_saturation,
86 dynamicgraph::Vector);
91 dynamicgraph::Vector);
93 dq, dynamicgraph::Vector);
97 dynamicgraph::Vector);
101 percentage_bemf_compensation,
102 dynamicgraph::Vector);
106 dynamicgraph::Vector);
108 percentage_dead_zone_compensation,
109 dynamicgraph::Vector);
113 i_max_dead_zone_compensation,
114 dynamicgraph::Vector);
115 DECLARE_SIGNAL_IN(i_sensor_offsets_low_level,
117 dynamicgraph::Vector);
120 i_sensor_offsets_real_in,
121 dynamicgraph::Vector);
123 DECLARE_SIGNAL_OUT(u, dynamicgraph::Vector);
126 dynamicgraph::Vector);
127 DECLARE_SIGNAL_OUT(i_real,
128 dynamicgraph::Vector);
132 dynamicgraph::Vector);
134 i_sensor_offsets_real_out,
135 dynamicgraph::Vector);
136 DECLARE_SIGNAL_OUT(dead_zone_compensation,
137 dynamicgraph::Vector);
138 DECLARE_SIGNAL_OUT(i_errors,
140 dynamicgraph::Vector);
143 dynamicgraph::Vector);
147 void reset_integral();
150 virtual void display(std::ostream& os)
const;
152 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
153 const char* =
"",
int = 0) {
154 logger_.stream(t) << (
"[CurrentController-" + name +
"] " + msg) <<
'\n';
183 #endif // #ifndef __sot_torque_control_current_controller_H__