Skip to content

Commit 97d6042

Browse files
authored
Merge branch 'main' into feat_mrm_handler_add_operator_class
2 parents a512718 + 4747e74 commit 97d6042

File tree

23 files changed

+165
-38
lines changed

23 files changed

+165
-38
lines changed

evaluator/perception_online_evaluator/test/test_perception_online_evaluator_node.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ class EvalTest : public ::testing::Test
7979

8080
marker_sub_ = rclcpp::create_subscription<MarkerArray>(
8181
eval_node, "perception_online_evaluator/markers", 10,
82-
[this]([[maybe_unused]] const MarkerArray::SharedPtr msg) { has_received_marker_ = true; });
82+
[this]([[maybe_unused]] const MarkerArray::ConstSharedPtr msg) {
83+
has_received_marker_ = true;
84+
});
8385
uuid_ = generateUUID();
8486
}
8587

localization/localization_util/src/smart_pose_buffer.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ std::optional<SmartPoseBuffer::InterpolateResult> SmartPoseBuffer::interpolate(
4040
const rclcpp::Time time_last = pose_buffer_.back()->header.stamp;
4141

4242
if (target_ros_time < time_first) {
43+
RCLCPP_INFO(logger_, "Mismatch between pose timestamp and current timestamp");
4344
return std::nullopt;
4445
}
4546

localization/localization_util/src/util_func.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void output_pose_with_cov_to_log(
241241
rpy.y = rpy.y * 180.0 / M_PI;
242242
rpy.z = rpy.z * 180.0 / M_PI;
243243

244-
RCLCPP_INFO_STREAM(
244+
RCLCPP_DEBUG_STREAM(
245245
logger, std::fixed << prefix << "," << pose.position.x << "," << pose.position.y << ","
246246
<< pose.position.z << "," << pose.orientation.x << "," << pose.orientation.y
247247
<< "," << pose.orientation.z << "," << pose.orientation.w << "," << rpy.x

localization/ndt_scan_matcher/src/map_update_module.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bool MapUpdateModule::update_ndt(const geometry_msgs::msg::Point & position, Ndt
182182
const auto duration_micro_sec =
183183
std::chrono::duration_cast<std::chrono::microseconds>(exe_end_time - exe_start_time).count();
184184
const auto exe_time = static_cast<double>(duration_micro_sec) / 1000.0;
185-
RCLCPP_INFO(logger_, "Time duration for creating new ndt_ptr: %lf [ms]", exe_time);
185+
RCLCPP_DEBUG(logger_, "Time duration for creating new ndt_ptr: %lf [ms]", exe_time);
186186
return true; // Updated
187187
}
188188

localization/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ geometry_msgs::msg::PoseWithCovarianceStamped NDTScanMatcher::align_pose(
992992
result_pose_with_cov_msg.pose.pose = best_particle_ptr->result_pose;
993993

994994
output_pose_with_cov_to_log(get_logger(), "align_pose_output", result_pose_with_cov_msg);
995-
RCLCPP_INFO_STREAM(get_logger(), "best_score," << best_particle_ptr->score);
995+
RCLCPP_DEBUG_STREAM(get_logger(), "best_score," << best_particle_ptr->score);
996996

997997
return result_pose_with_cov_msg;
998998
}

localization/pose_initializer/src/pose_initializer/ndt_module.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ PoseWithCovarianceStamped NdtModule::align_pose(const PoseWithCovarianceStamped
4040
RCLCPP_INFO(logger_, "Call NDT align server.");
4141
const auto res = cli_align_->async_send_request(req).get();
4242
if (!res->success) {
43-
RCLCPP_INFO(logger_, "NDT align server failed.");
4443
throw ServiceException(
4544
Initialize::Service::Response::ERROR_ESTIMATION, "NDT align server failed.");
4645
}

perception/detection_by_tracker/include/detection_by_tracker/debugger.hpp

+23
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <euclidean_cluster/voxel_grid_based_euclidean_cluster.hpp>
2121
#include <rclcpp/rclcpp.hpp>
2222
#include <shape_estimation/shape_estimator.hpp>
23+
#include <tier4_autoware_utils/ros/debug_publisher.hpp>
24+
#include <tier4_autoware_utils/system/stop_watch.hpp>
2325

2426
#include <autoware_auto_perception_msgs/msg/detected_objects.hpp>
2527
#include <autoware_auto_perception_msgs/msg/tracked_objects.hpp>
@@ -61,6 +63,11 @@ class Debugger
6163
divided_objects_pub_ =
6264
node->create_publisher<autoware_auto_perception_msgs::msg::DetectedObjects>(
6365
"debug/divided_objects", 1);
66+
processing_time_publisher_ =
67+
std::make_unique<tier4_autoware_utils::DebugPublisher>(node, "detection_by_tracker");
68+
stop_watch_ptr_ =
69+
std::make_unique<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>>();
70+
this->startStopWatch();
6471
}
6572

6673
~Debugger() {}
@@ -80,6 +87,19 @@ class Debugger
8087
{
8188
divided_objects_pub_->publish(removeFeature(input));
8289
}
90+
void startStopWatch()
91+
{
92+
stop_watch_ptr_->tic("cyclic_time");
93+
stop_watch_ptr_->tic("processing_time");
94+
}
95+
void startMeasureProcessingTime() { stop_watch_ptr_->tic("processing_time"); }
96+
void publishProcessingTime()
97+
{
98+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
99+
"debug/cyclic_time_ms", stop_watch_ptr_->toc("cyclic_time", true));
100+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
101+
"debug/processing_time_ms", stop_watch_ptr_->toc("processing_time", true));
102+
}
83103

84104
private:
85105
rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr
@@ -90,6 +110,9 @@ class Debugger
90110
merged_objects_pub_;
91111
rclcpp::Publisher<autoware_auto_perception_msgs::msg::DetectedObjects>::SharedPtr
92112
divided_objects_pub_;
113+
// debug publisher
114+
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;
115+
std::unique_ptr<tier4_autoware_utils::DebugPublisher> processing_time_publisher_;
93116

94117
autoware_auto_perception_msgs::msg::DetectedObjects removeFeature(
95118
const tier4_perception_msgs::msg::DetectedObjectsWithFeature & input)

perception/detection_by_tracker/src/detection_by_tracker_core.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ void DetectionByTracker::setMaxSearchRange()
206206
void DetectionByTracker::onObjects(
207207
const tier4_perception_msgs::msg::DetectedObjectsWithFeature::ConstSharedPtr input_msg)
208208
{
209+
debugger_->startMeasureProcessingTime();
209210
autoware_auto_perception_msgs::msg::DetectedObjects detected_objects;
210211
detected_objects.header = input_msg->header;
211212

@@ -250,6 +251,7 @@ void DetectionByTracker::onObjects(
250251
}
251252

252253
objects_pub_->publish(detected_objects);
254+
debugger_->publishProcessingTime();
253255
}
254256

255257
void DetectionByTracker::divideUnderSegmentedObjects(

perception/map_based_prediction/README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ If the target object is inside the road or crosswalk, this module outputs one or
218218

219219
### Output
220220

221-
| Name | Type | Description |
222-
| ------------------------ | ------------------------------------------------------ | ------------------------------------------------------------------------------------- |
223-
| `~/input/objects` | `autoware_auto_perception_msgs::msg::TrackedObjects` | tracking objects. Default is set to `/perception/object_recognition/tracking/objects` |
224-
| `~/output/objects` | `autoware_auto_perception_msgs::msg::PredictedObjects` | tracking objects with predicted path. |
225-
| `~/objects_path_markers` | `visualization_msgs::msg::MarkerArray` | marker for visualization. |
221+
| Name | Type | Description |
222+
| ---------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------- |
223+
| `~/input/objects` | `autoware_auto_perception_msgs::msg::TrackedObjects` | tracking objects. Default is set to `/perception/object_recognition/tracking/objects` |
224+
| `~/output/objects` | `autoware_auto_perception_msgs::msg::PredictedObjects` | tracking objects with predicted path. |
225+
| `~/objects_path_markers` | `visualization_msgs::msg::MarkerArray` | marker for visualization. |
226+
| `~/debug/processing_time_ms` | `std_msgs::msg::Float64` | processing time of this module. |
227+
| `~/debug/cyclic_time_ms` | `std_msgs::msg::Float64` | cyclic time of this module. |
226228

227229
## Parameters
228230

perception/map_based_prediction/include/map_based_prediction/map_based_prediction_node.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "tier4_autoware_utils/ros/update_param.hpp"
2222

2323
#include <rclcpp/rclcpp.hpp>
24+
#include <tier4_autoware_utils/ros/debug_publisher.hpp>
2425
#include <tier4_autoware_utils/ros/transform_listener.hpp>
2526
#include <tier4_autoware_utils/ros/uuid_helper.hpp>
2627
#include <tier4_autoware_utils/system/stop_watch.hpp>
@@ -33,7 +34,6 @@
3334
#include <geometry_msgs/msg/pose.hpp>
3435
#include <geometry_msgs/msg/pose_stamped.hpp>
3536
#include <geometry_msgs/msg/twist.hpp>
36-
#include <tier4_debug_msgs/msg/string_stamped.hpp>
3737
#include <visualization_msgs/msg/marker_array.hpp>
3838

3939
#include <lanelet2_core/Forward.h>
@@ -125,11 +125,14 @@ class MapBasedPredictionNode : public rclcpp::Node
125125
// ROS Publisher and Subscriber
126126
rclcpp::Publisher<PredictedObjects>::SharedPtr pub_objects_;
127127
rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr pub_debug_markers_;
128-
rclcpp::Publisher<StringStamped>::SharedPtr pub_calculation_time_;
129128
rclcpp::Subscription<TrackedObjects>::SharedPtr sub_objects_;
130129
rclcpp::Subscription<HADMapBin>::SharedPtr sub_map_;
131130
rclcpp::Subscription<TrafficSignalArray>::SharedPtr sub_traffic_signals_;
132131

132+
// debug publisher
133+
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;
134+
std::unique_ptr<tier4_autoware_utils::DebugPublisher> processing_time_publisher_;
135+
133136
// Object History
134137
std::unordered_map<std::string, std::deque<ObjectData>> objects_history_;
135138
std::map<std::pair<std::string, lanelet::Id>, rclcpp::Time> stopped_times_against_green_;
@@ -196,9 +199,6 @@ class MapBasedPredictionNode : public rclcpp::Node
196199
std::vector<double> distance_set_for_no_intention_to_walk_;
197200
std::vector<double> timeout_set_for_no_intention_to_walk_;
198201

199-
// Stop watch
200-
StopWatch<std::chrono::milliseconds> stop_watch_;
201-
202202
// Member Functions
203203
void mapCallback(const HADMapBin::ConstSharedPtr msg);
204204
void trafficSignalsCallback(const TrafficSignalArray::ConstSharedPtr msg);

perception/map_based_prediction/src/map_based_prediction_node.cpp

+13-12
Original file line numberDiff line numberDiff line change
@@ -646,14 +646,6 @@ ObjectClassification::_label_type changeLabelForPrediction(
646646
}
647647
}
648648

649-
StringStamped createStringStamped(const rclcpp::Time & now, const double data)
650-
{
651-
StringStamped msg;
652-
msg.stamp = now;
653-
msg.data = std::to_string(data);
654-
return msg;
655-
}
656-
657649
// NOTE: These two functions are copied from the route_handler package.
658650
lanelet::Lanelets getRightOppositeLanelets(
659651
const std::shared_ptr<lanelet::LaneletMap> & lanelet_map_ptr,
@@ -816,10 +808,15 @@ MapBasedPredictionNode::MapBasedPredictionNode(const rclcpp::NodeOptions & node_
816808
pub_objects_ = this->create_publisher<PredictedObjects>("~/output/objects", rclcpp::QoS{1});
817809
pub_debug_markers_ =
818810
this->create_publisher<visualization_msgs::msg::MarkerArray>("maneuver", rclcpp::QoS{1});
819-
pub_calculation_time_ = create_publisher<StringStamped>("~/debug/calculation_time", 1);
811+
processing_time_publisher_ =
812+
std::make_unique<tier4_autoware_utils::DebugPublisher>(this, "map_based_prediction");
820813

821814
set_param_res_ = this->add_on_set_parameters_callback(
822815
std::bind(&MapBasedPredictionNode::onParam, this, std::placeholders::_1));
816+
817+
stop_watch_ptr_ = std::make_unique<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>>();
818+
stop_watch_ptr_->tic("cyclic_time");
819+
stop_watch_ptr_->tic("processing_time");
823820
}
824821

825822
rcl_interfaces::msg::SetParametersResult MapBasedPredictionNode::onParam(
@@ -893,7 +890,7 @@ void MapBasedPredictionNode::trafficSignalsCallback(const TrafficSignalArray::Co
893890

894891
void MapBasedPredictionNode::objectsCallback(const TrackedObjects::ConstSharedPtr in_objects)
895892
{
896-
stop_watch_.tic();
893+
stop_watch_ptr_->toc("processing_time", true);
897894
// Guard for map pointer and frame transformation
898895
if (!lanelet_map_ptr_) {
899896
return;
@@ -1116,8 +1113,12 @@ void MapBasedPredictionNode::objectsCallback(const TrackedObjects::ConstSharedPt
11161113
// Publish Results
11171114
pub_objects_->publish(output);
11181115
pub_debug_markers_->publish(debug_markers);
1119-
const auto calculation_time_msg = createStringStamped(now(), stop_watch_.toc());
1120-
pub_calculation_time_->publish(calculation_time_msg);
1116+
const auto processing_time_ms = stop_watch_ptr_->toc("processing_time", true);
1117+
const auto cyclic_time_ms = stop_watch_ptr_->toc("cyclic_time", true);
1118+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
1119+
"debug/cyclic_time_ms", cyclic_time_ms);
1120+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
1121+
"debug/processing_time_ms", processing_time_ms);
11211122
}
11221123

11231124
bool MapBasedPredictionNode::doesPathCrossAnyFence(const PredictedPath & predicted_path)

perception/multi_object_tracker/src/multi_object_tracker_core.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void TrackerDebugger::publishProcessingTime()
148148
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
149149
"debug/processing_time_ms", processing_time_ms);
150150
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
151-
"debug/elapsed_time_from_sensor_input_ms", elapsed_time_from_sensor_input_ * 1e3);
151+
"debug/pipeline_latency_ms", elapsed_time_from_sensor_input_ * 1e3);
152152
}
153153
}
154154

