From 62e9aa877ae9957af6c3c9d6167ba564484ef780 Mon Sep 17 00:00:00 2001 From: kobayu858 <129580202+kobayu858@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:42:29 +0900 Subject: [PATCH] fix(autoware_tracking_object_merger): fix clang-diagnostic-sign-conversion (#9507) fix: clang-diagnostic-sign-conversion Signed-off-by: kobayu858 --- .../src/decorative_tracker_merger_node.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/perception/autoware_tracking_object_merger/src/decorative_tracker_merger_node.cpp b/perception/autoware_tracking_object_merger/src/decorative_tracker_merger_node.cpp index 55d31a1b890cd..eab815969ac9a 100644 --- a/perception/autoware_tracking_object_merger/src/decorative_tracker_merger_node.cpp +++ b/perception/autoware_tracking_object_merger/src/decorative_tracker_merger_node.cpp @@ -57,7 +57,8 @@ Eigen::MatrixXd calcScoreMatrixForAssociation( const rclcpp::Time current_time = rclcpp::Time(objects0.header.stamp); // calc score matrix - Eigen::MatrixXd score_matrix = Eigen::MatrixXd::Zero(trackers.size(), objects0.objects.size()); + Eigen::MatrixXd score_matrix = Eigen::MatrixXd::Zero( + static_cast(trackers.size()), static_cast(objects0.objects.size())); for (size_t trackers_idx = 0; trackers_idx < trackers.size(); ++trackers_idx) { const auto & tracker_obj = trackers.at(trackers_idx); const auto & object1 = tracker_obj.getObject(); @@ -77,7 +78,8 @@ Eigen::MatrixXd calcScoreMatrixForAssociation( } else { score = data_association_map.at("lidar-radar")->calcScoreBetweenObjects(object0, object1); } - score_matrix(trackers_idx, objects0_idx) = score; + score_matrix( + static_cast(trackers_idx), static_cast(objects0_idx)) = score; } } return score_matrix; @@ -316,9 +318,11 @@ bool DecorativeTrackerMergerNode::decorativeMerger( // look for tracker for (int tracker_idx = 0; tracker_idx < static_cast(inner_tracker_objects_.size()); ++tracker_idx) { - auto & object0_state = inner_tracker_objects_.at(tracker_idx); + auto & object0_state = + inner_tracker_objects_.at(static_cast::size_type>(tracker_idx)); if (direct_assignment.find(tracker_idx) != direct_assignment.end()) { // found and merge - const auto & object1 = objects1.at(direct_assignment.at(tracker_idx)); + const auto & object1 = + objects1.at(static_cast::size_type>(direct_assignment.at(tracker_idx))); // merge object1 into object0_state object0_state.updateState(input_sensor, current_time, object1); } else { // not found @@ -328,7 +332,7 @@ bool DecorativeTrackerMergerNode::decorativeMerger( } // look for new object for (int object1_idx = 0; object1_idx < static_cast(objects1.size()); ++object1_idx) { - const auto & object1 = objects1.at(object1_idx); + const auto & object1 = objects1.at(static_cast::size_type>(object1_idx)); if (reverse_assignment.find(object1_idx) != reverse_assignment.end()) { // found } else { // not found inner_tracker_objects_.push_back(createNewTracker(input_sensor, current_time, object1));