ControllerInterface.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 armarx::control::deprecated_njoint_mp_controller::adaptive::ControllerInterface
17  * @author jianfeng gao ( jianfeng dot gao 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 <ArmarXCore/interface/serialization/Eigen.ice>
26 
27 #include <RobotAPI/interface/core/Trajectory.ice>
28 #include <RobotAPI/interface/units/RobotUnit/NJointController.ice>
29 
30 module armarx
31 {
32  class NJointTaskSpaceAdaptiveDMPControllerConfig extends NJointControllerConfig
33  {
34 
35  // dmp configuration
36  int kernelSize = 100;
37  string dmpMode = "MinimumJerk";
38  string dmpType = "Discrete";
39  double timeDuration;
40  string nodeSetName;
41 
42  Ice::FloatSeq Kpos;
43  Ice::FloatSeq Dpos;
44  Ice::FloatSeq Kori;
45  Ice::FloatSeq Dori;
46  Ice::FloatSeq Knull;
47  Ice::FloatSeq Dnull;
48 
51 
52  float torqueLimit;
54  float filterCoeff;
55  };
56 
57  interface NJointTaskSpaceAdaptiveDMPControllerInterface extends NJointControllerInterface
58  {
59  void learnDMPFromFiles(Ice::StringSeq trajfiles);
60  void learnJointDMPFromFiles(string jointTrajFile, Ice::FloatSeq currentJVS);
61 
62  bool isFinished();
63  void runDMP(Ice::DoubleSeq goals);
64  void runDMPWithTime(Ice::DoubleSeq goals, double timeDuration);
65 
66  void setViaPoints(double canVal, Ice::DoubleSeq point);
67  void setGoals(Ice::DoubleSeq goals);
68 
69  double getVirtualTime();
70  void setCanVal(double canVal);
71 
72  void resetDMP();
73  void stopDMP();
74  void resumeDMP();
75 
76  void setKdImpedance(Ice::FloatSeq dampings);
77  void setKpImpedance(Ice::FloatSeq stiffness);
78  void setKpNull(Ice::FloatSeq knull);
79  void setKdNull(Ice::FloatSeq dnull);
80  Ice::FloatSeq getForce();
81  Ice::FloatSeq getVelocityInMM();
82  void removeAllViaPoints();
83 
84  void setUseNullSpaceJointDMP(bool useJointDMP);
85  void setDefaultJointValues(Ice::FloatSeq desiredJointVals);
86  };
87 
88  class NJointAdaptiveWipingControllerConfig extends NJointControllerConfig
89  {
90 
91  // dmp configuration
92  int kernelSize = 100;
93  double dmpAmplitude = 1;
94  double timeDuration = 10;
95 
96  double phaseL = 10;
97  double phaseK = 10;
98  float phaseDist0 = 50;
99  float phaseDist1 = 10;
100  double phaseKpPos = 1;
101  double phaseKpOri = 0.1;
102  double posToOriRatio = 100;
103 
104 
105  // velocity controller configuration
106  string nodeSetName = "";
107 
109  Ice::FloatSeq Kpos;
110  Ice::FloatSeq Dpos;
111  Ice::FloatSeq Kori;
112  Ice::FloatSeq Dori;
113 
115  Ice::FloatSeq Knull;
116  Ice::FloatSeq Dnull;
117 
118  string forceSensorName = "FT R";
119  string forceFrameName = "ArmR8_Wri2";
120  float forceFilter = 0.8;
121  float waitTimeForCalibration = 0.1;
122  float Kpf;
123 
124  float minimumReactForce = 0;
125 
127  float velFilter;
128 
131 
132  Ice::FloatSeq ws_x;
133  Ice::FloatSeq ws_y;
134  Ice::FloatSeq ws_z;
135 
136  float adaptCoeff;
142 
143  Ice::FloatSeq ftOffset;
144  Ice::FloatSeq handCOM;
145  float handMass;
146  float angularKp;
148  };
149 
150  interface NJointAdaptiveWipingControllerInterface extends NJointControllerInterface
151  {
152  void learnDMPFromFiles(Ice::StringSeq trajfiles);
153  void learnDMPFromTrajectory(TrajectoryBase trajectory);
154 
155  bool isFinished();
156  void runDMP(Ice::DoubleSeq goals, double tau);
157 
158  void setSpeed(double times);
159  void setGoals(Ice::DoubleSeq goals);
160  void setAmplitude(double amplitude);
161  void setTargetForceInRootFrame(float force);
162 
163  double getCanVal();
164  };
165 
166  class NJointAnomalyDetectionAdaptiveWipingControllerConfig extends NJointControllerConfig
167  {
168 
169  // dmp configuration
170  int kernelSize = 100;
171  double dmpAmplitude = 1;
172  double timeDuration = 10;
173 
174  double phaseL = 10;
175  double phaseK = 10;
176  float phaseDist0 = 50;
177  float phaseDist1 = 10;
178  double phaseKpPos = 1;
179  double phaseKpOri = 0.1;
180  double posToOriRatio = 100;
181 
182 
183  // velocity controller configuration
184  string nodeSetName = "";
185 
188 
189  Ice::FloatSeq Kpos;
190  Ice::FloatSeq Dpos;
191  Ice::FloatSeq Kori;
192  Ice::FloatSeq Dori;
193  Ice::FloatSeq Knull;
194  Ice::FloatSeq Dnull;
195 
196  string forceSensorName = "FT R";
197  string forceFrameName = "ArmR8_Wri2";
198  float forceFilter = 0.8;
199  float waitTimeForCalibration = 0.1;
200 
201  // anomaly detection and friction estimation
202  int velocityHorizon = 100;
203  int frictionHorizon = 100;
204 
205  // pid params
211  Ice::FloatSeq pidForce;
212  Ice::FloatSeq pidRot;
213  Ice::FloatSeq pidTorque;
214  Ice::FloatSeq pidLCR;
215 
216  float minimumReactForce = 0;
218  float velFilter;
219 
222 
223  Ice::FloatSeq ws_x;
224  Ice::FloatSeq ws_y;
225  Ice::FloatSeq ws_z;
226 
227  float adaptCoeff;
233 
234  Ice::FloatSeq ftOffset;
235  Ice::FloatSeq handCOM;
236  float handMass;
237 
243 
248 
253 
258 
265  };
266 
268  NJointControllerInterface
269  {
270  void learnDMPFromFiles(Ice::StringSeq trajfiles);
271  void learnDMPFromTrajectory(TrajectoryBase trajectory);
272 
273  bool isFinished();
274  void runDMP(Ice::DoubleSeq goals, double tau);
275 
276  void setSpeed(double times);
277  void setGoals(Ice::DoubleSeq goals);
278  void setAmplitude(double amplitude);
279  void setTargetForceInRootFrame(float force);
280 
281  double getCanVal();
282 
283  Ice::FloatSeq getAnomalyInput();
284  Ice::FloatSeq getAnomalyOutput();
285 
286  void setTrigerAbnormalEvent(bool abnormal);
287 
288  void pauseDMP();
289  void resumeDMP();
290  };
291 };
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::adaptRateIncrease
float adaptRateIncrease
Definition: ControllerInterface.ice:249
armarx::NJointAdaptiveWipingControllerConfig::Kori
Ice::FloatSeq Kori
Definition: ControllerInterface.ice:111
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::isForceCtrlInForceDir
bool isForceCtrlInForceDir
Definition: ControllerInterface.ice:206
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::torqueLimit
float torqueLimit
Definition: ControllerInterface.ice:52
armarx::NJointAdaptiveWipingControllerConfig::Dnull
Ice::FloatSeq Dnull
Definition: ControllerInterface.ice:116
armarx::NJointAdaptiveWipingControllerConfig::Knull
Ice::FloatSeq Knull
Definition: ControllerInterface.ice:115
armarx::NJointAdaptiveWipingControllerConfig::Dpos
Ice::FloatSeq Dpos
Definition: ControllerInterface.ice:110
armarx::NJointAdaptiveWipingControllerConfig::dragForceDeadZone
float dragForceDeadZone
Definition: ControllerInterface.ice:138
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::changeTimerThreshold
float changeTimerThreshold
Definition: ControllerInterface.ice:232
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::decreaseKpForceCoeff
float decreaseKpForceCoeff
Definition: ControllerInterface.ice:246
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::loseContactCounterMax
int loseContactCounterMax
Definition: ControllerInterface.ice:262
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::velFilter
float velFilter
Definition: ControllerInterface.ice:218
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::fricEstiFilter
float fricEstiFilter
Definition: ControllerInterface.ice:240
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::decreaseKpRotCoeff
float decreaseKpRotCoeff
Definition: ControllerInterface.ice:247
armarx::NJointAdaptiveWipingControllerConfig::desiredNullSpaceJointValues
Ice::FloatSeq desiredNullSpaceJointValues
Definition: ControllerInterface.ice:114
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::ftCommandFilter
float ftCommandFilter
Definition: ControllerInterface.ice:238
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::loseContactDetectionEnabled
bool loseContactDetectionEnabled
Definition: ControllerInterface.ice:261
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::maxInteractionForce
float maxInteractionForce
Definition: ControllerInterface.ice:242
armarx::NJointAdaptiveWipingControllerConfig::ws_x
Ice::FloatSeq ws_x
Definition: ControllerInterface.ice:132
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::Knull
Ice::FloatSeq Knull
Definition: ControllerInterface.ice:193
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::pidLCR
Ice::FloatSeq pidLCR
Definition: ControllerInterface.ice:214
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::pidRot
Ice::FloatSeq pidRot
Definition: ControllerInterface.ice:212
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::adaptCoeffKdImpIncrease
float adaptCoeffKdImpIncrease
Definition: ControllerInterface.ice:252
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::Knull
Ice::FloatSeq Knull
Definition: ControllerInterface.ice:46
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::loseContactForceIntThreshold
float loseContactForceIntThreshold
Definition: ControllerInterface.ice:260
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::isRotControlEnabled
bool isRotControlEnabled
Definition: ControllerInterface.ice:208
armarx::NJointAdaptiveWipingControllerConfig::ws_y
Ice::FloatSeq ws_y
Definition: ControllerInterface.ice:133
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::maxLinearVel
float maxLinearVel
Definition: ControllerInterface.ice:220
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::Dpos
Ice::FloatSeq Dpos
Definition: ControllerInterface.ice:190
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::reactThreshold
float reactThreshold
Definition: ControllerInterface.ice:228
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::Kori
Ice::FloatSeq Kori
Definition: ControllerInterface.ice:44
armarx::NJointAdaptiveWipingControllerConfig::Kpos
Ice::FloatSeq Kpos
Definition: ControllerInterface.ice:109
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::isAdaptOriImpEnabled
bool isAdaptOriImpEnabled
Definition: ControllerInterface.ice:259
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::frictionCone
float frictionCone
Definition: ControllerInterface.ice:239
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::ws_z
Ice::FloatSeq ws_z
Definition: ControllerInterface.ice:225
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::Kpos
Ice::FloatSeq Kpos
Definition: ControllerInterface.ice:42
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::increaseKdNullCoeff
float increaseKdNullCoeff
Definition: ControllerInterface.ice:257
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::rotAngleSigmoid
float rotAngleSigmoid
Definition: ControllerInterface.ice:263
armarx::NJointAdaptiveWipingControllerConfig::reactThreshold
float reactThreshold
Definition: ControllerInterface.ice:137
armarx::NJointAdaptiveWipingControllerConfig::changeTimerThreshold
float changeTimerThreshold
Definition: ControllerInterface.ice:141
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::nodeSetName
string nodeSetName
Definition: ControllerInterface.ice:40
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::increaseKdOriCoeff
float increaseKdOriCoeff
Definition: ControllerInterface.ice:255
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::changePositionTolerance
float changePositionTolerance
Definition: ControllerInterface.ice:231
armarx::NJointAdaptiveWipingControllerConfig::handCOM
Ice::FloatSeq handCOM
Definition: ControllerInterface.ice:144
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::isTorqueControlEnabled
bool isTorqueControlEnabled
Definition: ControllerInterface.ice:209
armarx::NJointAdaptiveWipingControllerConfig::ftOffset
Ice::FloatSeq ftOffset
Definition: ControllerInterface.ice:143
armarx::NJointTaskSpaceAdaptiveDMPControllerInterface
Definition: ControllerInterface.ice:57
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::forceDeadZone
float forceDeadZone
Definition: ControllerInterface.ice:217
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::useDMPInGlobalFrame
bool useDMPInGlobalFrame
Definition: ControllerInterface.ice:264
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::velNormThreshold
float velNormThreshold
Definition: ControllerInterface.ice:241
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::ws_x
Ice::FloatSeq ws_x
Definition: ControllerInterface.ice:223
armarx::NJointAnomalyDetectionAdaptiveWipingControllerInterface
Definition: ControllerInterface.ice:267
armarx::NJointAdaptiveWipingControllerInterface
Definition: ControllerInterface.ice:150
armarx::NJointAdaptiveWipingControllerConfig::frictionCone
float frictionCone
Definition: ControllerInterface.ice:147
armarx::NJointAdaptiveWipingControllerConfig::ws_z
Ice::FloatSeq ws_z
Definition: ControllerInterface.ice:134
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::pidForce
Ice::FloatSeq pidForce
Definition: ControllerInterface.ice:211
armarx::NJointAdaptiveWipingControllerConfig::maxAngularVel
float maxAngularVel
Definition: ControllerInterface.ice:130
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::filterCoeff
float filterCoeff
Definition: ControllerInterface.ice:54
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::adaptCoeff
float adaptCoeff
Definition: ControllerInterface.ice:227
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::useNullSpaceJointDMP
bool useNullSpaceJointDMP
Definition: ControllerInterface.ice:49
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig
Definition: ControllerInterface.ice:32
armarx::NJointAdaptiveWipingControllerConfig::adaptForceCoeff
float adaptForceCoeff
Definition: ControllerInterface.ice:139
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::adaptRateDecreaseRot
float adaptRateDecreaseRot
Definition: ControllerInterface.ice:251
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::maxJointTorque
float maxJointTorque
Definition: ControllerInterface.ice:186
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::Dori
Ice::FloatSeq Dori
Definition: ControllerInterface.ice:192
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::dragForceDeadZone
float dragForceDeadZone
Definition: ControllerInterface.ice:229
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::ftOffset
Ice::FloatSeq ftOffset
Definition: ControllerInterface.ice:234
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::pidTorque
Ice::FloatSeq pidTorque
Definition: ControllerInterface.ice:213
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::increaseKpRotCoeff
float increaseKpRotCoeff
Definition: ControllerInterface.ice:245
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::isForceControlEnabled
bool isForceControlEnabled
Definition: ControllerInterface.ice:207
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::maxAngularVel
float maxAngularVel
Definition: ControllerInterface.ice:221
armarx::NJointAdaptiveWipingControllerConfig
Definition: ControllerInterface.ice:88
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::Dnull
Ice::FloatSeq Dnull
Definition: ControllerInterface.ice:194
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::defaultNullSpaceJointValues
Ice::FloatSeq defaultNullSpaceJointValues
Definition: ControllerInterface.ice:50
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::adaptRateDecrease
float adaptRateDecrease
Definition: ControllerInterface.ice:250
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::Dori
Ice::FloatSeq Dori
Definition: ControllerInterface.ice:45
armarx::NJointAdaptiveWipingControllerConfig::velFilter
float velFilter
Definition: ControllerInterface.ice:127
armarx::NJointAdaptiveWipingControllerConfig::Kpf
float Kpf
Definition: ControllerInterface.ice:122
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::Kpos
Ice::FloatSeq Kpos
Definition: ControllerInterface.ice:189
armarx::NJointAdaptiveWipingControllerConfig::changePositionTolerance
float changePositionTolerance
Definition: ControllerInterface.ice:140
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::ws_y
Ice::FloatSeq ws_y
Definition: ControllerInterface.ice:224
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::timeDuration
double timeDuration
Definition: ControllerInterface.ice:39
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::forceSensorName
string forceSensorName
Definition: ControllerInterface.ice:53
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::increaseKpForceCoeff
float increaseKpForceCoeff
Definition: ControllerInterface.ice:244
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::increaseKpNullCoeff
float increaseKpNullCoeff
Definition: ControllerInterface.ice:256
armarx::NJointAdaptiveWipingControllerConfig::adaptCoeff
float adaptCoeff
Definition: ControllerInterface.ice:136
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::increaseKpOriCoeff
float increaseKpOriCoeff
Definition: ControllerInterface.ice:254
armarx::NJointAdaptiveWipingControllerConfig::maxLinearVel
float maxLinearVel
Definition: ControllerInterface.ice:129
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::handCOM
Ice::FloatSeq handCOM
Definition: ControllerInterface.ice:235
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig
Definition: ControllerInterface.ice:166
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::Dnull
Ice::FloatSeq Dnull
Definition: ControllerInterface.ice:47
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::isLCRControlEnabled
bool isLCRControlEnabled
Definition: ControllerInterface.ice:210
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::desiredNullSpaceJointValues
Ice::FloatSeq desiredNullSpaceJointValues
Definition: ControllerInterface.ice:187
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::NJointAdaptiveWipingControllerConfig::forceDeadZone
float forceDeadZone
Definition: ControllerInterface.ice:126
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::Kori
Ice::FloatSeq Kori
Definition: ControllerInterface.ice:191
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::adaptForceCoeff
float adaptForceCoeff
Definition: ControllerInterface.ice:230
armarx::NJointAdaptiveWipingControllerConfig::handMass
float handMass
Definition: ControllerInterface.ice:145
armarx::NJointTaskSpaceAdaptiveDMPControllerConfig::Dpos
Ice::FloatSeq Dpos
Definition: ControllerInterface.ice:43
armarx::NJointAnomalyDetectionAdaptiveWipingControllerConfig::handMass
float handMass
Definition: ControllerInterface.ice:236
armarx::NJointAdaptiveWipingControllerConfig::Dori
Ice::FloatSeq Dori
Definition: ControllerInterface.ice:112
armarx::NJointAdaptiveWipingControllerConfig::angularKp
float angularKp
Definition: ControllerInterface.ice:146
armarx::NJointAdaptiveWipingControllerConfig::maxJointTorque
float maxJointTorque
Definition: ControllerInterface.ice:108