3 #include <VirtualRobot/VirtualRobot.h>
9 #include <armarx/control/deprecated_njoint_mp_controller/bimanual/ObjLevelControllerInterface.h>
13 class SensorValue1DoFActuatorTorque;
14 class SensorValue1DoFActuatorVelocity;
15 class SensorValue1DoFActuatorPosition;
16 class SensorValue1DoFActuatorAcceleration;
17 class ControlTarget1DoFActuatorTorque;
18 class SensorValueForceTorque;
43 const NJointControllerConfigPtr& config,
77 void runDMP(
const Ice::DoubleSeq& goals,
Ice::Double timeDuration,
const Ice::Current&);
79 const Ice::DoubleSeq& goals,
83 void setGoals(
const Ice::DoubleSeq& goals,
const Ice::Current&);
102 void setMPWeights(
const DoubleSeqSeq& weights,
const Ice::Current&);
105 void setMPRotWeights(
const DoubleSeqSeq& weights,
const Ice::Current&);
118 Eigen::VectorXf targetWrench;
120 struct DebugBufferData
122 StringFloatDictionary desired_torques;
153 float modifiedPoseRight_x;
154 float modifiedPoseRight_y;
155 float modifiedPoseRight_z;
156 float currentPoseLeft_x;
157 float currentPoseLeft_y;
158 float currentPoseLeft_z;
168 float modifiedPoseLeft_x;
169 float modifiedPoseLeft_y;
170 float modifiedPoseLeft_z;
171 float currentPoseRight_x;
172 float currentPoseRight_y;
173 float currentPoseRight_z;
183 float modifiedTwist_lx;
184 float modifiedTwist_ly;
185 float modifiedTwist_lz;
186 float modifiedTwist_rx;
187 float modifiedTwist_ry;
188 float modifiedTwist_rz;
194 Eigen::VectorXf wrenchDMP;
195 Eigen::VectorXf computedBoxWrench;
197 Eigen::VectorXf forceImpedance;
198 Eigen::VectorXf forcePID;
199 Eigen::VectorXf forcePIDControlValue;
200 Eigen::VectorXf poseError;
201 Eigen::VectorXf wrenchesConstrained;
202 Eigen::VectorXf wrenchesMeasuredInRoot;
207 struct rt2ControlData
212 Eigen::VectorXf currentTwist;
217 struct ControlInterfaceData
222 Eigen::Vector3f currentObjVel;
223 Eigen::Vector3f currentObjForce;
228 struct Inferface2rtData
230 Eigen::VectorXf KpImpedance;
231 Eigen::VectorXf KdImpedance;
232 Eigen::VectorXf KmAdmittance;
233 Eigen::VectorXf KpAdmittance;
234 Eigen::VectorXf KdAdmittance;
237 TripleBuffer<Inferface2rtData> interface2rtBuffer;
240 std::vector<ControlTarget1DoFActuatorTorque*> leftTargets;
241 std::vector<const SensorValue1DoFActuatorAcceleration*> leftAccelerationSensors;
242 std::vector<const SensorValue1DoFActuatorVelocity*> leftVelocitySensors;
243 std::vector<const SensorValue1DoFActuatorPosition*> leftPositionSensors;
245 std::vector<ControlTarget1DoFActuatorTorque*> rightTargets;
246 std::vector<const SensorValue1DoFActuatorAcceleration*> rightAccelerationSensors;
247 std::vector<const SensorValue1DoFActuatorVelocity*> rightVelocitySensors;
248 std::vector<const SensorValue1DoFActuatorPosition*> rightPositionSensors;
250 const SensorValueForceTorque* rightForceTorque;
251 const SensorValueForceTorque* leftForceTorque;
253 NJointBimanualObjLevelControllerConfigPtr cfg;
254 VirtualRobot::DifferentialIKPtr leftIK;
255 VirtualRobot::DifferentialIKPtr rightIK;
263 Eigen::VectorXf leftDesiredJointValues;
264 Eigen::VectorXf rightDesiredJointValues;
270 Eigen::VectorXf KpImpedance;
271 Eigen::VectorXf KdImpedance;
272 Eigen::VectorXf KpAdmittance;
273 Eigen::VectorXf KdAdmittance;
274 Eigen::VectorXf KmAdmittance;
275 Eigen::VectorXf KmPID;
277 Eigen::VectorXf virtualAcc;
278 Eigen::VectorXf virtualVel;
286 Eigen::Vector3f CoMVecLeft;
287 Eigen::Vector3f forceOffsetLeft;
288 Eigen::Vector3f torqueOffsetLeft;
291 Eigen::Vector3f CoMVecRight;
292 Eigen::Vector3f forceOffsetRight;
293 Eigen::Vector3f torqueOffsetRight;
298 std::vector<std::string> leftJointNames;
299 std::vector<std::string> rightJointNames;
302 VirtualRobot::RobotNodeSetPtr leftRNS;
303 VirtualRobot::RobotNodeSetPtr rightRNS;
304 VirtualRobot::RobotNodePtr tcpLeft;
305 VirtualRobot::RobotNodePtr tcpRight;
307 std::vector<PIDControllerPtr> forcePIDControllers;
311 Eigen::VectorXf filteredOldValue;
314 double ftcalibrationTimer;
315 Eigen::VectorXf ftOffset;
318 Eigen::Vector3f objCom2TCPLeftInObjFrame, objCom2TCPRightInObjFrame;