ForceMPControllerInterface.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 module armarx
29 {
30  class NJointBimanualForceControllerConfig extends NJointControllerConfig
31  {
32 
33  // dmp configuration
34  int kernelSize = 100;
35  string dmpMode = "MinimumJerk";
36  string dmpType = "Discrete";
37 
38  // phaseStop technique
39  double phaseL = 10;
40  double phaseK = 10;
41  double phaseDist0 = 50;
42  double phaseDist1 = 10;
43  double phaseKpPos = 1;
44  double phaseKpOri = 0.1;
45  double posToOriRatio = 10;
46  double timeDuration = 10;
47 
48  Ice::DoubleSeq boxInitialPose;
49  float boxWidth;
50  Ice::FloatSeq leftDesiredJointValues;
51  Ice::FloatSeq rightDesiredJointValues;
52 
53  // impedance, admittance, object motion parameters
54  Ice::FloatSeq KpImpedance;
55  Ice::FloatSeq KdImpedance;
56  Ice::FloatSeq KpAdmittance;
57  Ice::FloatSeq KdAdmittance;
58  Ice::FloatSeq KmAdmittance;
59  Ice::FloatSeq KmPID;
60  // Ice::FloatSeq objectKp;
61  // Ice::FloatSeq objectKd;
62 
63  // pid force controller parameters
64  Ice::FloatSeq targetWrench;
65  Ice::FloatSeq forceP;
66  Ice::FloatSeq forceI;
67  Ice::FloatSeq forceD;
68  Ice::FloatSeq forcePIDLimits;
69 
70  float filterCoeff;
71 
72 
73  float massLeft;
74  Ice::FloatSeq CoMVecLeft;
75  Ice::FloatSeq forceOffsetLeft;
76  Ice::FloatSeq torqueOffsetLeft;
77 
78  float massRight;
79  Ice::FloatSeq CoMVecRight;
80  Ice::FloatSeq forceOffsetRight;
81  Ice::FloatSeq torqueOffsetRight;
82 
83  // // flags for testing variants
84  // int dmpFeedType; // 0: no dmp, 1: frame, 2: vel, 3: acc, 4: force
85  // int method; // 1,2,3,4 four diffrent method w.r.t inertia trick; default (0): normal method
86  // int jcMethod; // 0: lin's paper, default: Jc = J
87  // int pdotMethod; // 0: numerical differential, 1: paper, Tau - Tau.Transpose, 2 test, default: zero matrix
88  // int graspingType; // 0: fixed to obj, 1, fixed to hand, 2, dynamically from hand pose, defualt: identity
89 
90  float knull;
91  float dnull;
92 
93  float torqueLimit;
94 
96 
97  };
98 
99  interface NJointBimanualForceControllerInterface extends NJointControllerInterface
100  {
101  void learnDMPFromFiles(Ice::StringSeq trajfiles);
102  bool isFinished();
103  void runDMP(Ice::DoubleSeq goals);
104 
105  // void setViaPoints(double canVal, Ice::DoubleSeq point);
106  void setGoals(Ice::DoubleSeq goals);
107  void setViaPoints(double u, Ice::DoubleSeq viapoint);
108  double getVirtualTime();
109 
110 
111  };
112 
113  class NJointBimanualForceMPControllerConfig extends NJointControllerConfig
114  {
115 
116  // dmp configuration
117  int kernelSize = 100;
118  string dmpMode = "MinimumJerk";
119  string dmpStyle = "Discrete";
120  double dmpAmplitude = 1;
121 
122  double phaseL = 10;
123  double phaseK = 10;
124  double phaseDist0 = 50;
125  double phaseDist1 = 10;
126  double phaseKpPos = 1;
127  double phaseKpOri = 0.1;
128  double timeDuration = 10;
129  double posToOriRatio = 100;
130 
131  double maxLinearVel;
133 
134  // velocity control
139 
140  // force control
141  float forceP;
142  float forceI;
143  float forceD;
144 
145  float filterCoeff;
147 
149  Ice::FloatSeq leftForceOffset;
150  Ice::FloatSeq rightForceOffset;
151 
152  string debugName;
153 
154  };
155 
156 
157  interface NJointBimanualForceMPControllerInterface extends NJointControllerInterface
158  {
159  void learnDMPFromFiles(string whichMP, Ice::StringSeq trajfiles);
160  bool isFinished();
161  void runDMP(Ice::DoubleSeq leftGoals, Ice::DoubleSeq rightGoals);
162  double getCanVal();
163 
164  void setViaPoints(string whichDMP, double canVal, Ice::DoubleSeq viaPoint);
165  };
166 };
167 
armarx::NJointBimanualForceControllerConfig::targetWrench
Ice::FloatSeq targetWrench
Definition: ForceMPControllerInterface.ice:64
armarx::NJointBimanualForceMPControllerConfig::debugName
string debugName
Definition: ForceMPControllerInterface.ice:152
armarx::NJointBimanualForceControllerConfig::KmPID
Ice::FloatSeq KmPID
Definition: ForceMPControllerInterface.ice:59
armarx::NJointBimanualForceControllerConfig::boxInitialPose
Ice::DoubleSeq boxInitialPose
Definition: ForceMPControllerInterface.ice:48
armarx::NJointBimanualForceControllerConfig::boxWidth
float boxWidth
Definition: ForceMPControllerInterface.ice:49
armarx::NJointBimanualForceMPControllerConfig::leftForceOffset
Ice::FloatSeq leftForceOffset
Definition: ForceMPControllerInterface.ice:149
armarx::NJointBimanualForceControllerConfig::massLeft
float massLeft
Definition: ForceMPControllerInterface.ice:73
armarx::NJointBimanualForceControllerConfig::torqueLimit
float torqueLimit
Definition: ForceMPControllerInterface.ice:93
armarx::NJointBimanualForceControllerConfig::KdAdmittance
Ice::FloatSeq KdAdmittance
Definition: ForceMPControllerInterface.ice:57
armarx::NJointBimanualForceMPControllerConfig::Kd_AngularVel
float Kd_AngularVel
Definition: ForceMPControllerInterface.ice:138
armarx::NJointBimanualForceControllerConfig::forceThreshold
float forceThreshold
Definition: ForceMPControllerInterface.ice:95
armarx::NJointBimanualForceControllerConfig::forceD
Ice::FloatSeq forceD
Definition: ForceMPControllerInterface.ice:67
armarx::NJointBimanualForceMPControllerConfig::targetSupportForce
float targetSupportForce
Definition: ForceMPControllerInterface.ice:148
armarx::NJointBimanualForceControllerConfig
Definition: ForceMPControllerInterface.ice:30
armarx::NJointBimanualForceMPControllerConfig::Kd_LinearVel
float Kd_LinearVel
Definition: ForceMPControllerInterface.ice:136
armarx::NJointBimanualForceControllerConfig::dnull
float dnull
Definition: ForceMPControllerInterface.ice:91
armarx::NJointBimanualForceMPControllerConfig::forceD
float forceD
Definition: ForceMPControllerInterface.ice:143
armarx::NJointBimanualForceMPControllerConfig
Definition: ForceMPControllerInterface.ice:113
armarx::NJointBimanualForceMPControllerConfig::filterCoeff
float filterCoeff
Definition: ForceMPControllerInterface.ice:145
armarx::NJointBimanualForceControllerConfig::torqueOffsetLeft
Ice::FloatSeq torqueOffsetLeft
Definition: ForceMPControllerInterface.ice:76
armarx::NJointBimanualForceMPControllerConfig::Kp_AngularVel
float Kp_AngularVel
Definition: ForceMPControllerInterface.ice:137
armarx::NJointBimanualForceControllerConfig::knull
float knull
Definition: ForceMPControllerInterface.ice:90
armarx::NJointBimanualForceControllerConfig::CoMVecRight
Ice::FloatSeq CoMVecRight
Definition: ForceMPControllerInterface.ice:79
armarx::NJointBimanualForceControllerConfig::leftDesiredJointValues
Ice::FloatSeq leftDesiredJointValues
Definition: ForceMPControllerInterface.ice:50
armarx::NJointBimanualForceControllerInterface
Definition: ForceMPControllerInterface.ice:99
armarx::NJointBimanualForceControllerConfig::forceP
Ice::FloatSeq forceP
Definition: ForceMPControllerInterface.ice:65
armarx::NJointBimanualForceControllerConfig::KdImpedance
Ice::FloatSeq KdImpedance
Definition: ForceMPControllerInterface.ice:55
armarx::NJointBimanualForceControllerConfig::forceI
Ice::FloatSeq forceI
Definition: ForceMPControllerInterface.ice:66
armarx::NJointBimanualForceMPControllerConfig::KpJointLimitAvoidanceScale
float KpJointLimitAvoidanceScale
Definition: ForceMPControllerInterface.ice:146
armarx::NJointBimanualForceControllerConfig::torqueOffsetRight
Ice::FloatSeq torqueOffsetRight
Definition: ForceMPControllerInterface.ice:81
armarx::NJointBimanualForceControllerConfig::KpAdmittance
Ice::FloatSeq KpAdmittance
Definition: ForceMPControllerInterface.ice:56
armarx::NJointBimanualForceMPControllerConfig::rightForceOffset
Ice::FloatSeq rightForceOffset
Definition: ForceMPControllerInterface.ice:150
armarx::NJointBimanualForceControllerConfig::forceOffsetRight
Ice::FloatSeq forceOffsetRight
Definition: ForceMPControllerInterface.ice:80
armarx::NJointBimanualForceMPControllerInterface
Definition: ForceMPControllerInterface.ice:157
armarx::NJointBimanualForceControllerConfig::CoMVecLeft
Ice::FloatSeq CoMVecLeft
Definition: ForceMPControllerInterface.ice:74
armarx::NJointBimanualForceControllerConfig::filterCoeff
float filterCoeff
Definition: ForceMPControllerInterface.ice:70
armarx::NJointBimanualForceMPControllerConfig::forceP
float forceP
Definition: ForceMPControllerInterface.ice:141
armarx::NJointBimanualForceMPControllerConfig::maxLinearVel
double maxLinearVel
Definition: ForceMPControllerInterface.ice:131
armarx::NJointBimanualForceControllerConfig::forceOffsetLeft
Ice::FloatSeq forceOffsetLeft
Definition: ForceMPControllerInterface.ice:75
armarx::NJointBimanualForceMPControllerConfig::Kp_LinearVel
float Kp_LinearVel
Definition: ForceMPControllerInterface.ice:135
armarx::NJointBimanualForceMPControllerConfig::maxAngularVel
double maxAngularVel
Definition: ForceMPControllerInterface.ice:132
armarx::NJointBimanualForceMPControllerConfig::forceI
float forceI
Definition: ForceMPControllerInterface.ice:142
armarx::NJointBimanualForceControllerConfig::rightDesiredJointValues
Ice::FloatSeq rightDesiredJointValues
Definition: ForceMPControllerInterface.ice:51
armarx::NJointBimanualForceControllerConfig::massRight
float massRight
Definition: ForceMPControllerInterface.ice:78
armarx::NJointBimanualForceControllerConfig::KpImpedance
Ice::FloatSeq KpImpedance
Definition: ForceMPControllerInterface.ice:54
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::NJointBimanualForceControllerConfig::forcePIDLimits
Ice::FloatSeq forcePIDLimits
Definition: ForceMPControllerInterface.ice:68
armarx::NJointBimanualForceControllerConfig::KmAdmittance
Ice::FloatSeq KmAdmittance
Definition: ForceMPControllerInterface.ice:58