sot-torque-control  1.6.4
Collection of dynamic-graph entities aimed at implementing torque control on different robots.
 
Loading...
Searching...
No Matches
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
28namespace dynamicgraph {
29namespace sot {
30namespace 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
DECLARE_SIGNAL_IN(tau_measure, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(temp_measure, dynamicgraph::Vector)
DDPSolver< double, 5, 1 >::commandVec_t m_u
DECLARE_SIGNAL_IN(tau_des, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(pos_motor_measure, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(pos_joint_measure, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(pos_des, dynamicgraph::Vector)
DECLARE_SIGNAL_IN(dx_measure, dynamicgraph::Vector)
#define SOTDDPACTUATORSOLVER_EXPORT
to read text file
Definition: treeview.dox:22