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 27 #include "boost/assign.hpp" 29 #include <dynamic-graph/signal-helper.h> 30 #include <sot/core/matrix-geometry.hh> 31 #include <sot/core/robot-utils.hh> 44 DYNAMIC_GRAPH_ENTITY_DECL();
45 typedef Eigen::Vector3d
Vector3;
48 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
54 void init(
const double& dt);
55 void update_offset(
const double& duration);
56 void setGyroDCBlockerParameter(
const double& alpha);
58 DECLARE_SIGNAL_IN(accelerometer_in, dynamicgraph::Vector);
59 DECLARE_SIGNAL_IN(gyrometer_in, dynamicgraph::Vector);
60 DECLARE_SIGNAL_OUT(accelerometer_out, dynamicgraph::Vector);
61 DECLARE_SIGNAL_OUT(gyrometer_out, dynamicgraph::Vector);
65 virtual void display(std::ostream& os)
const;
68 void update_offset_impl(
int iter);
69 void sendMsg(
const std::string& msg, MsgType t = MSG_TYPE_INFO,
const char* file =
"",
int line = 0) {
70 logger_.stream(t) << (
"[ImuOffsetCompensation-" + name +
"] " + msg, t, file, line);
79 Vector3 m_gyro_offset;
91 #endif // #ifndef __sot_torque_control_imu_offset_compensation_H__ double m_a_gyro_DC_blocker
total number of update cycles to perform
#define SOTIMUOFFSETCOMPENSATION_EXPORT
Vector3 m_gyro_sum
accelerometer offset
Eigen::Matrix< double, 3, 1 > Vector3
int m_update_cycles
number of update cycles left
void sendMsg(const std::string &msg, MsgType t=MSG_TYPE_INFO, const char *file="", int line=0)
AdmittanceController EntityClassName
float m_dt
true if the entity has been successfully initialized
Vector3 m_acc_offset
gyrometer offset
Vector3 m_acc_sum
tmp variable to store the sum of the gyro measurements during update phase
int m_update_cycles_left
sampling time in seconds