diff --git a/source/RobotAPI/components/units/KinematicUnitSimulation.cpp b/source/RobotAPI/components/units/KinematicUnitSimulation.cpp index 519eec8b6053a988101387a8d3e8db7387f6e318..bd85de32f88a41d5cc6ed903c8c4d7af5f41ed9c 100644 --- a/source/RobotAPI/components/units/KinematicUnitSimulation.cpp +++ b/source/RobotAPI/components/units/KinematicUnitSimulation.cpp @@ -56,7 +56,7 @@ void KinematicUnitSimulation::onInitKinematicUnit() { // duplicate the loop because of locking - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); // initialize JoinStates for (std::vector<VirtualRobot::RobotNodePtr>::iterator it = robotNodes.begin(); it != robotNodes.end(); it++) { @@ -98,7 +98,7 @@ void KinematicUnitSimulation::simulationFunction() bool aVelValueChanged = false; { - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); for ( JointStates::iterator it = jointStates.begin(); it!=jointStates.end(); it++ ) { @@ -160,7 +160,7 @@ void KinematicUnitSimulation::switchControlMode(const NameControlModeMap& target bool aValueChanged = false; NameControlModeMap changedControlModes; { - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); for ( NameControlModeMap::const_iterator it = targetJointModes.begin(); it!=targetJointModes.end(); it++ ) { // target values @@ -189,7 +189,7 @@ void KinematicUnitSimulation::switchControlMode(const NameControlModeMap& target void KinematicUnitSimulation::setJointAngles(const NameValueMap& targetJointAngles, const Ice::Current& c) { - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); // name value maps for reporting NameValueMap actualJointAngles; bool aValueChanged = false; @@ -222,7 +222,7 @@ void KinematicUnitSimulation::setJointAngles(const NameValueMap& targetJointAngl void KinematicUnitSimulation::setJointVelocities(const NameValueMap& targetJointVelocities, const Ice::Current& c) { - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); NameValueMap actualJointVelocities; bool aValueChanged = false; for ( NameValueMap::const_iterator it = targetJointVelocities.begin(); it!=targetJointVelocities.end(); it++ ) @@ -247,7 +247,7 @@ void KinematicUnitSimulation::setJointVelocities(const NameValueMap& targetJoint void KinematicUnitSimulation::setJointTorques(const NameValueMap& targetJointTorques, const Ice::Current& c) { - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); NameValueMap actualJointTorques; bool aValueChanged = false; for ( NameValueMap::const_iterator it = targetJointTorques.begin(); it!=targetJointTorques.end(); it++ ) @@ -281,7 +281,7 @@ void KinematicUnitSimulation::setJointDecelerations(const NameValueMap& targetJo void KinematicUnitSimulation::stop(const Ice::Current &c) { - boost::mutex::scoped_lock(jointStatesMutex); + boost::mutex::scoped_lock lock(jointStatesMutex); for ( JointStates::iterator it = jointStates.begin(); it!=jointStates.end(); it++ ) { it->second.velocity = 0;