Skip to content

Commit 991cb94

Browse files
authored
refactor(autoware_map_based_prediction): map based pred time keeper ptr (#8462)
* refactor(map_based_prediction): implement time keeper by pointer Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * feat(map_based_prediction): set time keeper in path generator Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * feat: use scoped time track only when the timekeeper ptr is not null Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * refactor: define publish function to measure time Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * chore: add debug parameters for map-based prediction Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * chore: remove unnecessary ScopedTimeTrack instances Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> * feat: replace member to pointer Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp> --------- Signed-off-by: Taekjin LEE <taekjin.lee@tier4.jp>
1 parent f7998e9 commit 991cb94

File tree

5 files changed

+170
-68
lines changed

5 files changed

+170
-68
lines changed

perception/autoware_map_based_prediction/config/map_based_prediction.param.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@
5050
consider_only_routable_neighbours: false
5151

5252
reference_path_resolution: 0.5 #[m]
53+
54+
# debug parameters
55+
publish_processing_time: false
56+
publish_processing_time_detail: false
57+
publish_debug_markers: false

perception/autoware_map_based_prediction/include/map_based_prediction/map_based_prediction_node.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class MapBasedPredictionNode : public rclcpp::Node
252252
std::unique_ptr<autoware::universe_utils::PublishedTimePublisher> published_time_publisher_;
253253
rclcpp::Publisher<autoware::universe_utils::ProcessingTimeDetail>::SharedPtr
254254
detailed_processing_time_publisher_;
255-
mutable autoware::universe_utils::TimeKeeper time_keeper_;
255+
std::shared_ptr<autoware::universe_utils::TimeKeeper> time_keeper_;
256256

257257
// Member Functions
258258
void mapCallback(const LaneletMapBin::ConstSharedPtr msg);
@@ -343,6 +343,10 @@ class MapBasedPredictionNode : public rclcpp::Node
343343
const TrackedObject & object, const LaneletData & current_lanelet_data,
344344
const double object_detected_time);
345345

346+
void publish(
347+
const PredictedObjects & output,
348+
const visualization_msgs::msg::MarkerArray & debug_markers) const;
349+
346350
// NOTE: This function is copied from the motion_velocity_smoother package.
347351
// TODO(someone): Consolidate functions and move them to a common
348352
inline std::vector<double> calcTrajectoryCurvatureFrom3Points(

perception/autoware_map_based_prediction/include/map_based_prediction/path_generator.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define MAP_BASED_PREDICTION__PATH_GENERATOR_HPP_
1717

1818
#include <Eigen/Eigen>
19+
#include <autoware/universe_utils/system/time_keeper.hpp>
1920
#include <rclcpp/rclcpp.hpp>
2021

2122
#include <autoware_perception_msgs/msg/predicted_objects.hpp>
@@ -82,6 +83,8 @@ class PathGenerator
8283
public:
8384
PathGenerator(const double sampling_time_interval, const double min_crosswalk_user_velocity);
8485

86+
void setTimeKeeper(std::shared_ptr<autoware::universe_utils::TimeKeeper> time_keeper_ptr);
87+
8588
PredictedPath generatePathForNonVehicleObject(
8689
const TrackedObject & object, const double duration) const;
8790

@@ -119,6 +122,8 @@ class PathGenerator
119122
bool use_vehicle_acceleration_;
120123
double acceleration_exponential_half_life_;
121124

125+
std::shared_ptr<autoware::universe_utils::TimeKeeper> time_keeper_;
126+
122127
// Member functions
123128
PredictedPath generateStraightPath(const TrackedObject & object, const double duration) const;
124129

0 commit comments

Comments
 (0)