Skip to content
Snippets Groups Projects
Commit 2b17ca4c authored by Simon Ottenhaus's avatar Simon Ottenhaus
Browse files
parents aadb7b9c ed258ac0
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment