5 #include <VirtualRobot/Robot.h>
6 #include <VirtualRobot/IK/DifferentialIK.h>
17 #include <armarx/control/deprecated_njoint_mp_controller/task_space/ControllerInterface.h>
46 using ConfigPtrT = DeprecatedNJointPeriodicTSDMPCompliantControllerConfigPtr;
57 void learnDMPFromFiles(
const Ice::StringSeq& fileNames,
const Ice::Current&)
override;
62 void setGoals(
const Ice::DoubleSeq& goals,
const Ice::Current&)
override;
64 void runDMP(
const Ice::DoubleSeq& goals,
Ice::Double tau,
const Ice::Current&)
override;
66 void stopDMP(
const Ice::Current&)
override;
67 void resumeDMP(
const Ice::Current&)
override;
68 void pauseDMP(
const Ice::Current&)
override;
69 void resetDMP(
const Ice::Current&)
override;
72 double getCanVal(
const Ice::Current&)
override;
89 std::string kinematic_chain;
96 Eigen::VectorXf knull;
97 Eigen::VectorXf dnull;
99 Eigen::Vector4f pidForce;
102 Eigen::Vector3f tcpCoMInForceSensorFrame;
109 StringFloatDictionary latestTargetVelocities;
110 StringFloatDictionary currentPose;
111 double currentCanVal;
125 Eigen::Vector3f filteredForce;
126 Eigen::Vector3f reactForce;
127 Eigen::VectorXf targetVel;
129 Eigen::Vector3f targetVelInTool;
140 Eigen::VectorXf currentTwist;
146 struct RT2InterfaceData
149 float waitTimeForCalibration;
151 TripleBuffer<RT2InterfaceData> rt2InterfaceBuffer;
157 std::vector<const SensorValue1DoFActuatorVelocity*> velocitySensors;
158 std::vector<const SensorValue1DoFActuatorPosition*> positionSensors;
159 std::vector<ControlTarget1DoFActuatorTorque*> targets;
163 VirtualRobot::DifferentialIKPtr ik;
164 VirtualRobot::RobotNodePtr tcp;
168 DeprecatedNJointPeriodicTSDMPCompliantControllerConfigPtr cfg;
181 std::vector<std::string> jointNames;
183 Eigen::VectorXf nullSpaceJointsVec;
187 std::atomic_bool rtFirstRun =
true;
188 std::atomic_bool rtReady =
false;
189 std::atomic_bool mpRunning =
false;
192 Eigen::VectorXf qvel_filtered;
195 const SensorValueForceTorque* forceSensor;
196 Eigen::Vector3f forceOffset;
197 Eigen::Vector3f torqueOffset;
198 Eigen::Vector3f filteredForce;
199 Eigen::Vector3f filteredTorque;
200 Eigen::Vector3f filteredForceInRoot;
201 Eigen::Vector3f filteredTorqueInRoot;
202 std::atomic<float> timeForCalibration;
204 std::atomic_bool enableTCPGravityCompensation;
206 Eigen::Vector3f tcpCoMInTCPFrame;
213 Eigen::Vector2f lastPosition;