diff --git a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.cpp b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.cpp index b0dbb2e71f80899d98427a742988be7826f8a165..5f00a2f49a14d73c889b0b967e600e95ac1311e2 100644 --- a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.cpp +++ b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.cpp @@ -4,22 +4,22 @@ namespace armarx { NJointControllerRegistration<NJointBimanualCCDMPController> registrationControllerNJointBimanualCCDMPController("NJointBimanualCCDMPController"); - NJointBimanualCCDMPController::NJointBimanualCCDMPController(armarx::NJointControllerDescriptionProviderInterfacePtr prov, const armarx::NJointControllerConfigPtr& config, const VirtualRobot::RobotPtr&) + NJointBimanualCCDMPController::NJointBimanualCCDMPController(const RobotUnitPtr& robotUnit, const armarx::NJointControllerConfigPtr& config, const VirtualRobot::RobotPtr&) { ARMARX_INFO << "Preparing ... "; cfg = NJointBimanualCCDMPControllerConfigPtr::dynamicCast(config); - ARMARX_CHECK_EXPRESSION(prov); - RobotUnitPtr robotUnit = RobotUnitPtr::dynamicCast(prov); + ARMARX_CHECK_EXPRESSION(robotUnit); + useSynchronizedRtRobot(); - leftRNS = robotUnit->getRtRobot()->getRobotNodeSet("LeftArm"); + leftRNS = rtGetRobot()->getRobotNodeSet("LeftArm"); for (size_t i = 0; i < leftRNS->getSize(); ++i) { std::string jointName = leftRNS->getNode(i)->getName(); leftJointNames.push_back(jointName); - ControlTargetBase* ct = prov->getControlTarget(jointName, ControlModes::Torque1DoF); - const SensorValueBase* sv = prov->getSensorValue(jointName); + ControlTargetBase* ct = useControlTarget(jointName, ControlModes::Torque1DoF); + const SensorValueBase* sv = useSensorValue(jointName); leftTargets.push_back(ct->asA<ControlTarget1DoFActuatorTorque>()); const SensorValue1DoFActuatorVelocity* velocitySensor = sv->asA<SensorValue1DoFActuatorVelocity>(); const SensorValue1DoFActuatorPosition* positionSensor = sv->asA<SensorValue1DoFActuatorPosition>(); @@ -50,13 +50,13 @@ namespace armarx - rightRNS = robotUnit->getRtRobot()->getRobotNodeSet("RightArm"); + rightRNS = rtGetRobot()->getRobotNodeSet("RightArm"); for (size_t i = 0; i < rightRNS->getSize(); ++i) { std::string jointName = rightRNS->getNode(i)->getName(); rightJointNames.push_back(jointName); - ControlTargetBase* ct = prov->getControlTarget(jointName, ControlModes::Torque1DoF); - const SensorValueBase* sv = prov->getSensorValue(jointName); + ControlTargetBase* ct = useControlTarget(jointName, ControlModes::Torque1DoF); + const SensorValueBase* sv = useSensorValue(jointName); rightTargets.push_back(ct->asA<ControlTarget1DoFActuatorTorque>()); const SensorValue1DoFActuatorVelocity* velocitySensor = sv->asA<SensorValue1DoFActuatorVelocity>(); const SensorValue1DoFActuatorPosition* positionSensor = sv->asA<SensorValue1DoFActuatorPosition>(); @@ -83,9 +83,9 @@ namespace armarx }; - const SensorValueBase* svlf = prov->getSensorValue("FT L"); + const SensorValueBase* svlf = useSensorValue("FT L"); leftForceTorque = svlf->asA<SensorValueForceTorque>(); - const SensorValueBase* svrf = prov->getSensorValue("FT R"); + const SensorValueBase* svrf = useSensorValue("FT R"); rightForceTorque = svrf->asA<SensorValueForceTorque>(); leftIK.reset(new VirtualRobot::DifferentialIK(leftRNS, leftRNS->getRobot()->getRootNode(), VirtualRobot::JacobiProvider::eSVDDamped)); diff --git a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.h b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.h index ee7f250502ec24d64950d9ab09884d1cc93d64d9..300a523d58889891b06c0753cdeb3cd151ffb3ac 100644 --- a/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.h +++ b/source/RobotAPI/libraries/RobotAPINJointControllers/DMPController/NJointBimanualCCDMPController.h @@ -41,7 +41,7 @@ namespace armarx { public: using ConfigPtrT = NJointBimanualCCDMPControllerConfigPtr; - NJointBimanualCCDMPController(NJointControllerDescriptionProviderInterfacePtr prov, const NJointControllerConfigPtr& config, const VirtualRobot::RobotPtr&); + NJointBimanualCCDMPController(const RobotUnitPtr& robotUnit, const NJointControllerConfigPtr& config, const VirtualRobot::RobotPtr&); // NJointControllerInterface interface std::string getClassName(const Ice::Current&) const;