Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* Copyright 2011, Nicolas Mansard, LAAS-CNRS
*
* This file is part of sot-dyninv.
* sot-dyninv is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* sot-dyninv is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with sot-dyninv. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __sot_dyninv_PseudoRobotDynamic_H__
#define __sot_dyninv_PseudoRobotDynamic_H__
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (pseudo_robot_dynamic_EXPORTS)
# define SOTPSEUDOROBOTDYNAMIC_EXPORT __declspec(dllexport)
# else
# define SOTPSEUDOROBOTDYNAMIC_EXPORT __declspec(dllimport)
# endif
#else
# define SOTPSEUDOROBOTDYNAMIC_EXPORT
#endif
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/* SOT */
#include <sot-dyninv/signal-helper.h>
#include <sot-dyninv/entity-helper.h>
#include <sot-dyninv/dynamic-integrator.h>
namespace dynamicgraph {
namespace sot {
namespace dyninv {
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/* Inside this entity is an integrator, taking position, velocity and
* acceleration at time t, and computing pos and vel at time t+1. Around
* this integrator, a wrapper is made to make the stuff take the place of
* the OpenHRP kinematic entity. it thus take a "control" signal, to triger
* the computations, and possesses all the functionnalities of the OpenHRP
* entity. Plus, it has the signals to feed the OpenHRP entity that
* wrappes the simulator. All the computations are triggered by computing
* the "qdot" signal.
*/
class SOTPSEUDOROBOTDYNAMIC_EXPORT PseudoRobotDynamic
:public DynamicIntegrator
,public ::dynamicgraph::EntityHelper<PseudoRobotDynamic>
{
Francois Keith
committed
DYNAMIC_GRAPH_ENTITY_DECL();
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
public: /* --- CONSTRUCTOR ---- */
PseudoRobotDynamic( const std::string & name );
public: /* --- ENTITY INHERITANCE --- */
virtual void display( std::ostream& os ) const;
virtual void commandLine( const std::string& cmdLine,
std::istringstream& cmdArgs,
std::ostream& os );
typedef ::dynamicgraph::EntityHelper<PseudoRobotDynamic>::EntityClassName
EntityClassName;
public: /* --- SIGNALS --- */
DECLARE_SIGNAL_IN( control,ml::Vector );
DECLARE_SIGNAL_OUT( qdot,ml::Vector );
DECLARE_SIGNAL(rotation,OUT,ml::Vector);
DECLARE_SIGNAL(translation,OUT,ml::Vector);
//sotSignal< ml::Vector,int > rotationSOUT;
//sotSignal< ml::Vector,int > translationSOUT;
::dynamicgraph::SignalPtr< ml::Vector,int > stateSOUT;
public: /* --- SIGNALS --- */
void replaceSimulatorEntity( const std::string& formerName,
const bool& plug = false );
void setRoot( const ml::Matrix & M );
public: /* --- COMMAND --- */
template< typename T1 >
void forwardVoidCommandToSimu( const std::string& cmdName,
const T1& arg1 );
void addForward( const std::string& cmdName );
private:
::dynamicgraph::Entity* formerOpenHRP;
}; // class PseudoRobotDynamic
} // namespace dyninv
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __sot_dyninv_PseudoRobotDynamic_H__