diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThreadDataBuffer.cpp b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThreadDataBuffer.cpp index 65efa415f3a5afce1813a1653f35494229ae3a83..928863b7eda26cb57176737588ed30cfb8fb9629 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThreadDataBuffer.cpp +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControlThreadDataBuffer.cpp @@ -121,7 +121,6 @@ namespace armarx bool ControlThreadDataBuffer::sensorAndControlBufferChanged() const { throwIfInControlThread(BOOST_CURRENT_FUNCTION); - auto guard = getGuard(); throwIfDevicesNotReady(__FUNCTION__); return controlThreadOutputBuffer.updateReadBuffer(); } @@ -129,7 +128,6 @@ namespace armarx const SensorAndControl& ControlThreadDataBuffer::getSensorAndControlBuffer() const { throwIfInControlThread(BOOST_CURRENT_FUNCTION); - auto guard = getGuard(); throwIfDevicesNotReady(__FUNCTION__); return controlThreadOutputBuffer.getReadBuffer(); } @@ -137,7 +135,6 @@ namespace armarx void ControlThreadDataBuffer::writeRequestedControllers(JointAndNJointControllers&& setOfControllers) { throwIfInControlThread(BOOST_CURRENT_FUNCTION); - auto guard = getGuard(); throwIfDevicesNotReady(__FUNCTION__); //check NJoint const auto& nJointCtrls = setOfControllers.nJointControllers; @@ -235,7 +232,7 @@ namespace armarx void ControlThreadDataBuffer::setActivateControllersRequest(std::set<NJointControllerPtr, std::greater<NJointControllerPtr>> ctrls) { throwIfInControlThread(BOOST_CURRENT_FUNCTION); - auto guard = getGuard(); + std::lock_guard<std::recursive_mutex> guardRequested{controllersRequestedMutex}; throwIfDevicesNotReady(__FUNCTION__); //erase nullptr ctrls.erase(nullptr); diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.cpp b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.cpp index 7ae4497682950243bf5564de85197dc68fa2d591..824e460fae8e95cf628c8ab39fdecb05b22318cf 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.cpp +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.cpp @@ -66,14 +66,12 @@ namespace armarx Ice::StringSeq ControllerManagement::getRequestedNJointControllerNames(const Ice::Current&) const { throwIfInControlThread(BOOST_CURRENT_FUNCTION); - auto guard = getGuard(); return GetNonNullNames(_module<ControlThreadDataBuffer>().copyRequestedNJointControllers()); } Ice::StringSeq ControllerManagement::getActivatedNJointControllerNames(const Ice::Current&) const { throwIfInControlThread(BOOST_CURRENT_FUNCTION); - auto guard = getGuard(); return GetNonNullNames(_module<ControlThreadDataBuffer>().getActivatedNJointControllers()); } diff --git a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.h b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.h index 6530e53c19e35a6b9258eb8b12063ddae6ecc8a7..49c90c94937b26585e1998796e49e12db02b20d6 100644 --- a/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.h +++ b/source/RobotAPI/components/units/RobotUnit/RobotUnitModules/RobotUnitModuleControllerManagement.h @@ -429,6 +429,8 @@ namespace armarx std::map<std::string, NJointControllerPtr> nJointControllersToBeDeleted; /// @brief VirtualRobot used when creating controllers / calling other functions in this module VirtualRobot::RobotPtr controllerCreateRobot; + + std::recursive_mutex controllerMutex; // //////////////////////////////////////////////////////////////////////////////////////// // // /////////////////////////////////////// Attorneys ////////////////////////////////////// // // //////////////////////////////////////////////////////////////////////////////////////// //