iCub-main
genericControlBoardDumper.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4  * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
5  * Author: Francesco Nori
6  * email: francesco.nori@iit.it
7  * website: www.robotcub.org
8  * Permission is granted to copy, distribute, and/or modify this program
9  * under the terms of the GNU General Public License, version 2 or any
10  * later version published by the Free Software Foundation.
11  *
12  * A copy of the license can be found at
13  * http://www.robotcub.org/icub/license/gpl.txt
14  *
15  * This program is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18  * Public License for more details
19 */
20 
21 #include <yarp/dev/ControlBoardInterfaces.h>
22 #include <yarp/dev/PolyDriver.h>
23 #include <yarp/dev/IPreciselyTimed.h>
24 
25 using namespace yarp::dev;
26 using namespace yarp::os;
27 
28 class GetData
29 {
30 private:
31  IPreciselyTimed* myIstmp;
32 public:
33  GetData();
34  virtual bool getData(double *) = 0;
35  bool getStamp(Stamp &);
36  void setStamp(IPreciselyTimed*);
37 
38 };
39 
40 class GetTemps : public GetData
41 {
42 public:
43  void setInterface (IMotor *);
44  virtual bool getData(double *);
45 
46  IMotor *imot;
47 };
48 
49 class GetMotEncs : public GetData
50 {
51 public:
52  void setInterface (IMotorEncoders *);
53  virtual bool getData(double *);
54 
55  IMotorEncoders *imotencs;
56 };
57 
58 class GetMotSpeeds : public GetData
59 {
60 public:
61  void setInterface (IMotorEncoders *);
62  virtual bool getData(double *);
63 
64  IMotorEncoders *imotencs;
65 };
66 
67 class GetMotAccs : public GetData
68 {
69 public:
70  void setInterface (IMotorEncoders *);
71  virtual bool getData(double *);
72 
73  IMotorEncoders *imotencs;
74 };
75 
76 class GetEncs : public GetData
77 {
78 public:
79  void setInterface (IEncoders *);
80  virtual bool getData(double *);
81 
82  IEncoders *iencs;
83 };
84 
85 class GetPidRefs : public GetData
86 {
87 public:
88  void setInterface (IPidControl *);
89  virtual bool getData(double *);
90 
91  IPidControl *ipid;
92 };
93 
94 class GetSpeeds : public GetData
95 {
96 public:
97  void setInterface (IEncoders *);
98  virtual bool getData(double *);
99 
100  IEncoders *iencs;
101 };
102 
103 class GetAccs : public GetData
104 {
105 public:
106  void setInterface (IEncoders *);
107  virtual bool getData(double *);
108 
109  IEncoders *iencs;
110 };
111 
112 class GetPosErrs : public GetData
113 {
114 public:
115  void setInterface (IPidControl *);
116  virtual bool getData(double *);
117 
118  IPidControl *ipid;
119 };
120 
121 class GetOuts : public GetData
122 {
123 public:
124  void setInterface (IPidControl *);
125  virtual bool getData(double *);
126 
127  IPidControl *ipid;
128 };
129 
130 class GetCurrs : public GetData
131 {
132 public:
133  void setInterface (IAmplifierControl *);
134  virtual bool getData(double *);
135 
136  IAmplifierControl *iamp;
137 };
138 
139 class GetTrqs : public GetData
140 {
141 public:
142  void setInterface (ITorqueControl *);
143  virtual bool getData(double *);
144 
145  ITorqueControl *itrq;
146 };
147 
148 class GetControlModes : public GetData
149 {
150 public:
151  void setInterface (IControlMode *, int joints);
152  virtual bool getData(double *);
153 
154  IControlMode *icmd;
155  int nj;
156 };
157 
159 {
160 public:
161  void setInterface (IInteractionMode *, int joints);
162  virtual bool getData(double *);
163 
164  IInteractionMode *iint;
165  int nj;
166 };
167 
168 class GetTrqErrs : public GetData
169 {
170 public:
171  void setInterface (IPidControl *);
172  virtual bool getData(double *);
173 
174  IPidControl *ipid;
175 };
176 
177 class GetTrqRefs : public GetData
178 {
179 public:
180  void setInterface (ITorqueControl *);
181  virtual bool getData(double *);
182 
183  ITorqueControl *itrq;
184 };
185 
186 class GetMotPwm : public GetData
187 {
188 public:
189  void setInterface (IAmplifierControl *);
190  virtual bool getData(double *);
192 
193  IAmplifierControl *iamp;
194 };
IAmplifierControl * iamp
virtual bool getData(double *)=0
IMotorEncoders * imotencs
IMotorEncoders * imotencs
IAmplifierControl * iamp
IMotorEncoders * imotencs
IPidControl * ipid
ITorqueControl * itrq
ITorqueControl * itrq