perception/object_merger/include/object_merger/node.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "object_merger/data_association/data_association.hpp"
1919

2020
#include <rclcpp/rclcpp.hpp>
21+
#include <tier4_autoware_utils/ros/debug_publisher.hpp>
22+
#include <tier4_autoware_utils/system/stop_watch.hpp>
2123

2224
#include <autoware_auto_perception_msgs/msg/detected_objects.hpp>
2325

@@ -81,6 +83,10 @@ class ObjectAssociationMergerNode : public rclcpp::Node
8183
std::map<int, double> generalized_iou_threshold;
8284
std::map<int /*class label*/, double /*distance_threshold*/> distance_threshold_map;
8385
} overlapped_judge_param_;
86+
87+
// debug publisher
88+
std::unique_ptr<tier4_autoware_utils::DebugPublisher> processing_time_publisher_;
89+
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;
8490
};
8591
} // namespace object_association
8692

perception/object_merger/src/object_association_merger/node.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ ObjectAssociationMergerNode::ObjectAssociationMergerNode(const rclcpp::NodeOptio
118118

119119
merged_object_pub_ = create_publisher<autoware_auto_perception_msgs::msg::DetectedObjects>(
120120
"output/object", rclcpp::QoS{1});
121+
122+
// Debug publisher
123+
processing_time_publisher_ =
124+
std::make_unique<tier4_autoware_utils::DebugPublisher>(this, "object_association_merger");
125+
stop_watch_ptr_ = std::make_unique<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>>();
126+
stop_watch_ptr_->tic("cyclic_time");
127+
stop_watch_ptr_->tic("processing_time");
121128
}
122129

