From 2cb6524ca41b4709dc4639375c3e4c5daca72d27 Mon Sep 17 00:00:00 2001 From: kobayu858 <129580202+kobayu858@users.noreply.github.com> Date: Mon, 22 Jul 2024 08:15:10 +0900 Subject: [PATCH] fix(reaction_analyzer): fix constVariableReference (#8063) * fix:constVariableReference Signed-off-by: kobayu858 * fix:constVariableReference Signed-off-by: kobayu858 * fix:constVariableReference Signed-off-by: kobayu858 * fix:suppression constVariableReference Signed-off-by: kobayu858 --------- Signed-off-by: kobayu858 --- tools/reaction_analyzer/src/subscriber.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/reaction_analyzer/src/subscriber.cpp b/tools/reaction_analyzer/src/subscriber.cpp index 02d7a3872953a..a5d1be613ee5a 100644 --- a/tools/reaction_analyzer/src/subscriber.cpp +++ b/tools/reaction_analyzer/src/subscriber.cpp @@ -272,6 +272,7 @@ void SubscriberBase::on_trajectory( if (zero_vel_idx) { RCLCPP_INFO(node_->get_logger(), "%s reacted without published time", node_name.c_str()); // set header time + // cppcheck-suppress constVariableReference auto & buffer = std::get(variant); buffer->header.stamp = msg_ptr->header.stamp; buffer->published_stamp = msg_ptr->header.stamp; @@ -363,6 +364,7 @@ void SubscriberBase::on_pointcloud( if (search_pointcloud_near_pose(pcl_pointcloud, entity_pose_, entity_search_radius_)) { RCLCPP_INFO(node_->get_logger(), "%s reacted without published time", node_name.c_str()); // set header time + // cppcheck-suppress constVariableReference auto & buffer = std::get(variant); buffer->header.stamp = msg_ptr->header.stamp; buffer->published_stamp = msg_ptr->header.stamp; @@ -440,6 +442,7 @@ void SubscriberBase::on_predicted_objects( if (search_predicted_objects_near_pose(*msg_ptr, entity_pose_, entity_search_radius_)) { RCLCPP_INFO(node_->get_logger(), "%s reacted without published time", node_name.c_str()); // set header time + // cppcheck-suppress constVariableReference auto & buffer = std::get(variant); buffer->header.stamp = msg_ptr->header.stamp; buffer->published_stamp = msg_ptr->header.stamp; @@ -520,6 +523,7 @@ void SubscriberBase::on_detected_objects( if (search_detected_objects_near_pose(output_objs, entity_pose_, entity_search_radius_)) { RCLCPP_INFO(node_->get_logger(), "%s reacted without published time", node_name.c_str()); // set header time + // cppcheck-suppress constVariableReference auto & buffer = std::get(variant); buffer->header.stamp = msg_ptr->header.stamp; buffer->published_stamp = msg_ptr->header.stamp;