Skip to content

Commit 429bc34

Browse files
authored
fix(motion_velocity_planner): remove Metric messages (#10342)
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
1 parent edd2901 commit 429bc34

File tree

20 files changed

+6
-326
lines changed

20 files changed

+6
-326
lines changed

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_cruise_module/package.xml

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<depend>pluginlib</depend>
2929
<depend>rclcpp</depend>
3030
<depend>tf2</depend>
31-
<depend>tier4_metric_msgs</depend>
3231
<depend>visualization_msgs</depend>
3332

3433
<test_depend>ament_cmake_ros</test_depend>

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_cruise_module/src/metrics_manager.hpp

-60
This file was deleted.

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_cruise_module/src/obstacle_cruise_module.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ void ObstacleCruiseModule::init(rclcpp::Node & node, const std::string & module_
123123
debug_publisher_ = node.create_publisher<MarkerArray>("~/obstacle_cruise/debug_markers", 1);
124124

125125
// module publisher
126-
metrics_pub_ = node.create_publisher<MetricArray>("~/cruise/metrics", 10);
127126
debug_cruise_planning_info_pub_ =
128127
node.create_publisher<Float32MultiArrayStamped>("~/debug/cruise_planning_info", 1);
129128
processing_time_detail_pub_ = node.create_publisher<autoware_utils::ProcessingTimeDetail>(
@@ -160,7 +159,6 @@ VelocityPlanningResult ObstacleCruiseModule::plan(
160159
// 1. init variables
161160
stop_watch_.tic();
162161
debug_data_ptr_ = std::make_shared<DebugData>();
163-
metrics_manager_.init();
164162

165163
// filter obstacles of predicted objects
166164
const auto cruise_obstacles = filter_cruise_obstacle_for_predicted_object(
@@ -174,7 +172,6 @@ VelocityPlanningResult ObstacleCruiseModule::plan(
174172
[[maybe_unused]] const auto cruise_traj_points = cruise_planner_->plan_cruise(
175173
planner_data, raw_trajectory_points, cruise_obstacles, debug_data_ptr_,
176174
planning_factor_interface_, result.velocity_limit);
177-
metrics_manager_.calculate_metrics("PlannerInterface", "cruise");
178175

179176
// clear velocity limit if necessary
180177
if (result.velocity_limit) {
@@ -356,14 +353,10 @@ void ObstacleCruiseModule::publish_debug_info()
356353
// 4. objects of interest
357354
objects_of_interest_marker_interface_->publishMarkerArray();
358355

359-
// 5. metrics
360-
const auto metrics_msg = metrics_manager_.create_metric_array(clock_->now());
361-
metrics_pub_->publish(metrics_msg);
362-
363-
// 6. processing time
356+
// 5. processing time
364357
processing_time_publisher_->publish(create_float64_stamped(clock_->now(), stop_watch_.toc()));
365358

366-
// 7. planning factor
359+
// 6. planning factor
367360
planning_factor_interface_->publish();
368361
}
369362

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_cruise_module/src/obstacle_cruise_module.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "autoware_utils/system/stop_watch.hpp"
2121
#include "autoware_utils/system/time_keeper.hpp"
2222
#include "cruise_planner_interface.hpp"
23-
#include "metrics_manager.hpp"
2423
#include "optimization_based_planner/optimization_based_planner.hpp"
2524
#include "parameters.hpp"
2625
#include "pid_based_planner/pid_based_planner.hpp"
@@ -65,7 +64,6 @@ class ObstacleCruiseModule : public PluginModuleInterface
6564
rclcpp::Publisher<Float32MultiArrayStamped>::SharedPtr debug_cruise_planning_info_pub_;
6665

6766
// module publisher
68-
rclcpp::Publisher<MetricArray>::SharedPtr metrics_pub_;
6967
std::unique_ptr<autoware::objects_of_interest_marker_interface::ObjectsOfInterestMarkerInterface>
7068
objects_of_interest_marker_interface_;
7169
rclcpp::Publisher<autoware_utils::ProcessingTimeDetail>::SharedPtr processing_time_detail_pub_;
@@ -78,7 +76,6 @@ class ObstacleCruiseModule : public PluginModuleInterface
7876
std::vector<CruiseObstacle> prev_cruise_object_obstacles_;
7977
mutable std::shared_ptr<DebugData> debug_data_ptr_;
8078
bool need_to_clear_velocity_limit_{false};
81-
MetricsManager metrics_manager_;
8279
mutable std::shared_ptr<autoware_utils::TimeKeeper> time_keeper_;
8380

8481
std::unique_ptr<CruisePlannerInterface> create_cruise_planner(rclcpp::Node & node) const;

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_cruise_module/src/type_alias.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "visualization_msgs/msg/marker_array.hpp"
3232
#include <autoware_internal_planning_msgs/msg/planning_factor.hpp>
3333
#include <autoware_internal_planning_msgs/msg/safety_factor_array.hpp>
34-
#include <tier4_metric_msgs/msg/metric.hpp>
35-
#include <tier4_metric_msgs/msg/metric_array.hpp>
3634

3735
#include <pcl/point_cloud.h>
3836
#include <pcl/point_types.h>
@@ -60,8 +58,6 @@ using visualization_msgs::msg::MarkerArray;
6058
namespace bg = boost::geometry;
6159
using autoware_utils::Point2d;
6260
using autoware_utils::Polygon2d;
63-
using Metric = tier4_metric_msgs::msg::Metric;
64-
using MetricArray = tier4_metric_msgs::msg::MetricArray;
6561
using PointCloud = pcl::PointCloud<pcl::PointXYZ>;
6662
using autoware_internal_planning_msgs::msg::PlanningFactor;
6763
using autoware_internal_planning_msgs::msg::SafetyFactorArray;

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_slow_down_module/package.xml

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<depend>pluginlib</depend>
2929
<depend>rclcpp</depend>
3030
<depend>tf2</depend>
31-
<depend>tier4_metric_msgs</depend>
3231
<depend>visualization_msgs</depend>
3332

3433
<test_depend>ament_cmake_ros</test_depend>

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_slow_down_module/src/metrics_manager.hpp

-60
This file was deleted.

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_slow_down_module/src/obstacle_slow_down_module.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ void ObstacleSlowDownModule::init(rclcpp::Node & node, const std::string & modul
208208
debug_publisher_ = node.create_publisher<MarkerArray>("~/obstacle_slow_down/debug_markers", 1);
209209

210210
// module publisher
211-
metrics_pub_ = node.create_publisher<MetricArray>("~/slow_down/metrics", 10);
212211
debug_slow_down_planning_info_pub_ =
213212
node.create_publisher<Float32MultiArrayStamped>("~/debug/slow_down_planning_info", 1);
214213
processing_time_detail_pub_ = node.create_publisher<autoware_utils::ProcessingTimeDetail>(
@@ -329,7 +328,6 @@ VelocityPlanningResult ObstacleSlowDownModule::plan(
329328

330329
stop_watch_.tic();
331330
debug_data_ptr_ = std::make_shared<DebugData>();
332-
metrics_manager_.init();
333331
decimated_traj_polys_ = std::nullopt;
334332

335333
const auto decimated_traj_points = utils::decimate_trajectory_points_from_ego(
@@ -357,7 +355,6 @@ VelocityPlanningResult ObstacleSlowDownModule::plan(
357355
result.slowdown_intervals = plan_slow_down(
358356
planner_data, raw_trajectory_points, slow_down_obstacles, result.velocity_limit,
359357
planner_data->vehicle_info_);
360-
metrics_manager_.calculate_metrics("PlannerInterface", "cruise");
361358

362359
// clear velocity limit if necessary
363360
if (result.velocity_limit) {
@@ -886,14 +883,10 @@ void ObstacleSlowDownModule::publish_debug_info()
886883
// 4. objects of interest
887884
objects_of_interest_marker_interface_->publishMarkerArray();
888885

889-
// 5. metrics
890-
const auto metrics_msg = metrics_manager_.create_metric_array(clock_->now());
891-
metrics_pub_->publish(metrics_msg);
892-
893-
// 6. processing time
886+
// 5. processing time
894887
processing_time_publisher_->publish(create_float64_stamped(clock_->now(), stop_watch_.toc()));
895888

896-
// 7. planning factor
889+
// 6. planning factor
897890
planning_factor_interface_->publish();
898891
}
899892

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_slow_down_module/src/obstacle_slow_down_module.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "autoware/motion_velocity_planner_common_universe/utils.hpp"
2020
#include "autoware_utils/system/stop_watch.hpp"
2121
#include "autoware_utils/system/time_keeper.hpp"
22-
#include "metrics_manager.hpp"
2322
#include "parameters.hpp"
2423
#include "type_alias.hpp"
2524
#include "types.hpp"
@@ -70,7 +69,6 @@ class ObstacleSlowDownModule : public PluginModuleInterface
7069
ObstacleFilteringParam obstacle_filtering_param_;
7170

7271
// module publisher
73-
rclcpp::Publisher<MetricArray>::SharedPtr metrics_pub_;
7472
rclcpp::Publisher<Float32MultiArrayStamped>::SharedPtr debug_slow_down_planning_info_pub_;
7573
rclcpp::Publisher<autoware_utils::ProcessingTimeDetail>::SharedPtr processing_time_detail_pub_;
7674

@@ -85,7 +83,6 @@ class ObstacleSlowDownModule : public PluginModuleInterface
8583
Float32MultiArrayStamped slow_down_debug_multi_array_;
8684
autoware_utils::StopWatch<std::chrono::milliseconds> stop_watch_;
8785
mutable std::shared_ptr<DebugData> debug_data_ptr_;
88-
MetricsManager metrics_manager_;
8986
bool need_to_clear_velocity_limit_{false};
9087
mutable std::shared_ptr<autoware_utils::TimeKeeper> time_keeper_;
9188
mutable std::optional<std::vector<Polygon2d>> decimated_traj_polys_{std::nullopt};

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_slow_down_module/src/type_alias.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "visualization_msgs/msg/marker_array.hpp"
3232
#include <autoware_internal_planning_msgs/msg/planning_factor.hpp>
3333
#include <autoware_internal_planning_msgs/msg/safety_factor_array.hpp>
34-
#include <tier4_metric_msgs/msg/metric.hpp>
35-
#include <tier4_metric_msgs/msg/metric_array.hpp>
3634

3735
#include <pcl/point_cloud.h>
3836
#include <pcl/point_types.h>
@@ -60,8 +58,6 @@ using visualization_msgs::msg::MarkerArray;
6058
namespace bg = boost::geometry;
6159
using autoware_utils::Point2d;
6260
using autoware_utils::Polygon2d;
63-
using Metric = tier4_metric_msgs::msg::Metric;
64-
using MetricArray = tier4_metric_msgs::msg::MetricArray;
6561
using PointCloud = pcl::PointCloud<pcl::PointXYZ>;
6662
using autoware_internal_planning_msgs::msg::PlanningFactor;
6763
using autoware_internal_planning_msgs::msg::SafetyFactorArray;

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_stop_module/package.xml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<depend>pluginlib</depend>
2828
<depend>rclcpp</depend>
2929
<depend>tf2</depend>
30-
<depend>tier4_metric_msgs</depend>
3130
<depend>tier4_planning_msgs</depend>
3231
<depend>visualization_msgs</depend>
3332

0 commit comments

Comments
 (0)