6 #ifndef __sot_torque_control_position_controller_H__
7 #define __sot_torque_control_position_controller_H__
14 #if defined(position_controller_EXPORTS)
15 #define SOTPOSITIONCONTROLLER_EXPORT __declspec(dllexport)
17 #define SOTPOSITIONCONTROLLER_EXPORT __declspec(dllimport)
20 #define SOTPOSITIONCONTROLLER_EXPORT
27 #include <pinocchio/fwd.hpp>
31 #include <dynamic-graph/signal-helper.h>
33 #include <boost/assign.hpp>
35 #include <sot/core/matrix-geometry.hh>
36 #include <sot/core/robot-utils.hh>
48 :
public ::dynamicgraph::Entity {
50 DYNAMIC_GRAPH_ENTITY_DECL();
53 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
58 void init(
const double& dt,
const std::string& robotRef);
63 DECLARE_SIGNAL_IN(base6d_encoders, dynamicgraph::Vector);
64 DECLARE_SIGNAL_IN(jointsVelocities, dynamicgraph::Vector);
65 DECLARE_SIGNAL_IN(qRef, dynamicgraph::Vector);
66 DECLARE_SIGNAL_IN(dqRef, dynamicgraph::Vector);
67 DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector);
68 DECLARE_SIGNAL_IN(Kd, dynamicgraph::Vector);
69 DECLARE_SIGNAL_IN(Ki, dynamicgraph::Vector);
71 DECLARE_SIGNAL_OUT(pwmDes,
72 dynamicgraph::Vector);
74 DECLARE_SIGNAL_OUT(qError, dynamicgraph::Vector);
78 virtual void display(std::ostream& os)
const;
80 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
81 const char* =
"",
int = 0) {
82 logger_.stream(t) << (
"[PositionController-" + name +
"] " + msg) <<
'\n';
95 Eigen::VectorXd
m_q, m_dq;
103 #endif // #ifndef __sot_torque_control_position_controller_H__