123130
void ObjectAssociationMergerNode::objectsCallback(
@@ -128,6 +135,7 @@ void ObjectAssociationMergerNode::objectsCallback(
128135
if (merged_object_pub_->get_subscription_count() < 1) {
129136
return;
130137
}
138+
stop_watch_ptr_->toc("processing_time", true);
131139

132140
/* transform to base_link coordinate */
133141
autoware_auto_perception_msgs::msg::DetectedObjects transformed_objects0, transformed_objects1;
@@ -215,6 +223,11 @@ void ObjectAssociationMergerNode::objectsCallback(
215223

216224
// publish output msg
217225
merged_object_pub_->publish(output_msg);
226+
// publish processing time
227+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
228+
"debug/cyclic_time_ms", stop_watch_ptr_->toc("cyclic_time", true));
229+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
230+
"debug/processing_time_ms", stop_watch_ptr_->toc("processing_time", true));
218231
}
219232
} // namespace object_association
220233

perception/shape_estimation/src/node.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,17 @@ ShapeEstimationNode::ShapeEstimationNode(const rclcpp::NodeOptions & node_option
5050
RCLCPP_INFO(this->get_logger(), "using boost shape estimation : %d", use_boost_bbox_optimizer);
5151
estimator_ =
5252
std::make_unique<ShapeEstimator>(use_corrector, use_filter, use_boost_bbox_optimizer);
53+
54+
processing_time_publisher_ =
55+
std::make_unique<tier4_autoware_utils::DebugPublisher>(this, "shape_estimation");
56+
stop_watch_ptr_ = std::make_unique<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>>();
57+
stop_watch_ptr_->tic("cyclic_time");
58+
stop_watch_ptr_->tic("processing_time");
5359
}
5460

