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
/*
* 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_ContactSelecter_H__
#define __sot_dyninv_ContactSelecter_H__
/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#if defined (WIN32)
# if defined (solver_op_space_EXPORTS)
# define SOTCONTACTSELECTER_EXPORT __declspec(dllexport)
# else
# define SOTCONTACTSELECTER_EXPORT __declspec(dllimport)
# endif
#else
# define SOTCONTACTSELECTER_EXPORT
#endif
/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
/* SOT */
#include <sot-dyninv/signal-helper.h>
#include <sot-dyninv/entity-helper.h>
#include <sot-dyninv/solver-dyn-reduced.h>
#include <map>
namespace dynamicgraph {
namespace sot {
namespace dyninv {
/* --------------------------------------------------------------------- */
/* --- CLASS ----------------------------------------------------------- */
/* --------------------------------------------------------------------- */
class SOTCONTACTSELECTER_EXPORT ContactSelecter
:public ::dynamicgraph::Entity
,public ::dynamicgraph::EntityHelper<ContactSelecter>
{
Francois Keith
committed
DYNAMIC_GRAPH_ENTITY_DECL();
57
58
59
60
61
62
63
64
65
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
115
116
public: /* --- CONSTRUCTOR ---- */
ContactSelecter( const std::string & name );
public: /* --- ENTITY INHERITANCE --- */
virtual void display( std::ostream& os ) const;
void initCommands( void );
public: /* --- SIGNALS --- */
DECLARE_SIGNAL_OUT(trigger,int);
public: /* --- COMMANDS --- */
void setSolverReference( const std::string& solverName );
void setContact( const std::string & contactName, const std::string & contactTaskName );
void setTask( const std::string & contactName, const std::string & taskName );
void setContactAndTask( const std::string & contactName,
const std::string & contactTaskName,
const std::string & taskName );
void setContactStatus( const std::string & contactName,
const bool & status );
bool getContactStatus( const std::string & contactName );
public:
struct ContactInfo
{
std::string contactTaskName;
std::string complementaryTaskName;
std::string contactName;
bool status;
DECLARE_SIGNAL_IN(activation,bool);
DECLARE_SIGNAL_IN(support,ml::Matrix);
ContactInfo( const std::string & contactName,
const std::string & contactTaskName,
const std::string & complementaryTaskName,
ContactSelecter& mother);
};
typedef boost::shared_ptr<ContactInfo> ContactInfo_ptr;
typedef std::map<std::string, ContactInfo_ptr> ContactInfo_map;
typedef SolverDynReduced Solver;
typedef Solver* Solver_ptr;
private:
ContactInfo_map contacts;
Solver_ptr solver;
bool verbose;
}; // class ContactSelecter
} // namespace dyninv
} // namespace sot
} // namespace dynamicgraph
#endif // #ifndef __sot_dyninv_ContactSelecter_H__