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