sot-talos-balance  1.6.0
simple-zmp-estimator.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018, Gepetto team, LAAS-CNRS
3  *
4  * This file is part of sot-talos-balance.
5  * sot-talos-balance is free software: you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation, either version 3 of
8  * the License, or (at your option) any later version.
9  * sot-talos-balance is distributed in the hope that it will be
10  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details. You should
13  * have received a copy of the GNU Lesser General Public License along
14  * with sot-talos-balance. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __sot_talos_balance_simple_zmp_estimator_H__
18 #define __sot_talos_balance_simple_zmp_estimator_H__
19 
20 /* --------------------------------------------------------------------- */
21 /* --- API ------------------------------------------------------------- */
22 /* --------------------------------------------------------------------- */
23 
24 #if defined (WIN32)
25 # if defined (simple_zmp_estimator_EXPORTS)
26 # define SIMPLEZMPESTIMATOR_EXPORT __declspec(dllexport)
27 # else
28 # define SIMPLEZMPESTIMATOR_EXPORT __declspec(dllimport)
29 # endif
30 #else
31 # define SIMPLEZMPESTIMATOR_EXPORT
32 #endif
33 
34 
35 /* --------------------------------------------------------------------- */
36 /* --- INCLUDE --------------------------------------------------------- */
37 /* --------------------------------------------------------------------- */
38 
39 #include <dynamic-graph/signal-helper.h>
40 #include <map>
41 #include "boost/assign.hpp"
42 #include <sot/core/matrix-geometry.hh>
43 #include <dynamic-graph/linear-algebra.h>
44 
45 namespace dynamicgraph {
46  namespace sot {
47  namespace talos_balance {
48 
49  /* --------------------------------------------------------------------- */
50  /* --- CLASS ----------------------------------------------------------- */
51  /* --------------------------------------------------------------------- */
52 
54  : public ::dynamicgraph::Entity
55  {
56  DYNAMIC_GRAPH_ENTITY_DECL();
57 
58  public:
59  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
60 
61  /* --- CONSTRUCTOR ---- */
62  SimpleZmpEstimator(const std::string & name, const double & eps=1.0);
63 
64  void init();
65 
66  /* --- SIGNALS --- */
67  DECLARE_SIGNAL_IN(wrenchLeft, dynamicgraph::Vector);
68  DECLARE_SIGNAL_IN(wrenchRight, dynamicgraph::Vector);
69 
70  DECLARE_SIGNAL_IN(poseLeft, MatrixHomogeneous);
71  DECLARE_SIGNAL_IN(poseRight, MatrixHomogeneous);
72 
73  DECLARE_SIGNAL_OUT(copLeft, dynamicgraph::Vector);
74  DECLARE_SIGNAL_OUT(copRight, dynamicgraph::Vector);
75  DECLARE_SIGNAL_OUT(zmp, dynamicgraph::Vector);
76  DECLARE_SIGNAL_OUT(emergencyStop, bool);
77 
78  double m_eps;
79 
80  /* --- COMMANDS --- */
81  /* --- ENTITY INHERITANCE --- */
82  virtual void display( std::ostream& os ) const;
83 
84  Eigen::Vector3d computeCoP(const dynamicgraph::Vector & wrench, const MatrixHomogeneous & pose) const;
85 
86  protected:
89 
90  }; // class SimpleZmpEstimator
91 
92  } // namespace talos_balance
93  } // namespace sot
94 } // namespace dynamicgraph
95 
96 
97 
98 #endif // #ifndef __sot_talos_balance_simple_zmp_estimator_H__
#define SIMPLEZMPESTIMATOR_EXPORT
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: math/fwd.hh:40
bool m_emergency_stop_triggered
true if the entity has been successfully initialized