19 #include <sot/core/debug.hh> 20 #include <dynamic-graph/factory.h> 21 #include <dynamic-graph/command-bind.h> 23 #include <dynamic-graph/all-commands.h> 24 #include <sot/core/stop-watch.hh> 30 namespace talos_balance
32 namespace dg = ::dynamicgraph;
37 #define PROFILE_STATETRANSFORMATION_Q_COMPUTATION "State transformation q computation " 38 #define PROFILE_STATETRANSFORMATION_V_COMPUTATION "State transformation v computation " 40 #define INPUT_SIGNALS m_referenceFrameSIN << m_q_inSIN << m_v_inSIN 42 #define OUTPUT_SIGNALS m_qSOUT << m_vSOUT 50 "StateTransformation");
57 , CONSTRUCT_SIGNAL_IN(referenceFrame, MatrixHomogeneous)
62 , m_initSucceeded(false)
83 const MatrixHomogeneous & referenceFrame = m_referenceFrameSIN(iter);
88 const Eigen::Vector3d & euler = input.segment<3>(3);
90 const double roll = euler[0];
91 const double pitch = euler[1];
92 const double yaw = euler[2];
94 Eigen::Quaterniond quat;
95 quat = Eigen::AngleAxisd(yaw, Eigen::Vector3d::UnitZ())
96 * Eigen::AngleAxisd(pitch, Eigen::Vector3d::UnitY())
97 * Eigen::AngleAxisd(roll, Eigen::Vector3d::UnitX());
100 M.linear() = quat.toRotationMatrix();
101 M.translation() = input.head<3>();
104 MatrixHomogeneous res = referenceFrame*M;
107 size_t sz = input.size();
110 s.head<3>() = res.translation();
112 s.segment<3>(3) = res.linear().eulerAngles(2, 1, 0).reverse();
115 s.tail(sz-6) = input.tail(sz-6);
126 const MatrixHomogeneous & referenceFrame = m_referenceFrameSIN(iter);
132 size_t sz = input.size();
135 s.head<3>() = referenceFrame.linear() * input.head<3>();
137 s.segment<3>(3) = referenceFrame.linear() * input.segment<3>(3);
140 s.tail(sz-6) = input.tail(sz-6);
155 os <<
"StateTransformation " << getName();
158 getProfiler().report_all(3, os);
160 catch (ExceptionSignal e) {}
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
AdmittanceControllerEndEffector EntityClassName
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(AdmittanceControllerEndEffector, "AdmittanceControllerEndEffector")
DEFINE_SIGNAL_OUT_FUNCTION(dq, dynamicgraph::Vector)