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
30module armarx
31{
32 class NJointTaskSpaceAdaptiveDMPControllerConfig extends NJointControllerConfig
33 {
34
35 // dmp configuration
36 int kernelSize = 100;
37 string dmpMode = "MinimumJerk";
38 string dmpType = "Discrete";
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
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
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();
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;
122 float Kpf;
123
125
128
131
132 Ice::FloatSeq ws_x;
133 Ice::FloatSeq ws_y;
134 Ice::FloatSeq ws_z;
135
142
143 Ice::FloatSeq ftOffset;
144 Ice::FloatSeq handCOM;
145 float handMass;
148 };
149
150 interface NJointAdaptiveWipingControllerInterface extends NJointControllerInterface
151 {
152 void learnDMPFromFiles(Ice::StringSeq trajfiles);
153 void learnDMPFromTrajectory(TrajectoryBase trajectory);
154
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;
200
201 // anomaly detection and friction estimation
204
205 // pid params
211 Ice::FloatSeq pidForce;
212 Ice::FloatSeq pidRot;
213 Ice::FloatSeq pidTorque;
214 Ice::FloatSeq pidLCR;
215
219
222
223 Ice::FloatSeq ws_x;
224 Ice::FloatSeq ws_y;
225 Ice::FloatSeq ws_z;
226
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
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};
void learnDMPFromFiles(Ice::StringSeq trajfiles)
void learnDMPFromTrajectory(TrajectoryBase trajectory)
void runDMP(Ice::DoubleSeq goals, double tau)
void runDMPWithTime(Ice::DoubleSeq goals, double timeDuration)
void learnJointDMPFromFiles(string jointTrajFile, Ice::FloatSeq currentJVS)
void setDefaultJointValues(Ice::FloatSeq desiredJointVals)
void learnDMPFromFiles(Ice::StringSeq trajfiles)
void setViaPoints(double canVal, Ice::DoubleSeq point)
This file offers overloads of toIce() and fromIce() functions for STL container types.