5561
void ShapeEstimationNode::callback(const DetectedObjectsWithFeature::ConstSharedPtr input_msg)
5662
{
63+
stop_watch_ptr_->toc("processing_time", true);
5764
// Guard
5865
if (pub_->get_subscription_count() < 1) {
5966
return;
@@ -108,6 +115,11 @@ void ShapeEstimationNode::callback(const DetectedObjectsWithFeature::ConstShared
108115

109116
// Publish
110117
pub_->publish(output_msg);
118+
119+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
120+
"debug/cyclic_time_ms", stop_watch_ptr_->toc("cyclic_time", true));
121+
processing_time_publisher_->publish<tier4_debug_msgs::msg::Float64Stamped>(
122+
"debug/processing_time_ms", stop_watch_ptr_->toc("processing_time", true));
111123
}
112124

113125
#include <rclcpp_components/register_node_macro.hpp>

perception/shape_estimation/src/node.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "shape_estimation/shape_estimator.hpp"
1919

2020
#include <rclcpp/rclcpp.hpp>
21+
#include <tier4_autoware_utils/ros/debug_publisher.hpp>
22+
#include <tier4_autoware_utils/system/stop_watch.hpp>
2123

2224
#include <autoware_auto_perception_msgs/msg/detected_objects.hpp>
2325
#include <tier4_perception_msgs/msg/detected_objects_with_feature.hpp>
@@ -33,6 +35,10 @@ class ShapeEstimationNode : public rclcpp::Node
3335
rclcpp::Publisher<DetectedObjectsWithFeature>::SharedPtr pub_;
3436
rclcpp::Subscription<DetectedObjectsWithFeature>::SharedPtr sub_;
3537

38+
// debug publisher
39+
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;
40+
std::unique_ptr<tier4_autoware_utils::DebugPublisher> processing_time_publisher_;
41+
3642
void callback(const DetectedObjectsWithFeature::ConstSharedPtr input_msg);
3743

3844
std::unique_ptr<ShapeEstimator> estimator_;

perception/tracking_object_merger/include/tracking_object_merger/decorative_tracker_merger.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "tracking_object_merger/utils/utils.hpp"
2121

2222
#include <rclcpp/rclcpp.hpp>
23+
#include <tier4_autoware_utils/ros/debug_publisher.hpp>
24+
#include <tier4_autoware_utils/system/stop_watch.hpp>
2325

2426
#include <autoware_auto_perception_msgs/msg/tracked_objects.hpp>
2527
#include <std_msgs/msg/header.hpp>
@@ -87,6 +89,8 @@ class DecorativeTrackerMergerNode : public rclcpp::Node
8789
rclcpp::Publisher<autoware_auto_perception_msgs::msg::TrackedObjects>::SharedPtr
8890
debug_object_pub_;
8991
bool publish_interpolated_sub_objects_;
92+
std::unique_ptr<tier4_autoware_utils::StopWatch<std::chrono::milliseconds>> stop_watch_ptr_;
93+
std::unique_ptr<tier4_autoware_utils::DebugPublisher> processing_time_publisher_;
9094

9195
/* handle objects */
9296
std::unordered_map<MEASUREMENT_STATE, std::function<void(TrackedObject &, const TrackedObject &)>>

0 commit comments

Comments
 (0)