From 8a45f48995915c57b26f46a0eaef3d274ac92f05 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 09:13:48 +0000 Subject: [PATCH] style(pre-commit): autofix --- .../src/topic_relay_controller_node.cpp | 20 +++++++++---------- .../src/topic_relay_controller_node.hpp | 9 +++++---- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/system/autoware_topic_relay_controller/src/topic_relay_controller_node.cpp b/system/autoware_topic_relay_controller/src/topic_relay_controller_node.cpp index 78820e2129988..ace592f3c875e 100644 --- a/system/autoware_topic_relay_controller/src/topic_relay_controller_node.cpp +++ b/system/autoware_topic_relay_controller/src/topic_relay_controller_node.cpp @@ -18,12 +18,13 @@ namespace autoware::topic_relay_controller { -TopicRelayController::TopicRelayController(const rclcpp::NodeOptions & options): Node("topic_relay_controller", options), is_relaying_(true) +TopicRelayController::TopicRelayController(const rclcpp::NodeOptions & options) +: Node("topic_relay_controller", options), is_relaying_(true) { // Parameter node_param_.topic = declare_parameter("topic"); node_param_.remap_topic = declare_parameter("remap_topic"); - node_param_.qos = declare_parameter("qos", 1); + node_param_.qos = declare_parameter("qos", 1); node_param_.transient_local = declare_parameter("transient_local", false); node_param_.best_effort = declare_parameter("best_effort", false); node_param_.is_transform = (node_param_.topic == "/tf" || node_param_.topic == "/tf_static"); @@ -41,7 +42,8 @@ TopicRelayController::TopicRelayController(const rclcpp::NodeOptions & options): if (node_param_.enable_relay_control) { srv_change_relay_control_ = create_service( node_param_.srv_name, - [this](const tier4_system_msgs::srv::ChangeTopicRelayControl::Request::SharedPtr request, + [this]( + const tier4_system_msgs::srv::ChangeTopicRelayControl::Request::SharedPtr request, tier4_system_msgs::srv::ChangeTopicRelayControl::Response::SharedPtr response) { is_relaying_ = request->relay_on; response->status.success = true; @@ -59,24 +61,22 @@ TopicRelayController::TopicRelayController(const rclcpp::NodeOptions & options): if (node_param_.is_transform) { // Publisher - pub_transform_ = this->create_publisher( - node_param_.remap_topic, qos); + pub_transform_ = this->create_publisher(node_param_.remap_topic, qos); sub_transform_ = this->create_subscription( node_param_.topic, qos, [this](tf2_msgs::msg::TFMessage::ConstSharedPtr msg) { for (const auto & transform : msg->transforms) { if ( transform.header.frame_id == node_param_.frame_id && - transform.child_frame_id == node_param_.child_frame_id && - is_relaying_) { + transform.child_frame_id == node_param_.child_frame_id && is_relaying_) { pub_transform_->publish(*msg); } } }); } else { // Publisher - pub_topic_ = this->create_generic_publisher( - node_param_.remap_topic, node_param_.topic_type, qos); + pub_topic_ = + this->create_generic_publisher(node_param_.remap_topic, node_param_.topic_type, qos); sub_topic_ = this->create_generic_subscription( node_param_.topic, node_param_.topic_type, qos, @@ -85,7 +85,7 @@ TopicRelayController::TopicRelayController(const rclcpp::NodeOptions & options): }); } } -} // namespace autoware::topic_relay_controller +} // namespace autoware::topic_relay_controller #include RCLCPP_COMPONENTS_REGISTER_NODE(autoware::topic_relay_controller::TopicRelayController) diff --git a/system/autoware_topic_relay_controller/src/topic_relay_controller_node.hpp b/system/autoware_topic_relay_controller/src/topic_relay_controller_node.hpp index 23d17ce3b7c21..14ac259bbee6e 100644 --- a/system/autoware_topic_relay_controller/src/topic_relay_controller_node.hpp +++ b/system/autoware_topic_relay_controller/src/topic_relay_controller_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef TOPIC_RELAY_CONTROLLER_HPP_ -#define TOPIC_RELAY_CONTROLLER_HPP_ +#ifndef TOPIC_RELAY_CONTROLLER_NODE_HPP_ +#define TOPIC_RELAY_CONTROLLER_NODE_HPP_ // ROS 2 core #include @@ -58,11 +58,12 @@ class TopicRelayController : public rclcpp::Node rclcpp::Publisher::SharedPtr pub_transform_; // Service - rclcpp::Service::SharedPtr srv_change_relay_control_; + rclcpp::Service::SharedPtr + srv_change_relay_control_; // State bool is_relaying_; }; } // namespace autoware::topic_relay_controller -#endif // TOPIC_RELAY_CONTROLLER_HPP_ \ No newline at end of file +#endif // TOPIC_RELAY_CONTROLLER_NODE_HPP_