sot-torque-control  1.5.2
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 <tsid/utils/stop-watch.hpp>
19 #include <dynamic-graph/signal-helper.h>
20 #include <sot/core/matrix-geometry.hh>
21 #include <sot/core/robot-utils.hh>
22 #include <sot/core/causal-filter.hh>
23 
24 #include <ddp-actuator-solver/ddpsolver.hh>
25 
26 #include <ddp-actuator-solver/temperature_control/dctemp.hh>
27 #include <ddp-actuator-solver/temperature_control/costtemp.hh>
28 
29 namespace dynamicgraph {
30 namespace sot {
31 namespace torque_control {
32 
33 #define ALL_INPUT_SIGNALS \
34  m_pos_desSIN << m_pos_motor_measureSIN << m_pos_joint_measureSIN << m_dx_measureSIN << m_tau_measureSIN \
35  << m_temp_measureSIN << m_tau_desSIN
36 
37 #define ALL_OUTPUT_SIGNALS m_tauSOUT
38 
39 class SOTDDPACTUATORSOLVER_EXPORT DdpActuatorSolver : public ::dynamicgraph::Entity {
40  DYNAMIC_GRAPH_ENTITY_DECL();
41 
42  public: /* --- SIGNALS --- */
43  DECLARE_SIGNAL_IN(pos_des, dynamicgraph::Vector);
44  DECLARE_SIGNAL_IN(pos_motor_measure, dynamicgraph::Vector);
45  DECLARE_SIGNAL_IN(pos_joint_measure, dynamicgraph::Vector);
46  DECLARE_SIGNAL_IN(dx_measure, dynamicgraph::Vector);
47  DECLARE_SIGNAL_IN(tau_measure, dynamicgraph::Vector);
48  DECLARE_SIGNAL_IN(tau_des, dynamicgraph::Vector);
49  DECLARE_SIGNAL_IN(temp_measure, dynamicgraph::Vector);
50  DECLARE_SIGNAL_OUT(tau, dynamicgraph::Vector);
51 
52  protected:
53  double m_dt;
55  DDPSolver<double, 5, 1>::stateVec_t m_xinit, m_xDes, m_x, m_zeroState;
56  DDPSolver<double, 5, 1>::commandVec_t m_u;
57  DCTemp m_model;
58  CostTemp m_cost;
59  DDPSolver<double, 5, 1> m_solver;
60  unsigned int m_T;
61  double m_stopCrit;
62  unsigned int m_iterMax;
63 
64  public:
65  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
66 
68  DdpActuatorSolver(const std::string &name);
69  virtual void display(std::ostream &os) const;
70 
71  protected:
78  void param_init(const double &timestep, const int &T, const int &nbItMax, const double &stopCriteria);
79 };
80 } // namespace torque_control
81 } // namespace sot
82 } // namespace dynamicgraph
83 #endif // _SOT_DDP_ACTUATOR_SOLVER_H
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_cost
CostTemp m_cost
Definition: ddp-actuator-solver.hh:58
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_model
DCTemp m_model
Definition: ddp-actuator-solver.hh:57
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:55
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_stopCrit
double m_stopCrit
Definition: ddp-actuator-solver.hh:61
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:53
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_u
DDPSolver< double, 5, 1 >::commandVec_t m_u
Definition: ddp-actuator-solver.hh:56
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_T
unsigned int m_T
Definition: ddp-actuator-solver.hh:60
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_ambiant_temperature
double m_ambiant_temperature
Definition: ddp-actuator-solver.hh:54
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_iterMax
unsigned int m_iterMax
Definition: ddp-actuator-solver.hh:62
dynamicgraph::sot::torque_control::DdpActuatorSolver::m_solver
DDPSolver< double, 5, 1 > m_solver
Definition: ddp-actuator-solver.hh:59