6 #ifndef __sot_torque_control_TorqueOffsetEstimator_H__
7 #define __sot_torque_control_TorqueOffsetEstimator_H__
13 #if defined(torque_offset_estimator_EXPORTS)
14 #define TORQUEOFFSETESTIMATOR_EXPORT __declspec(dllexport)
16 #define TORQUEOFFSETESTIMATOR_EXPORT __declspec(dllimport)
19 #define TORQUEOFFSETESTIMATOR_EXPORT
29 #include <boost/circular_buffer.hpp>
30 #include <Eigen/StdVector>
33 #include <pinocchio/multibody/model.hpp>
34 #include <pinocchio/parsers/urdf.hpp>
35 #include <pinocchio/algorithm/rnea.hpp>
36 #include <pinocchio/algorithm/kinematics.hpp>
39 #include <dynamic-graph/signal-helper.h>
40 #include <sot/core/matrix-geometry.hh>
41 #include <sot/core/robot-utils.hh>
42 #include <sot/core/stop-watch.hh>
52 DYNAMIC_GRAPH_ENTITY_DECL();
55 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57 typedef std::vector<Eigen::VectorXd, Eigen::aligned_allocator<Eigen::VectorXd> >
stdAlignedVector;
61 void init(
const std::string& urdfFile,
const Eigen::Matrix4d& _m_torso_X_imu,
const double& gyro_epsilon,
62 const std::string& ffJointName,
const std::string& torsoJointName);
63 void computeOffset(
const int& nIterations,
const double& epsilon);
65 virtual void display(std::ostream& os)
const;
67 DECLARE_SIGNAL_IN(base6d_encoders, dynamicgraph::Vector);
68 DECLARE_SIGNAL_IN(accelerometer, dynamicgraph::Vector);
69 DECLARE_SIGNAL_IN(gyroscope, dynamicgraph::Vector);
70 DECLARE_SIGNAL_IN(jointTorques, dynamicgraph::Vector);
71 DECLARE_SIGNAL_INNER(collectSensorData,
dummy);
72 DECLARE_SIGNAL_OUT(jointTorquesEstimated, dynamicgraph::Vector);
93 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
const char* =
"",
int = 0) {
94 logger_.stream(t) << (
"[" + name +
"] " + msg) <<
'\n';
98 enum { PRECOMPUTATION, INPROGRESS, COMPUTED } sensor_offset_status;
101 int current_progress;
108 #endif // #ifndef __sot_torque_control_TorqueOffsetEstimator_H__