ObjLevelControllerInterface.ice
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotAPI::NJointControllerInterface
17  * @author Mirko Waechter ( mirko dot waechter at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <RobotAPI/interface/units/RobotUnit/NJointController.ice>
26 #include <RobotAPI/interface/core/Trajectory.ice>
27 
28 
29 module armarx
30 {
31  class NJointBimanualObjLevelControllerConfig extends NJointControllerConfig
32  {
33 
34  // dmp configuration
35  int kernelSize = 100;
36  string dmpMode = "MinimumJerk";
37  string dmpType = "Discrete";
38 
39  // phaseStop technique
40  double phaseL = 10;
41  double phaseK = 10;
42  double phaseDist0 = 50;
43  double phaseDist1 = 10;
44  double phaseKpPos = 1;
45  double phaseKpOri = 0.1;
46  double posToOriRatio = 10;
47  double timeDuration = 10;
48 
49  Ice::DoubleSeq boxInitialPose;
50  float boxWidth;
51  Ice::FloatSeq leftDesiredJointValues;
52  Ice::FloatSeq rightDesiredJointValues;
53 
54  // impedance, admittance, object motion parameters
55  Ice::FloatSeq KpImpedance;
56  Ice::FloatSeq KdImpedance;
57  Ice::FloatSeq KpAdmittance;
58  Ice::FloatSeq KdAdmittance;
59  Ice::FloatSeq KmAdmittance;
60  Ice::FloatSeq KmPID;
61  // Ice::FloatSeq objectKp;
62  // Ice::FloatSeq objectKd;
63 
64  // pid force controller parameters
65  Ice::FloatSeq targetWrench;
66  Ice::FloatSeq forceP;
67  Ice::FloatSeq forceI;
68  Ice::FloatSeq forceD;
69  Ice::FloatSeq forcePIDLimits;
70 
71  float filterCoeff;
72 
73 
74  float massLeft;
75  Ice::FloatSeq CoMVecLeft;
76  Ice::FloatSeq forceOffsetLeft;
77  Ice::FloatSeq torqueOffsetLeft;
78 
79  float massRight;
80  Ice::FloatSeq CoMVecRight;
81  Ice::FloatSeq forceOffsetRight;
82  Ice::FloatSeq torqueOffsetRight;
83 
84  // // flags for testing variants
85  // int dmpFeedType; // 0: no dmp, 1: frame, 2: vel, 3: acc, 4: force
86  // int method; // 1,2,3,4 four diffrent method w.r.t inertia trick; default (0): normal method
87  // int jcMethod; // 0: lin's paper, default: Jc = J
88  // int pdotMethod; // 0: numerical differential, 1: paper, Tau - Tau.Transpose, 2 test, default: zero matrix
89  // int graspingType; // 0: fixed to obj, 1, fixed to hand, 2, dynamically from hand pose, defualt: identity
90 
91  float knull;
92  float dnull;
93 
94  float torqueLimit;
95 
96  Ice::FloatSeq forceThreshold;
97 
99 
100  };
101 
102  interface NJointBimanualObjLevelControllerInterface extends NJointControllerInterface
103  {
104  void learnDMPFromFiles(Ice::StringSeq trajfiles);
105  bool isFinished();
106  void runDMP(Ice::DoubleSeq goals, double timeDuration);
107  void runDMPWithVirtualStart(Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration);
108 
109  // void setViaPoints(double canVal, Ice::DoubleSeq point);
110  void setGoals(Ice::DoubleSeq goals);
111  void setViaPoints(double u, Ice::DoubleSeq viapoint);
112  void removeAllViaPoints();
113  double getVirtualTime();
114 
115  void setKpImpedance(Ice::FloatSeq value);
116  void setKdImpedance(Ice::FloatSeq value);
117  void setKmAdmittance(Ice::FloatSeq value);
118  void setKpAdmittance(Ice::FloatSeq value);
119  void setKdAdmittance(Ice::FloatSeq value);
120 
121  Ice::FloatSeq getCurrentObjVel();
122  Ice::FloatSeq getCurrentObjForce();
123 
124  void setMPWeights(DoubleSeqSeq weights);
125  DoubleSeqSeq getMPWeights();
126  void setMPRotWeights(DoubleSeqSeq weights);
127  DoubleSeqSeq getMPRotWeights();
128  };
129 
130  class NJointBimanualObjLevelVelControllerConfig extends NJointControllerConfig
131  {
132 
133  // dmp configuration
134  int kernelSize = 10;
135  string dmpMode = "Linear";
136  string dmpType = "Discrete";
137  double timeDuration = 10;
138 
139  Ice::FloatSeq leftDesiredJointValues;
140  Ice::FloatSeq rightDesiredJointValues;
141 
142  Ice::FloatSeq KpImpedance;
143  Ice::FloatSeq KdImpedance;
144 
145  float knull;
146  float dnull;
147 
150 
151  };
152 
153  interface NJointBimanualObjLevelVelControllerInterface extends NJointControllerInterface
154  {
155  void learnDMPFromFiles(Ice::StringSeq trajfiles);
156  bool isFinished();
157  void runDMP(Ice::DoubleSeq goals, double timeDuration);
158  void runDMPWithVirtualStart(Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration);
159 
160  void setGoals(Ice::DoubleSeq goals);
161  void setViaPoints(double u, Ice::DoubleSeq viapoint);
162  void removeAllViaPoints();
163  double getVirtualTime();
164 
165  void setKpImpedance(Ice::FloatSeq value);
166  void setKdImpedance(Ice::FloatSeq value);
167 
168  Ice::FloatSeq getCurrentObjVel();
169 
170  void setMPWeights(DoubleSeqSeq weights);
171  DoubleSeqSeq getMPWeights();
172  void setMPRotWeights(DoubleSeqSeq weights);
173  DoubleSeqSeq getMPRotWeights();
174  };
175 
176  class NJointBimanualObjLevelMultiMPControllerConfig extends NJointControllerConfig
177  {
178  // dmp configuration
179  int kernelSize = 100;
180  string dmpMode = "MinimumJerk";
181  string dmpObjType = "Discrete";
182  string dmpLeftType = "Discrete";
183  string dmpRightType = "Discrete";
184 
185  float dmpAmplitude = 1.0;
186 
187  // phaseStop technique
188  double phaseL = 10;
189  double phaseK = 10;
190  double phaseDist0 = 50;
191  double phaseDist1 = 10;
192  double phaseKpPos = 1;
193  double phaseKpOri = 0.1;
194  double posToOriRatio = 10;
195  double timeDuration = 10;
196 
197  Ice::DoubleSeq objInitialPose;
198  Ice::FloatSeq leftDesiredJointValues;
199  Ice::FloatSeq rightDesiredJointValues;
200 
201  // impedance, admittance, object motion parameters
202  Ice::FloatSeq KpImpedance;
203  Ice::FloatSeq KdImpedance;
204  Ice::FloatSeq KpAdmittance;
205  Ice::FloatSeq KdAdmittance;
206  Ice::FloatSeq KmAdmittance;
207  Ice::FloatSeq KmPID;
208 
209  // pid force controller parameters
210  Ice::FloatSeq targetWrench;
211  Ice::FloatSeq forceP;
212  Ice::FloatSeq forceI;
213  Ice::FloatSeq forceD;
214  Ice::FloatSeq forcePIDLimits;
215 
216  float filterCoeff;
217 
218 
219  float massLeft;
220  Ice::FloatSeq CoMVecLeft;
221  Ice::FloatSeq forceOffsetLeft;
222  Ice::FloatSeq torqueOffsetLeft;
223 
224  float massRight;
225  Ice::FloatSeq CoMVecRight;
226  Ice::FloatSeq forceOffsetRight;
227  Ice::FloatSeq torqueOffsetRight;
228 
229  float knull;
230  float dnull;
231 
232  float torqueLimit;
233 
234  Ice::FloatSeq forceThreshold;
235 
237 
238  };
239 
240  interface NJointBimanualObjLevelMultiMPControllerInterface extends NJointControllerInterface
241  {
242  void learnDMPFromFiles(Ice::StringSeq trajfiles);
243  void learnMultiDMPFromFiles(Ice::StringSeq objFileNames, Ice::StringSeq leftFileNames, Ice::StringSeq rightFileNames);
244 
245  bool isFinished();
246  void runDMP(Ice::DoubleSeq goalObj, Ice::DoubleSeq goalLeft, Ice::DoubleSeq goalRight, double timeDuration);
247  void runDMPWithVirtualStart(Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration);
248 
249  // void setViaPoints(double canVal, Ice::DoubleSeq point);
250  void setGoals(Ice::DoubleSeq goals);
251  void setMultiMPGoals(Ice::DoubleSeq goalObj, Ice::DoubleSeq goalLeft, Ice::DoubleSeq goalRight);
252 
253  void setViaPoints(double u, Ice::DoubleSeq viapoint);
254  void removeAllViaPoints();
255 
256  double getVirtualTime();
257 
258  void setKpImpedance(Ice::FloatSeq value);
259  void setKdImpedance(Ice::FloatSeq value);
260  void setKmAdmittance(Ice::FloatSeq value);
261  void setKpAdmittance(Ice::FloatSeq value);
262  void setKdAdmittance(Ice::FloatSeq value);
263  void setAmplitude(double amp);
264 
265  Ice::FloatSeq getCurrentObjVel();
266  Ice::FloatSeq getCurrentObjForce();
267  };
268 
269 };
270 
armarx::NJointBimanualObjLevelMultiMPControllerConfig::torqueOffsetLeft
Ice::FloatSeq torqueOffsetLeft
Definition: ObjLevelControllerInterface.ice:222
armarx::NJointBimanualObjLevelControllerConfig::KdAdmittance
Ice::FloatSeq KdAdmittance
Definition: ObjLevelControllerInterface.ice:58
armarx::NJointBimanualObjLevelMultiMPControllerConfig::KmAdmittance
Ice::FloatSeq KmAdmittance
Definition: ObjLevelControllerInterface.ice:206
armarx::NJointBimanualObjLevelVelControllerConfig::jointVelLimit
float jointVelLimit
Definition: ObjLevelControllerInterface.ice:148
armarx::NJointBimanualObjLevelControllerConfig::KmPID
Ice::FloatSeq KmPID
Definition: ObjLevelControllerInterface.ice:60
armarx::NJointBimanualObjLevelControllerConfig::KmAdmittance
Ice::FloatSeq KmAdmittance
Definition: ObjLevelControllerInterface.ice:59
armarx::NJointBimanualObjLevelControllerConfig::dnull
float dnull
Definition: ObjLevelControllerInterface.ice:92
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forceI
Ice::FloatSeq forceI
Definition: ObjLevelControllerInterface.ice:212
armarx::NJointBimanualObjLevelControllerConfig::knull
float knull
Definition: ObjLevelControllerInterface.ice:91
armarx::NJointBimanualObjLevelMultiMPControllerConfig::massRight
float massRight
Definition: ObjLevelControllerInterface.ice:224
armarx::NJointBimanualObjLevelMultiMPControllerConfig::CoMVecRight
Ice::FloatSeq CoMVecRight
Definition: ObjLevelControllerInterface.ice:225
armarx::NJointBimanualObjLevelVelControllerConfig::rightDesiredJointValues
Ice::FloatSeq rightDesiredJointValues
Definition: ObjLevelControllerInterface.ice:140
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forceD
Ice::FloatSeq forceD
Definition: ObjLevelControllerInterface.ice:213
armarx::NJointBimanualObjLevelControllerConfig::KpImpedance
Ice::FloatSeq KpImpedance
Definition: ObjLevelControllerInterface.ice:55
armarx::NJointBimanualObjLevelControllerConfig::CoMVecLeft
Ice::FloatSeq CoMVecLeft
Definition: ObjLevelControllerInterface.ice:75
armarx::NJointBimanualObjLevelMultiMPControllerConfig::KdImpedance
Ice::FloatSeq KdImpedance
Definition: ObjLevelControllerInterface.ice:203
armarx::NJointBimanualObjLevelMultiMPControllerConfig::CoMVecLeft
Ice::FloatSeq CoMVecLeft
Definition: ObjLevelControllerInterface.ice:220
armarx::NJointBimanualObjLevelMultiMPControllerConfig::KdAdmittance
Ice::FloatSeq KdAdmittance
Definition: ObjLevelControllerInterface.ice:205
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forceThreshold
Ice::FloatSeq forceThreshold
Definition: ObjLevelControllerInterface.ice:234
armarx::NJointBimanualObjLevelVelControllerConfig::dnull
float dnull
Definition: ObjLevelControllerInterface.ice:146
armarx::NJointBimanualObjLevelMultiMPControllerConfig::KpAdmittance
Ice::FloatSeq KpAdmittance
Definition: ObjLevelControllerInterface.ice:204
armarx::NJointBimanualObjLevelMultiMPControllerConfig::leftDesiredJointValues
Ice::FloatSeq leftDesiredJointValues
Definition: ObjLevelControllerInterface.ice:198
armarx::NJointBimanualObjLevelMultiMPControllerConfig::knull
float knull
Definition: ObjLevelControllerInterface.ice:229
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forceP
Ice::FloatSeq forceP
Definition: ObjLevelControllerInterface.ice:211
armarx::NJointBimanualObjLevelVelControllerConfig
Definition: ObjLevelControllerInterface.ice:130
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
armarx::NJointBimanualObjLevelControllerConfig::targetWrench
Ice::FloatSeq targetWrench
Definition: ObjLevelControllerInterface.ice:65
armarx::NJointBimanualObjLevelMultiMPControllerConfig::rightDesiredJointValues
Ice::FloatSeq rightDesiredJointValues
Definition: ObjLevelControllerInterface.ice:199
armarx::NJointBimanualObjLevelMultiMPControllerConfig::torqueLimit
float torqueLimit
Definition: ObjLevelControllerInterface.ice:232
armarx::NJointBimanualObjLevelControllerConfig::massRight
float massRight
Definition: ObjLevelControllerInterface.ice:79
armarx::NJointBimanualObjLevelMultiMPControllerConfig
Definition: ObjLevelControllerInterface.ice:176
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forcePIDLimits
Ice::FloatSeq forcePIDLimits
Definition: ObjLevelControllerInterface.ice:214
armarx::NJointBimanualObjLevelControllerConfig::forceD
Ice::FloatSeq forceD
Definition: ObjLevelControllerInterface.ice:68
armarx::NJointBimanualObjLevelVelControllerConfig::KdImpedance
Ice::FloatSeq KdImpedance
Definition: ObjLevelControllerInterface.ice:143
armarx::NJointBimanualObjLevelControllerConfig::forceOffsetRight
Ice::FloatSeq forceOffsetRight
Definition: ObjLevelControllerInterface.ice:81
armarx::NJointBimanualObjLevelControllerConfig::rightDesiredJointValues
Ice::FloatSeq rightDesiredJointValues
Definition: ObjLevelControllerInterface.ice:52
armarx::NJointBimanualObjLevelControllerConfig::ftCalibrationTime
double ftCalibrationTime
Definition: ObjLevelControllerInterface.ice:98
armarx::NJointBimanualObjLevelControllerConfig::forceI
Ice::FloatSeq forceI
Definition: ObjLevelControllerInterface.ice:67
armarx::NJointBimanualObjLevelMultiMPControllerConfig::objInitialPose
Ice::DoubleSeq objInitialPose
Definition: ObjLevelControllerInterface.ice:197
armarx::NJointBimanualObjLevelControllerConfig
Definition: ObjLevelControllerInterface.ice:31
armarx::NJointBimanualObjLevelControllerConfig::boxWidth
float boxWidth
Definition: ObjLevelControllerInterface.ice:50
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forceOffsetRight
Ice::FloatSeq forceOffsetRight
Definition: ObjLevelControllerInterface.ice:226
armarx::NJointBimanualObjLevelControllerConfig::forceThreshold
Ice::FloatSeq forceThreshold
Definition: ObjLevelControllerInterface.ice:96
armarx::NJointBimanualObjLevelMultiMPControllerConfig::KpImpedance
Ice::FloatSeq KpImpedance
Definition: ObjLevelControllerInterface.ice:202
armarx::NJointBimanualObjLevelVelControllerConfig::KpImpedance
Ice::FloatSeq KpImpedance
Definition: ObjLevelControllerInterface.ice:142
armarx::NJointBimanualObjLevelMultiMPControllerConfig::targetWrench
Ice::FloatSeq targetWrench
Definition: ObjLevelControllerInterface.ice:210
armarx::NJointBimanualObjLevelControllerConfig::forceP
Ice::FloatSeq forceP
Definition: ObjLevelControllerInterface.ice:66
armarx::NJointBimanualObjLevelVelControllerConfig::jointLimitAvoidanceKp
float jointLimitAvoidanceKp
Definition: ObjLevelControllerInterface.ice:149
armarx::NJointBimanualObjLevelControllerConfig::torqueOffsetLeft
Ice::FloatSeq torqueOffsetLeft
Definition: ObjLevelControllerInterface.ice:77
armarx::NJointBimanualObjLevelMultiMPControllerConfig::filterCoeff
float filterCoeff
Definition: ObjLevelControllerInterface.ice:216
armarx::NJointBimanualObjLevelControllerConfig::CoMVecRight
Ice::FloatSeq CoMVecRight
Definition: ObjLevelControllerInterface.ice:80
armarx::NJointBimanualObjLevelMultiMPControllerConfig::torqueOffsetRight
Ice::FloatSeq torqueOffsetRight
Definition: ObjLevelControllerInterface.ice:227
armarx::NJointBimanualObjLevelMultiMPControllerConfig::massLeft
float massLeft
Definition: ObjLevelControllerInterface.ice:219
armarx::NJointBimanualObjLevelVelControllerInterface
Definition: ObjLevelControllerInterface.ice:153
armarx::NJointBimanualObjLevelMultiMPControllerConfig::ftCalibrationTime
double ftCalibrationTime
Definition: ObjLevelControllerInterface.ice:236
armarx::NJointBimanualObjLevelControllerConfig::filterCoeff
float filterCoeff
Definition: ObjLevelControllerInterface.ice:71
armarx::NJointBimanualObjLevelControllerConfig::forcePIDLimits
Ice::FloatSeq forcePIDLimits
Definition: ObjLevelControllerInterface.ice:69
armarx::NJointBimanualObjLevelControllerConfig::torqueOffsetRight
Ice::FloatSeq torqueOffsetRight
Definition: ObjLevelControllerInterface.ice:82
armarx::NJointBimanualObjLevelControllerConfig::KpAdmittance
Ice::FloatSeq KpAdmittance
Definition: ObjLevelControllerInterface.ice:57
armarx::NJointBimanualObjLevelControllerConfig::KdImpedance
Ice::FloatSeq KdImpedance
Definition: ObjLevelControllerInterface.ice:56
armarx::NJointBimanualObjLevelControllerConfig::torqueLimit
float torqueLimit
Definition: ObjLevelControllerInterface.ice:94
armarx::NJointBimanualObjLevelControllerConfig::forceOffsetLeft
Ice::FloatSeq forceOffsetLeft
Definition: ObjLevelControllerInterface.ice:76
armarx::NJointBimanualObjLevelMultiMPControllerConfig::KmPID
Ice::FloatSeq KmPID
Definition: ObjLevelControllerInterface.ice:207
armarx::NJointBimanualObjLevelVelControllerConfig::leftDesiredJointValues
Ice::FloatSeq leftDesiredJointValues
Definition: ObjLevelControllerInterface.ice:139
armarx::NJointBimanualObjLevelMultiMPControllerConfig::forceOffsetLeft
Ice::FloatSeq forceOffsetLeft
Definition: ObjLevelControllerInterface.ice:221
armarx::NJointBimanualObjLevelControllerConfig::massLeft
float massLeft
Definition: ObjLevelControllerInterface.ice:74
armarx::NJointBimanualObjLevelControllerConfig::boxInitialPose
Ice::DoubleSeq boxInitialPose
Definition: ObjLevelControllerInterface.ice:49
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::NJointBimanualObjLevelControllerConfig::leftDesiredJointValues
Ice::FloatSeq leftDesiredJointValues
Definition: ObjLevelControllerInterface.ice:51
armarx::NJointBimanualObjLevelControllerInterface
Definition: ObjLevelControllerInterface.ice:102
armarx::NJointBimanualObjLevelMultiMPControllerConfig::dnull
float dnull
Definition: ObjLevelControllerInterface.ice:230
armarx::NJointBimanualObjLevelMultiMPControllerInterface
Definition: ObjLevelControllerInterface.ice:240
armarx::NJointBimanualObjLevelVelControllerConfig::knull
float knull
Definition: ObjLevelControllerInterface.ice:145