4 #include <VirtualRobot/Robot.h>
5 #include <VirtualRobot/IK/DifferentialIK.h>
14 #include <dmp/representation/dmp/umidmp.h>
16 #include <armarx/control/deprecated_njoint_mp_controller/task_space/ControllerInterface.h>
48 using ConfigPtrT = DeprecatedNJointTaskSpaceImpedanceDMPControllerConfigPtr;
52 std::string
getClassName(
const Ice::Current&)
const override;
59 void learnDMPFromFiles(
const Ice::StringSeq& fileNames,
const Ice::Current&)
override;
71 void setGoals(
const Ice::DoubleSeq& goals,
const Ice::Current&)
override;
73 void learnJointDMPFromFiles(
const std::string& fileName,
const Ice::FloatSeq& currentJVS,
const Ice::Current&)
override;
74 void runDMP(
const Ice::DoubleSeq& goals,
const Ice::Current& iceCurrent = Ice::emptyCurrent)
override;
79 return dmpCtrl->canVal;
82 void stopDMP(
const Ice::Current&)
override;
83 void resumeDMP(
const Ice::Current&)
override;
84 void resetDMP(
const Ice::Current&)
override;
86 void setMPWeights(
const DoubleSeqSeq& weights,
const Ice::Current&)
override;
106 useForceStop =
false;
126 struct DebugBufferData
128 double currentCanVal;
141 float currentPose_qw;
142 float currentPose_qx;
143 float currentPose_qy;
144 float currentPose_qz;
152 float currentKnull_x;
153 float currentKnull_y;
154 float currentKnull_z;
162 float currentDnull_x;
163 float currentDnull_y;
164 float currentDnull_z;
166 StringFloatDictionary desired_torques;
167 StringFloatDictionary desired_nullspaceJoint;
168 float forceDesired_x;
169 float forceDesired_y;
170 float forceDesired_z;
171 float forceDesired_rx;
172 float forceDesired_ry;
173 float forceDesired_rz;
175 Eigen::Vector3f filteredForceInRoot;
185 struct DeprecatedNJointTaskSpaceImpedanceDMPControllerSensorData
190 Eigen::VectorXf currentTwist;
194 struct DeprecatedNJointTaskSpaceImpedanceDMPControllerInterfaceData
203 Eigen::Vector3f kpos;
204 Eigen::Vector3f dpos;
205 Eigen::Vector3f kori;
206 Eigen::Vector3f dori;
207 Eigen::VectorXf knull;
208 Eigen::VectorXf dnull;
211 WriteBufferedTripleBuffer<CtrlParams> ctrlParams;
215 DMP::Vec<DMP::DMPState> currentJointState;
216 DMP::UMIDMPPtr nullSpaceJointDMPPtr;
220 std::vector<const SensorValue1DoFActuatorTorque*> torqueSensors;
221 std::vector<const SensorValue1DoFActuatorVelocity*> velocitySensors;
222 std::vector<const SensorValue1DoFActuatorPosition*> positionSensors;
223 std::vector<ControlTarget1DoFActuatorTorque*> targets;
229 VirtualRobot::RobotNodeSetPtr rns;
236 double posToOriRatio;
239 DeprecatedNJointTaskSpaceImpedanceDMPControllerConfigPtr cfg;
240 VirtualRobot::DifferentialIKPtr ik;
241 VirtualRobot::RobotNodePtr tcp;
253 std::atomic_bool useNullSpaceJointDMP;
254 bool isNullSpaceJointDMPLearned;
257 WriteBufferedTripleBuffer<Eigen::VectorXf> defaultNullSpaceJointValues;
258 std::vector<std::string> jointNames;
262 bool started =
false;
263 bool stopped =
false;
267 Eigen::Vector3f filteredForce;
268 Eigen::Vector3f forceOffset;
269 Eigen::Vector3f filteredForceInRoot;
270 WriteBufferedTripleBuffer<Eigen::Vector3f> forceThreshold;
271 std::atomic<bool> useForceStop;
272 std::atomic<float> timeForCalibration;
273 const SensorValueForceTorque* forceSensor;