5 #include <VirtualRobot/Robot.h>
6 #include <VirtualRobot/IK/DifferentialIK.h>
9 #include <dmp/representation/dmp/umitsmp.h>
19 #include <armarx/control/deprecated_njoint_mp_controller/task_space/ControllerInterface.h>
28 using ViaPoint = std::pair<double, DMP::DVec >;
57 float derivative = (error - lastError) /
dt;
58 float retVal = Kp * error + Kd * derivative;
68 std::string
getClassName(
const Ice::Current&)
const override;
75 void learnDMPFromFiles(
int dmpId,
const Ice::StringSeq& fileNames,
const Ice::Current&)
override;
81 void runDMP(
const Ice::Current&)
override;
84 void setGoals(
int dmpId,
const Ice::DoubleSeq& goals,
const Ice::Current&)
override;
87 void setTorqueKp(
const StringFloatDictionary& torqueKp,
const Ice::Current&)
override;
100 struct DebugBufferData
102 StringFloatDictionary latestTargetVelocities;
103 StringFloatDictionary dmpTargets;
104 StringFloatDictionary realTCP;
117 struct NJointCCDMPControllerSensorData
125 std::vector<const SensorValue1DoFActuatorTorque*> torqueSensors;
126 std::vector<const SensorValue1DoFGravityTorque*> gravityTorqueSensors;
127 std::vector<ControlTarget1DoFActuatorVelocity*> targets;
130 std::vector<pidController> torquePIDs;
132 std::string nodeSetName;
135 std::vector<DMP::UMITSMPPtr > dmpPtrList;
136 std::vector<double> canVals;
137 std::vector<double> timeDurations;
138 std::vector<std::string > dmpTypes;
139 std::vector<double> amplitudes;
141 std::vector<DMP::Vec<DMP::DMPState > > currentStates;
142 std::vector<DMP::DVec > targetSubStates;
158 double posToOriRatio;
160 Eigen::VectorXf targetVels;
162 std::vector<int> learnedDMP;
168 NJointCCDMPControllerConfigPtr cfg;
169 VirtualRobot::RobotNodePtr tcp;
170 Eigen::Vector3f tcpPosition;
174 VirtualRobot::DifferentialIKPtr ik;