Skip to content

Commit

Permalink
Update current state even if servo is paused (#3341)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <[email protected]>
Co-authored-by: Sebastian Jahr <[email protected]>
  • Loading branch information
pac48 and sjahr authored Feb 15, 2025
1 parent dbf07b1 commit 50b4337
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moveit_ros/moveit_servo/src/servo_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ void ServoNode::pauseServo(const std::shared_ptr<std_srvs::srv::SetBool::Request
response->message = message;
return;
}
std::lock_guard<std::mutex> lock_guard(lock_);
servo_paused_ = request->data;
response->success = (servo_paused_ == request->data);
if (servo_paused_)
Expand All @@ -164,7 +165,6 @@ void ServoNode::pauseServo(const std::shared_ptr<std_srvs::srv::SetBool::Request
}
else
{
std::lock_guard<std::mutex> lock_guard(lock_);
// Reset the smoothing plugin with the robot's current state in case the robot moved between pausing and unpausing.
last_commanded_state_ = servo_->getCurrentRobotState(true /* block for current robot state */);
servo_->resetSmoothing(last_commanded_state_);
Expand Down

0 comments on commit 50b4337

Please sign in to comment.