Skip to content

Commit

Permalink
Return if requested pause state is already active.
Browse files Browse the repository at this point in the history
Signed-off-by: Jelmer de Wolde <jelmer.de.wolde@alliander.com>
  • Loading branch information
Jelmerdw committed Jan 30, 2025
1 parent 870b23d commit e05ad9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions moveit_ros/moveit_servo/src/servo_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ ServoNode::ServoNode(const rclcpp::NodeOptions& options)
void ServoNode::pauseServo(const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
const std::shared_ptr<std_srvs::srv::SetBool::Response>& response)
{
if (servo_paused_ == request->data)
{
RCLCPP_INFO(node_->get_logger(), "Requested pause state is already active.");
response->success = true;
response->message = "Nothing changed since requested pause state was already active.";
return;
}
servo_paused_ = request->data;
response->success = (servo_paused_ == request->data);
if (servo_paused_)
Expand Down

0 comments on commit e05ad9a

Please sign in to comment.