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 = DeprecatedNJointTaskSpaceAdmittanceDMPControllerConfigPtr;
52 std::string
getClassName(
const Ice::Current&)
const override;
58 void learnDMPFromFiles(
const Ice::StringSeq& fileNames,
const Ice::Current&)
override;
62 void setGoals(
const Ice::DoubleSeq& goals,
const Ice::Current&)
override;
64 void learnJointDMPFromFiles(
const std::string& fileName,
const Ice::FloatSeq& currentJVS,
const Ice::Current&)
override;
65 void runDMP(
const Ice::DoubleSeq& goals,
const Ice::Current& iceCurrent = Ice::emptyCurrent)
override;
70 void stopDMP(
const Ice::Current&)
override;
71 void resumeDMP(
const Ice::Current&)
override;
72 void pauseDMP(
const Ice::Current&)
override;
73 void resetDMP(
const Ice::Current&)
override;
75 void setMPWeights(
const DoubleSeqSeq& weights,
const Ice::Current&)
override;
99 void setStartAndGoals(
const Ice::DoubleSeq& starts,
const Ice::DoubleSeq& goals,
const Ice::Current& ice)
override;
115 std::string kinematic_chain;
119 double currentCanVal;
132 float virtualPose_qw;
133 float virtualPose_qx;
134 float virtualPose_qy;
135 float virtualPose_qz;
140 float currentPose_qw;
141 float currentPose_qx;
142 float currentPose_qy;
143 float currentPose_qz;
151 float currentKnull_x;
152 float currentKnull_y;
153 float currentKnull_z;
161 float currentDnull_x;
162 float currentDnull_y;
163 float currentDnull_z;
165 StringFloatDictionary desired_torques;
166 StringFloatDictionary desired_nullspaceJoint;
167 float forceDesired_x;
168 float forceDesired_y;
169 float forceDesired_z;
170 float forceDesired_rx;
171 float forceDesired_ry;
172 float forceDesired_rz;
181 float ft_FilteredInRoot_x;
182 float ft_FilteredInRoot_y;
183 float ft_FilteredInRoot_z;
184 float ft_FilteredInRoot_rx;
185 float ft_FilteredInRoot_ry;
186 float ft_FilteredInRoot_rz;
192 Eigen::Vector3f forceBaseline;
193 Eigen::Vector3f torqueBaseline;
194 Eigen::Vector3f forceOffset;
195 Eigen::Vector3f torqueOffset;
205 Eigen::VectorXf currentTwist;
210 struct RT2InterfaceData
226 Eigen::VectorXf knull;
227 Eigen::VectorXf dnull;
229 Eigen::Vector3f forceBaseline;
230 Eigen::Vector3f torqueBaseline;
233 Eigen::Vector3f tcpCoMInForceSensorFrame;
246 std::vector<const SensorValue1DoFActuatorTorque*> torqueSensors;
247 std::vector<const SensorValue1DoFActuatorVelocity*> velocitySensors;
248 std::vector<const SensorValue1DoFActuatorPosition*> positionSensors;
249 std::vector<ControlTarget1DoFActuatorTorque*> targets;
251 VirtualRobot::DifferentialIKPtr ik;
252 VirtualRobot::RobotNodePtr tcp;
255 DMP::Vec<DMP::DMPState> currentJointState;
256 DMP::UMIDMPPtr nullSpaceJointDMPPtr;
260 DeprecatedNJointTaskSpaceAdmittanceDMPControllerConfigPtr cfg;
268 double posToOriRatio;
272 std::vector<std::string> jointNames;
274 std::atomic_bool useNullSpaceJointDMP;
275 bool isNullSpaceJointDMPLearned;
277 std::atomic_bool rtFirstRun =
true;
278 std::atomic_bool rtReady =
false;
279 std::atomic_bool mpRunning =
false;
280 std::atomic_bool mpFinished =
false;
283 Eigen::VectorXf qvel_filtered;
287 Eigen::Vector3f forceOffset;
288 Eigen::Vector3f torqueOffset;
289 Eigen::Vector3f filteredForce;
290 Eigen::Vector3f filteredTorque;
291 Eigen::Vector3f filteredForceInRoot;
292 Eigen::Vector3f filteredTorqueInRoot;
293 std::atomic<float> timeForCalibration;
295 std::atomic_bool enableTCPGravityCompensation;
297 Eigen::Vector3f tcpCoMInTCPFrame;