4 #include <VirtualRobot/VirtualRobot.h>
13 #include <armarx/control/deprecated_njoint_mp_controller/bimanual/ControllerInterface.h>
17 class SensorValue1DoFActuatorTorque;
18 class SensorValue1DoFActuatorVelocity;
19 class SensorValue1DoFActuatorPosition;
20 class SensorValue1DoFActuatorAcceleration;
21 class ControlTarget1DoFActuatorTorque;
22 class SensorValueForceTorque;
62 using ConfigPtrT = NJointBimanualCCDMPControllerConfigPtr;
64 const NJointControllerConfigPtr& config,
68 std::string
getClassName(
const Ice::Current&)
const override;
77 learnDMPFromFiles(
const std::string&,
const Ice::StringSeq&,
const Ice::Current&)
override;
80 void runDMP(
const Ice::DoubleSeq& leftGoals,
81 const Ice::DoubleSeq& rightGoals,
82 const Ice::Current&)
override;
85 void setGoals(
const Ice::DoubleSeq& goals,
const Ice::Current&)
override;
103 Eigen::VectorXf getControlWrench(
const Eigen::VectorXf& twist,
109 Eigen::Matrix4f getLocalPose(
const std::vector<double>& newCoordinateVec,
110 const std::vector<double>& globalTargetPoseVec);
112 struct DebugBufferData
114 StringFloatDictionary desired_torques;
115 StringFloatDictionary constrained_force;
116 float leftTargetPose_x;
117 float leftTargetPose_y;
118 float leftTargetPose_z;
119 float rightTargetPose_x;
120 float rightTargetPose_y;
121 float rightTargetPose_z;
123 float leftCurrentPose_x;
124 float leftCurrentPose_y;
125 float leftCurrentPose_z;
126 float rightCurrentPose_x;
127 float rightCurrentPose_y;
128 float rightCurrentPose_z;
130 float leftControlSignal_x;
131 float leftControlSignal_y;
132 float leftControlSignal_z;
133 float leftControlSignal_ro;
134 float leftControlSignal_pi;
135 float leftControlSignal_ya;
138 float rightControlSignal_x;
139 float rightControlSignal_y;
140 float rightControlSignal_z;
141 float rightControlSignal_ro;
142 float rightControlSignal_pi;
143 float rightControlSignal_ya;
167 struct NJointBimanualCCDMPControllerSensorData
173 Eigen::VectorXf currentLeftTwist;
174 Eigen::VectorXf currentRightTwist;
179 struct NJointBimanualCCDMPControllerInterfaceData
188 std::vector<ControlTarget1DoFActuatorTorque*> leftTargets;
189 std::vector<const SensorValue1DoFActuatorAcceleration*> leftAccelerationSensors;
190 std::vector<const SensorValue1DoFActuatorVelocity*> leftVelocitySensors;
191 std::vector<const SensorValue1DoFActuatorPosition*> leftPositionSensors;
193 std::vector<ControlTarget1DoFActuatorTorque*> rightTargets;
194 std::vector<const SensorValue1DoFActuatorAcceleration*> rightAccelerationSensors;
195 std::vector<const SensorValue1DoFActuatorVelocity*> rightVelocitySensors;
196 std::vector<const SensorValue1DoFActuatorPosition*> rightPositionSensors;
201 NJointBimanualCCDMPControllerConfigPtr cfg;
202 VirtualRobot::DifferentialIKPtr leftIK;
203 VirtualRobot::DifferentialIKPtr rightIK;
205 std::vector<tsvmp::TaskSpaceDMPControllerPtr> leftGroup;
206 std::vector<tsvmp::TaskSpaceDMPControllerPtr> rightGroup;
207 std::vector<tsvmp::TaskSpaceDMPControllerPtr> bothLeaderGroup;
210 std::string leaderName;
212 VirtualRobot::RobotNodePtr tcpLeft;
213 VirtualRobot::RobotNodePtr tcpRight;
220 Eigen::VectorXf leftDesiredJointValues;
221 Eigen::VectorXf rightDesiredJointValues;
223 Eigen::Vector3f leftKpos;
224 Eigen::Vector3f leftKori;
225 Eigen::Vector3f leftDpos;
226 Eigen::Vector3f leftDori;
228 Eigen::Vector3f rightKpos;
229 Eigen::Vector3f rightKori;
230 Eigen::Vector3f rightDpos;
231 Eigen::Vector3f rightDori;
237 std::vector<std::string> leftJointNames;
238 std::vector<std::string> rightJointNames;
241 VirtualRobot::RobotNodeSetPtr leftRNS;
242 VirtualRobot::RobotNodeSetPtr rightRNS;
244 Eigen::VectorXf leftNullSpaceCoefs;
245 Eigen::VectorXf rightNullSpaceCoefs;
248 float startReduceTorque;