sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
dcm-estimator.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019,
3  * LAAS-CNRS,
4  * Gepetto team
5  *
6  * This file is part of sot-talos-balance.
7  * See license file
8  */
9 
10 #ifndef __sot_talos_balance_dcm_estimator_H__
11 #define __sot_talos_balance_dcm_estimator_H__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- API ------------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 #if defined(WIN32)
18 #if defined(dcm_estimator_EXPORTS)
19 #define DCMESTIMATOR_EXPORT __declspec(dllexport)
20 #else
21 #define DCMESTIMATOR_EXPORT __declspec(dllimport)
22 #endif
23 #else
24 #define DCMESTIMATOR_EXPORT
25 #endif
26 
27 /* --------------------------------------------------------------------- */
28 /* --- INCLUDE --------------------------------------------------------- */
29 /* --------------------------------------------------------------------- */
30 
31 #include <pinocchio/fwd.hpp>
32 // include pinocchio first
33 #include <dynamic-graph/signal-helper.h>
34 
35 #include <boost/math/distributions/normal.hpp> // for normal_distribution
36 #include <map>
37 #include <sot/core/matrix-geometry.hh>
38 #include <sot/core/robot-utils.hh>
39 
40 #include "boost/assign.hpp"
41 
42 /* Pinocchio */
43 #include <pinocchio/algorithm/kinematics.hpp>
44 #include <pinocchio/multibody/model.hpp>
45 #include <pinocchio/parsers/urdf.hpp>
46 
47 namespace dynamicgraph {
48 namespace sot {
49 namespace talos_balance {
50 
51 /* --------------------------------------------------------------------- */
52 /* --- CLASS ----------------------------------------------------------- */
53 /* --------------------------------------------------------------------- */
54 
55 class DCMESTIMATOR_EXPORT DcmEstimator : public ::dynamicgraph::Entity {
56  typedef pinocchio::SE3 SE3;
57  typedef Eigen::Vector2d Vector2;
58  typedef Eigen::Vector3d Vector3;
59  typedef Eigen::Vector4d Vector4;
60  typedef Vector6d Vector6;
61  typedef Vector7d Vector7;
62  typedef Eigen::Matrix3d Matrix3;
63  typedef boost::math::normal normal;
64 
65  DYNAMIC_GRAPH_ENTITY_DECL();
66 
67  public:
68  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
69 
70  /* --- CONSTRUCTOR ---- */
71  DcmEstimator(const std::string& name);
72 
73  void init(const double& dt, const std::string& urdfFile);
74  /* --- SIGNALS --- */
75  DECLARE_SIGNAL_IN(q, dynamicgraph::Vector);
76  DECLARE_SIGNAL_IN(v, dynamicgraph::Vector);
77 
78  DECLARE_SIGNAL_OUT(c, dynamicgraph::Vector);
79  DECLARE_SIGNAL_OUT(dc, dynamicgraph::Vector);
80 
81  /* --- COMMANDS --- */
82  /* --- ENTITY INHERITANCE --- */
83  virtual void display(std::ostream& os) const;
84 
85  protected:
86  bool
88  RobotUtilShrPtr m_robot_util;
89  pinocchio::Data m_data;
90  Eigen::VectorXd
92  Eigen::VectorXd
94  double m_dt;
95  pinocchio::Model m_model;
96 
97 }; // class DCMEstimator
98 
99 } // namespace talos_balance
100 } // namespace sot
101 } // namespace dynamicgraph
102 
103 #endif // #ifndef __sot_talos_balance_dcm_estimator_H__
sot_talos_balance.test.appli_admittance_end_effector.q
list q
Definition: appli_admittance_end_effector.py:30
sot_talos_balance.test.appli_admittance_end_effector.sot
sot
Definition: appli_admittance_end_effector.py:117
dynamicgraph::sot::talos_balance::DcmEstimator::m_initSucceeded
bool m_initSucceeded
Definition: dcm-estimator.hh:87
dynamicgraph
Definition: treeview.dox:24
dynamicgraph::sot::talos_balance::math::Vector6
Eigen::Matrix< Scalar, 6, 1 > Vector6
Definition: fwd.hh:42
dynamicgraph::sot::talos_balance::DcmEstimator::m_q_pin
Eigen::VectorXd m_q_pin
Pinocchio robot data.
Definition: dcm-estimator.hh:91
dynamicgraph::sot::talos_balance::DcmEstimator::m_v_pin
Eigen::VectorXd m_v_pin
robot configuration according to pinocchio convention
Definition: dcm-estimator.hh:93
dynamicgraph::sot::talos_balance::math::Vector3
Eigen::Matrix< Scalar, 3, 1 > Vector3
Definition: fwd.hh:41
dynamicgraph::sot::talos_balance::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hh:36
sot_talos_balance.test.appli_admittance_single_joint.dt
dt
Definition: appli_admittance_single_joint.py:17
dynamicgraph::sot::talos_balance::DcmEstimator::m_dt
double m_dt
robot velocities according to pinocchio convention
Definition: dcm-estimator.hh:94
DCMESTIMATOR_EXPORT
#define DCMESTIMATOR_EXPORT
Definition: dcm-estimator.hh:24
sot_talos_balance.test.test_base_estimator.c
c
Definition: test_base_estimator.py:23
dynamicgraph::sot::talos_balance::DcmEstimator::m_model
pinocchio::Model m_model
sampling time step
Definition: dcm-estimator.hh:95
dynamicgraph::sot::talos_balance::DcmEstimator::m_robot_util
RobotUtilShrPtr m_robot_util
true if the entity has been successfully initialized
Definition: dcm-estimator.hh:88
sot_talos_balance.test.appli_dcm_zmp_control.name
name
Definition: appli_dcm_zmp_control.py:298
dynamicgraph::sot::talos_balance::DcmEstimator::m_data
pinocchio::Data m_data
Definition: dcm-estimator.hh:89
dynamicgraph::sot::talos_balance::DcmEstimator
Definition: dcm-estimator.hh:55