5 #include <VirtualRobot/Robot.h>
6 #include <VirtualRobot/IK/DifferentialIK.h>
18 #include <armarx/control/deprecated_njoint_mp_controller/bimanual/ObjLevelControllerInterface.h>
72 void runDMP(
const Ice::DoubleSeq& goals,
Ice::Double timeDuration,
const Ice::Current&);
75 void setGoals(
const Ice::DoubleSeq& goals,
const Ice::Current&);
93 void setMPWeights(
const DoubleSeqSeq& weights,
const Ice::Current&);
106 Eigen::VectorXf targetWrench;
107 struct DebugBufferData
109 StringFloatDictionary desired_torques;
140 float modifiedPoseRight_x;
141 float modifiedPoseRight_y;
142 float modifiedPoseRight_z;
143 float currentPoseLeft_x;
144 float currentPoseLeft_y;
145 float currentPoseLeft_z;
155 float modifiedPoseLeft_x;
156 float modifiedPoseLeft_y;
157 float modifiedPoseLeft_z;
158 float currentPoseRight_x;
159 float currentPoseRight_y;
160 float currentPoseRight_z;
170 float modifiedTwist_lx;
171 float modifiedTwist_ly;
172 float modifiedTwist_lz;
173 float modifiedTwist_rx;
174 float modifiedTwist_ry;
175 float modifiedTwist_rz;
181 Eigen::VectorXf wrenchDMP;
182 Eigen::VectorXf computedBoxWrench;
184 Eigen::VectorXf forceImpedance;
185 Eigen::VectorXf forcePID;
186 Eigen::VectorXf forcePIDControlValue;
187 Eigen::VectorXf poseError;
188 Eigen::VectorXf wrenchesConstrained;
189 Eigen::VectorXf wrenchesMeasuredInRoot;
193 struct rt2ControlData
198 Eigen::VectorXf currentTwist;
202 struct ControlInterfaceData
207 Eigen::Vector3f currentObjVel;
208 Eigen::Vector3f currentObjForce;
213 struct Inferface2rtData
215 Eigen::VectorXf KpImpedance;
216 Eigen::VectorXf KdImpedance;
217 Eigen::VectorXf KmAdmittance;
218 Eigen::VectorXf KpAdmittance;
219 Eigen::VectorXf KdAdmittance;
221 TripleBuffer<Inferface2rtData> interface2rtBuffer;
225 std::vector<ControlTarget1DoFActuatorTorque*> leftTargets;
226 std::vector<const SensorValue1DoFActuatorAcceleration*> leftAccelerationSensors;
227 std::vector<const SensorValue1DoFActuatorVelocity*> leftVelocitySensors;
228 std::vector<const SensorValue1DoFActuatorPosition*> leftPositionSensors;
230 std::vector<ControlTarget1DoFActuatorTorque*> rightTargets;
231 std::vector<const SensorValue1DoFActuatorAcceleration*> rightAccelerationSensors;
232 std::vector<const SensorValue1DoFActuatorVelocity*> rightVelocitySensors;
233 std::vector<const SensorValue1DoFActuatorPosition*> rightPositionSensors;
235 const SensorValueForceTorque* rightForceTorque;
236 const SensorValueForceTorque* leftForceTorque;
238 NJointBimanualObjLevelControllerConfigPtr cfg;
239 VirtualRobot::DifferentialIKPtr leftIK;
240 VirtualRobot::DifferentialIKPtr rightIK;
248 Eigen::VectorXf leftDesiredJointValues;
249 Eigen::VectorXf rightDesiredJointValues;
255 Eigen::VectorXf KpImpedance;
256 Eigen::VectorXf KdImpedance;
257 Eigen::VectorXf KpAdmittance;
258 Eigen::VectorXf KdAdmittance;
259 Eigen::VectorXf KmAdmittance;
260 Eigen::VectorXf KmPID;
262 Eigen::VectorXf virtualAcc;
263 Eigen::VectorXf virtualVel;
271 Eigen::Vector3f CoMVecLeft;
272 Eigen::Vector3f forceOffsetLeft;
273 Eigen::Vector3f torqueOffsetLeft;
276 Eigen::Vector3f CoMVecRight;
277 Eigen::Vector3f forceOffsetRight;
278 Eigen::Vector3f torqueOffsetRight;
283 std::vector<std::string> leftJointNames;
284 std::vector<std::string> rightJointNames;
287 VirtualRobot::RobotNodeSetPtr leftRNS;
288 VirtualRobot::RobotNodeSetPtr rightRNS;
289 VirtualRobot::RobotNodePtr tcpLeft;
290 VirtualRobot::RobotNodePtr tcpRight;
292 std::vector<PIDControllerPtr> forcePIDControllers;
296 Eigen::VectorXf filteredOldValue;
299 double ftcalibrationTimer;
300 Eigen::VectorXf ftOffset;
303 Eigen::Vector3f objCom2TCPLeftInObjFrame, objCom2TCPRightInObjFrame;