sot-torque-control  1.6.5
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
ddp-actuator-solver.hh
Go to the documentation of this file.
1 
2 #ifndef _SOT_DDP_ACTUATOR_SOLVER_H
3 #define _SOT_DDP_ACTUATOR_SOLVER_H
4 /* --------------------------------------------------------------------- */
5 /* --- API ------------------------------------------------------------- */
6 /* --------------------------------------------------------------------- */
7 
8 #if defined(WIN32)
9 #if defined(sot_ddp_actuator_EXPORTS)
10 #define SOTDDPACTUATORSOLVER_EXPORT __declspec(dllexport)
11 #else
12 #define SOTDDPACTUATORSOLVER_EXPORT __declspec(dllimport)
13 #endif
14 #else
15 #define SOTDDPACTUATORSOLVER_EXPORT
16 #endif
17 
18 #include <dynamic-graph/signal-helper.h>
19 
20 #include <ddp-actuator-solver/ddpsolver.hh>
21 #include <ddp-actuator-solver/temperature_control/costtemp.hh>
22 #include <ddp-actuator-solver/temperature_control/dctemp.hh>
23 #include <sot/core/causal-filter.hh>
24 #include <sot/core/matrix-geometry.hh>
25 #include <sot/core/robot-utils.hh>
26 #include <tsid/utils/stop-watch.hpp>
27 
28 namespace dynamicgraph {
29 namespace sot {
30 namespace torque_control {
31 
32 #define ALL_INPUT_SIGNALS \
33  m_pos_desSIN << m_pos_motor_measureSIN << m_pos_joint_measureSIN \
34  << m_dx_measureSIN << m_tau_measureSIN << m_temp_measureSIN \
35  << m_tau_desSIN
36 
37 #define ALL_OUTPUT_SIGNALS m_tauSOUT
38 
40  : public ::dynamicgraph::Entity {
41  DYNAMIC_GRAPH_ENTITY_DECL();
42 
43  public: /* --- SIGNALS --- */
44  DECLARE_SIGNAL_IN(pos_des, dynamicgraph::Vector);
45  DECLARE_SIGNAL_IN(pos_motor_measure, dynamicgraph::Vector);
46  DECLARE_SIGNAL_IN(pos_joint_measure, dynamicgraph::Vector);
47  DECLARE_SIGNAL_IN(dx_measure, dynamicgraph::Vector);
48  DECLARE_SIGNAL_IN(tau_measure, dynamicgraph::Vector);
49  DECLARE_SIGNAL_IN(tau_des, dynamicgraph::Vector);
50  DECLARE_SIGNAL_IN(temp_measure, dynamicgraph::Vector);
51  DECLARE_SIGNAL_OUT(tau, dynamicgraph::Vector);
52 
53  protected:
54  double m_dt;
56  DDPSolver<double, 5, 1>::stateVec_t m_xinit, m_xDes, m_x, m_zeroState;
57  DDPSolver<double, 5, 1>::commandVec_t m_u;
58  DCTemp m_model;
59  CostTemp m_cost;
60  DDPSolver<double, 5, 1> m_solver;
61  unsigned int m_T;
62  double m_stopCrit;
63  unsigned int m_iterMax;
64 
65  public:
66  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
67 
69  DdpActuatorSolver(const std::string &name);
70  virtual void display(std::ostream &os) const;
71 
72  protected:
79  void param_init(const double &timestep, const int &T, const int &nbItMax,
80  const double &stopCriteria);
81 };
82 } // namespace torque_control
83 } // namespace sot
84 } // namespace dynamicgraph
85 #endif // _SOT_DDP_ACTUATOR_SOLVER_H
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_cost
CostTemp m_cost
Definition: ddp-actuator-solver.hh:59
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_model
DCTemp m_model
Definition: ddp-actuator-solver.hh:58
dynamicgraph
to read text file
Definition: treeview.dox:22
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_zeroState
DDPSolver< double, 5, 1 >::stateVec_t m_zeroState
Definition: ddp-actuator-solver.hh:56
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_stopCrit
double m_stopCrit
Definition: ddp-actuator-solver.hh:62
SOTDDPACTUATORSOLVER_EXPORT
#define SOTDDPACTUATORSOLVER_EXPORT
Definition: ddp-actuator-solver.hh:15
torque_control
Definition: __init__.py:1
dynamicgraph::sot::torque_control::DdpActuatorSolver
Definition: ddp-actuator-solver.hh:39
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_dt
double m_dt
Definition: ddp-actuator-solver.hh:54
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_u
DDPSolver< double, 5, 1 >::commandVec_t m_u
Definition: ddp-actuator-solver.hh:57
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_T
unsigned int m_T
Definition: ddp-actuator-solver.hh:61
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_ambiant_temperature
double m_ambiant_temperature
Definition: ddp-actuator-solver.hh:55
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_iterMax
unsigned int m_iterMax
Definition: ddp-actuator-solver.hh:63
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_solver
DDPSolver< double, 5, 1 > m_solver
Definition: ddp-actuator-solver.hh:60