Skip to content

Commit 50b4337

Browse files
pac48sjahr
andauthored
Update current state even if servo is paused (#3341)
Signed-off-by: Paul Gesel <[email protected]> Co-authored-by: Sebastian Jahr <[email protected]>
1 parent dbf07b1 commit 50b4337

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

moveit_ros/moveit_servo/src/servo_node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ void ServoNode::pauseServo(const std::shared_ptr<std_srvs::srv::SetBool::Request
155155
response->message = message;
156156
return;
157157
}
158+
std::lock_guard<std::mutex> lock_guard(lock_);
158159
servo_paused_ = request->data;
159160
response->success = (servo_paused_ == request->data);
160161
if (servo_paused_)
@@ -164,7 +165,6 @@ void ServoNode::pauseServo(const std::shared_ptr<std_srvs::srv::SetBool::Request
164165
}
165166
else
166167
{
167-
std::lock_guard<std::mutex> lock_guard(lock_);
168168
// Reset the smoothing plugin with the robot's current state in case the robot moved between pausing and unpausing.
169169
last_commanded_state_ = servo_->getCurrentRobotState(true /* block for current robot state */);
170170
servo_->resetSmoothing(last_commanded_state_);

0 commit comments

Comments
 (0)