5 #ifndef __sot_torque_control_imu_offset_compensation_H__
6 #define __sot_torque_control_imu_offset_compensation_H__
13 #if defined(imu_offset_compensation_EXPORTS)
14 #define SOTIMUOFFSETCOMPENSATION_EXPORT __declspec(dllexport)
16 #define SOTIMUOFFSETCOMPENSATION_EXPORT __declspec(dllimport)
19 #define SOTIMUOFFSETCOMPENSATION_EXPORT
26 #include <pinocchio/fwd.hpp>
30 #include <dynamic-graph/signal-helper.h>
32 #include <boost/assign.hpp>
34 #include <sot/core/matrix-geometry.hh>
35 #include <sot/core/robot-utils.hh>
47 :
public ::dynamicgraph::Entity {
49 DYNAMIC_GRAPH_ENTITY_DECL();
50 typedef Eigen::Vector3d
Vector3;
53 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
59 void init(
const double& dt);
60 void update_offset(
const double& duration);
61 void setGyroDCBlockerParameter(
const double& alpha);
64 dynamicgraph::Vector);
67 dynamicgraph::Vector);
69 dynamicgraph::Vector);
73 virtual void display(std::ostream& os)
const;
76 void update_offset_impl(
int iter);
77 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
78 const char* file =
"",
int line = 0) {
79 logger_.stream(t) << (
"[ImuOffsetCompensation-" + name +
"] " + msg, t,
void sendMsg(const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *file="", int line=0)
DECLARE_SIGNAL_OUT(accelerometer_out, dynamicgraph::Vector)
raw gyrometer data
float m_dt
true if the entity has been successfully initialized
Vector3 m_gyro_sum
accelerometer offset
double m_a_gyro_DC_blocker
total number of update cycles to perform
DECLARE_SIGNAL_OUT(gyrometer_out, dynamicgraph::Vector)
compensated accelerometer data
DECLARE_SIGNAL_IN(gyrometer_in, dynamicgraph::Vector)
raw accelerometer data
int m_update_cycles
number of update cycles left
Vector3 m_acc_offset
gyrometer offset
int m_update_cycles_left
sampling time in seconds
DECLARE_SIGNAL_IN(accelerometer_in, dynamicgraph::Vector)
#define SOTIMUOFFSETCOMPENSATION_EXPORT
AdmittanceController EntityClassName
Eigen::Matrix< double, 3, 1 > Vector3