sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
hip-flexibility-compensation.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_hip_flexibility_compensation_H__
18 #define __sot_talos_balance_hip_flexibility_compensation_H__
19 
20 /* --------------------------------------------------------------------- */
21 /* --- API ------------------------------------------------------------- */
22 /* --------------------------------------------------------------------- */
23 
24 #if defined(WIN32)
25 #if defined(hip_flexibility_compensation_EXPORTS)
26 #define HIPFLEXIBILITYCOMPENSATION_EXPORT __declspec(dllexport)
27 #else
28 #define HIPFLEXIBILITYCOMPENSATION_EXPORT __declspec(dllimport)
29 #endif
30 #else
31 #define HIPFLEXIBILITYCOMPENSATION_EXPORT
32 #endif
33 
34 /* --------------------------------------------------------------------- */
35 /* --- INCLUDE --------------------------------------------------------- */
36 /* --------------------------------------------------------------------- */
37 
38 #include <pinocchio/fwd.hpp>
39 
40 // include pinocchio first
41 
42 #include <dynamic-graph/signal-helper.h>
43 
44 #include <map>
45 #include <sot/core/robot-utils.hh>
46 
47 #include "boost/assign.hpp"
48 
49 namespace dynamicgraph {
50 namespace sot {
51 namespace talos_balance {
52 
53 /* --------------------------------------------------------------------- */
54 /* --- CLASS ----------------------------------------------------------- */
55 /* --------------------------------------------------------------------- */
56 
58  : public ::dynamicgraph::Entity {
59  DYNAMIC_GRAPH_ENTITY_DECL();
60 
61  public:
62  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
63 
64  /* --- CONSTRUCTOR ---- */
65  HipFlexibilityCompensation(const std::string& name);
66 
67  /* --- SIGNALS --- */
69  DECLARE_SIGNAL_IN(phase, int);
70 
72  DECLARE_SIGNAL_IN(q_des, dynamicgraph::Vector);
74  DECLARE_SIGNAL_IN(tau, dynamicgraph::Vector);
76  DECLARE_SIGNAL_IN(K_l, double);
78  DECLARE_SIGNAL_IN(K_r, double);
80  // DECLARE_SIGNAL_IN(K_d, double);
81 
83  DECLARE_SIGNAL_OUT(tau_filt, dynamicgraph::Vector);
85  DECLARE_SIGNAL_OUT(delta_q, dynamicgraph::Vector);
88  DECLARE_SIGNAL_OUT(q_cmd, dynamicgraph::Vector);
89 
90  /* --- COMMANDS --- */
91  /* --- ENTITY INHERITANCE --- */
92  virtual void display(std::ostream& os) const;
93 
95  void init(const double& dt, const std::string& robotName);
97  void setTorqueLowPassFilterFrequency(const double& frequency);
100  void setAngularSaturation(const double& saturation);
102  void setRateLimiter(const double& rate);
105  dynamicgraph::Vector lowPassFilter(const double& frequency,
106  const dynamicgraph::Vector& signal,
107  dynamicgraph::Vector& previous_signal);
110  void rateLimiter(const dynamicgraph::Vector& signal,
111  dynamicgraph::Vector& previous_signal,
112  dynamicgraph::Vector& output);
113 
114  protected:
115  bool
117  // time step of the robot
118  double m_dt;
125 
126  RobotUtilShrPtr m_robot_util;
127 
128 }; // class HipFlexibilityCompensation
129 
130 } // namespace talos_balance
131 } // namespace sot
132 } // namespace dynamicgraph
133 
134 #endif // #ifndef __sot_talos_balance_hip_flexibility_compensation_H__
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_delta_q_saturation
double m_delta_q_saturation
Definition: hip-flexibility-compensation.hh:120
sot_talos_balance.test.appli_admittance_end_effector.sot
sot
Definition: appli_admittance_end_effector.py:117
sot_talos_balance.test.appli_ankle_admittance.robotName
string robotName
Definition: appli_ankle_admittance.py:33
dynamicgraph
Definition: treeview.dox:24
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_rate_limiter
double m_rate_limiter
Definition: hip-flexibility-compensation.hh:121
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_previous_tau
dynamicgraph::Vector m_previous_tau
Definition: hip-flexibility-compensation.hh:123
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_initSucceeded
bool m_initSucceeded
Definition: hip-flexibility-compensation.hh:116
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_dt
double m_dt
true if the entity has been successfully initialized
Definition: hip-flexibility-compensation.hh:118
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation
Definition: hip-flexibility-compensation.hh:57
sot_talos_balance.test.test_admittance_single_joint.tau
tau
Definition: test_admittance_single_joint.py:20
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_robot_util
RobotUtilShrPtr m_robot_util
Definition: hip-flexibility-compensation.hh:126
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::HipFlexibilityCompensation::m_limitedSignal
dynamicgraph::Vector m_limitedSignal
Definition: hip-flexibility-compensation.hh:124
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_torqueLowPassFilterFrequency
double m_torqueLowPassFilterFrequency
Definition: hip-flexibility-compensation.hh:119
HIPFLEXIBILITYCOMPENSATION_EXPORT
#define HIPFLEXIBILITYCOMPENSATION_EXPORT
Definition: hip-flexibility-compensation.hh:31
dynamicgraph::sot::talos_balance::HipFlexibilityCompensation::m_previous_delta_q
dynamicgraph::Vector m_previous_delta_q
Definition: hip-flexibility-compensation.hh:122
sot_talos_balance.test.appli_dcm_zmp_control.name
name
Definition: appli_dcm_zmp_control.py:298