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 <Eigen/StdVector> 30 #include <boost/circular_buffer.hpp> 33 #include <pinocchio/algorithm/kinematics.hpp> 34 #include <pinocchio/algorithm/rnea.hpp> 35 #include <pinocchio/multibody/model.hpp> 36 #include <pinocchio/parsers/urdf.hpp> 39 #include <dynamic-graph/signal-helper.h> 41 #include <sot/core/matrix-geometry.hh> 42 #include <sot/core/robot-utils.hh> 43 #include <sot/core/stop-watch.hh> 53 :
public ::dynamicgraph::Entity {
54 DYNAMIC_GRAPH_ENTITY_DECL();
57 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
59 typedef std::vector<Eigen::VectorXd,
60 Eigen::aligned_allocator<Eigen::VectorXd> >
65 void init(
const std::string& urdfFile,
const Eigen::Matrix4d& _m_torso_X_imu,
66 const double& gyro_epsilon,
const std::string& ffJointName,
67 const std::string& torsoJointName);
68 void computeOffset(
const int& nIterations,
const double& epsilon);
70 virtual void display(std::ostream& os)
const;
72 DECLARE_SIGNAL_IN(base6d_encoders, dynamicgraph::Vector);
73 DECLARE_SIGNAL_IN(accelerometer, dynamicgraph::Vector);
74 DECLARE_SIGNAL_IN(gyroscope, dynamicgraph::Vector);
75 DECLARE_SIGNAL_IN(jointTorques, dynamicgraph::Vector);
76 DECLARE_SIGNAL_INNER(collectSensorData,
dummy);
77 DECLARE_SIGNAL_OUT(jointTorquesEstimated, dynamicgraph::Vector);
87 pinocchio::JointIndex ffIndex,
99 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
100 const char* =
"",
int = 0) {
101 logger_.stream(t) << (
"[" + name +
"] " + msg) <<
'\n';
105 enum { PRECOMPUTATION, INPROGRESS, COMPUTED } sensor_offset_status;
108 int current_progress;
115 #endif // #ifndef __sot_torque_control_TorqueOffsetEstimator_H__ pinocchio::SE3 m_torso_X_imu
pinocchio::Data * m_data
Pinocchio robot model.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef int dummy
RobotUtilShrPtr m_robot_util
void sendMsg(const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *="", int=0)
Eigen::VectorXd jointTorqueOffsets
pinocchio::JointIndex torsoIndex
int n_iterations
Pinocchio robot data.
std::vector< Eigen::VectorXd, Eigen::aligned_allocator< Eigen::VectorXd > > stdAlignedVector
#define TORQUEOFFSETESTIMATOR_EXPORT