Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Feb 5, 2024
1 parent 5fdf4ea commit 63615f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
7 changes: 3 additions & 4 deletions common/autoware_node/include/autoware_node/autoware_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "autoware_node/visibility_control.hpp"
#include "rclcpp_lifecycle/lifecycle_node.hpp"

#include "autoware_control_center_msgs/msg/heartbeat.hpp"
#include "autoware_control_center_msgs/msg/autoware_node_state.hpp"
#include "autoware_control_center_msgs/msg/heartbeat.hpp"
#include "autoware_control_center_msgs/srv/autoware_control_center_deregister.hpp"
#include "autoware_control_center_msgs/srv/autoware_node_error.hpp"
#include "autoware_control_center_msgs/srv/autoware_node_register.hpp"
Expand All @@ -42,7 +42,7 @@ class AutowareNode : public rclcpp_lifecycle::LifecycleNode
rclcpp::Client<autoware_control_center_msgs::srv::AutowareNodeRegister>::SharedPtr cli_register_;
rclcpp::Service<autoware_control_center_msgs::srv::AutowareControlCenterDeregister>::SharedPtr
srv_deregister_;
rclcpp::Client<autoware_control_center_msgs::srv::AutowareNodeError>::SharedPtr cli_node_error_;
rclcpp::Client<autoware_control_center_msgs::srv::AutowareNodeError>::SharedPtr cli_node_error_;
rclcpp::Publisher<autoware_control_center_msgs::msg::Heartbeat>::SharedPtr heartbeat_pub_;
rclcpp::TimerBase::SharedPtr heartbeat_timer_;
rclcpp::TimerBase::SharedPtr register_timer_;
Expand All @@ -55,8 +55,7 @@ class AutowareNode : public rclcpp_lifecycle::LifecycleNode
void register_callback();
void heartbeat_callback();
void send_state(
const autoware_control_center_msgs::msg::AutowareNodeState &,
std::string message);
const autoware_control_center_msgs::msg::AutowareNodeState &, std::string message);
void deregister(
const autoware_control_center_msgs::srv::AutowareControlCenterDeregister::Request::SharedPtr
request,
Expand Down
17 changes: 7 additions & 10 deletions common/autoware_node/src/autoware_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "autoware_control_center_msgs/srv/autoware_node_register.hpp"
// #include "autoware_control_center_msgs/srv/autoware_node_error.hpp"


#include <chrono>

using namespace std::chrono_literals;
Expand Down Expand Up @@ -77,7 +76,8 @@ AutowareNode::AutowareNode(
rmw_qos_profile_services_default, callback_group_mut_ex_);

cli_node_error_ = create_client<autoware_control_center_msgs::srv::AutowareNodeError>(
"/autoware_control_center/srv/autoware_node_error", rmw_qos_profile_default, callback_group_mut_ex_);
"/autoware_control_center/srv/autoware_node_error", rmw_qos_profile_default,
callback_group_mut_ex_);
}

void AutowareNode::register_callback()
Expand Down Expand Up @@ -156,8 +156,7 @@ void AutowareNode::deregister(
}

void AutowareNode::send_state(
const autoware_control_center_msgs::msg::AutowareNodeState & node_state,
std::string message)
const autoware_control_center_msgs::msg::AutowareNodeState & node_state, std::string message)
{
if (!cli_node_error_->service_is_ready()) {
RCLCPP_WARN(get_logger(), "%s is unavailable", cli_register_->get_service_name());
Expand All @@ -166,7 +165,7 @@ void AutowareNode::send_state(
autoware_control_center_msgs::srv::AutowareNodeError::Request::SharedPtr req =
std::make_shared<autoware_control_center_msgs::srv::AutowareNodeError::Request>();

req->name_node = self_name;
req->name_node = self_name;
req->state = node_state;
req->message = message;

Expand All @@ -175,11 +174,9 @@ void AutowareNode::send_state(
auto response_received_callback = [this](ServiceResponseFuture future) {
auto response = future.get();
std::string str_uuid = tier4_autoware_utils::toHexString(response->uuid_node);
RCLCPP_INFO(get_logger(),
"response: %d, %s, %s",
response->status.status,
str_uuid.c_str(),
response->log_response.c_str());
RCLCPP_INFO(
get_logger(), "response: %d, %s, %s", response->status.status, str_uuid.c_str(),
response->log_response.c_str());

if (response->status.status == 1) {
RCLCPP_INFO(get_logger(), "Node state was received by ACC");
Expand Down

0 comments on commit 63615f9

Please sign in to comment.