Skip to content

Commit

Permalink
Rename the acknowledge service's result variable
Browse files Browse the repository at this point in the history
`Success` is more common and more concise.
  • Loading branch information
stefanscherzinger committed Jul 25, 2024
1 parent d6657cf commit ffbdebf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions schunk_egu_egk_gripper_driver/src/schunk_gripper_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,20 +1153,20 @@ void SchunkGripperNode::acknowledge_srv(const std::shared_ptr<Acknowledge::Reque

if(check()) //TODO handshake
{
res->acknowledged = true;
res->success = true;
RCLCPP_WARN(this->get_logger(),"Acknowledged");
}
else
{
res->acknowledged = false;
res->success = false;
RCLCPP_WARN(this->get_logger(),"Acknowledge failed!");
}
}
catch(const char* server_err)
{
connection_error = server_err ;
RCLCPP_ERROR(this->get_logger(), "Failed Connection! %s", connection_error.c_str());
res->acknowledged = false;
res->success = false;
RCLCPP_WARN(this->get_logger(), "Acknowledge failed!");
}
last_command = 0;
Expand Down
4 changes: 2 additions & 2 deletions schunk_egu_egk_gripper_examples/src/gripper_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void acknowledge(rclcpp::Client<Acknowledge>::SharedPtr acknowledge_client)

RCLCPP_INFO(rclcpp::get_logger("schunk_gripper_example"), "Call acknowledge-server.");
//To end the error: acknowledge
bool acknowledged = acknowledge_client->async_send_request(acknowledge_srv).get()->acknowledged;
bool acknowledged = acknowledge_client->async_send_request(acknowledge_srv).get()->success;
RCLCPP_INFO(rclcpp::get_logger("schunk_gripper_example"), "%s", acknowledged ? "Acknowledged" : "Not acknowledged");

}
Expand Down Expand Up @@ -548,7 +548,7 @@ int main(int argc, char** argv)
if(diagnostic_msg.status[0].level == diagnostic_msgs::msg::DiagnosticStatus::ERROR)
{
auto response = acknowledge_client->async_send_request(acknowledge_req);
if(response.get()->acknowledged)
if(response.get()->success)
RCLCPP_INFO(node->get_logger(), "AN ERROR WAS ACKNOWLEDGED!");
}

Expand Down
2 changes: 1 addition & 1 deletion schunk_egu_egk_gripper_interfaces/srv/Acknowledge.srv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
bool acknowledged
bool success

0 comments on commit ffbdebf

Please sign in to comment.