Skip to content

Commit ea8f301

Browse files
committed
fix(path_optimizer): revert the feature of publishing processing time
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
1 parent 992b4df commit ea8f301

File tree

2 files changed

+5
-6
lines changed
  • planning/autoware_path_optimizer

2 files changed

+5
-6
lines changed

planning/autoware_path_optimizer/include/autoware/path_optimizer/node.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "autoware/path_optimizer/type_alias.hpp"
2323
#include "autoware/universe_utils/ros/logger_level_configure.hpp"
2424
#include "autoware/universe_utils/ros/polling_subscriber.hpp"
25+
#include "autoware/universe_utils/system/stop_watch.hpp"
2526
#include "autoware/universe_utils/system/time_keeper.hpp"
2627
#include "autoware_vehicle_info_utils/vehicle_info_utils.hpp"
2728

@@ -143,6 +144,8 @@ class PathOptimizer : public rclcpp::Node
143144
std::unique_ptr<autoware::universe_utils::LoggerLevelConfigure> logger_configure_;
144145

145146
std::unique_ptr<autoware::universe_utils::PublishedTimePublisher> published_time_publisher_;
147+
148+
autoware::universe_utils::StopWatch<std::chrono::milliseconds> stop_watch_;
146149
};
147150
} // namespace autoware::path_optimizer
148151

planning/autoware_path_optimizer/src/node.cpp

+2-6
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ void PathOptimizer::resetPreviousData()
223223
void PathOptimizer::onPath(const Path::ConstSharedPtr path_ptr)
224224
{
225225
time_keeper_->start_track(__func__);
226+
stop_watch_.tic();
226227

227228
// check if input path is valid
228229
if (!checkInputPath(*path_ptr, *get_clock())) {
@@ -270,12 +271,7 @@ void PathOptimizer::onPath(const Path::ConstSharedPtr path_ptr)
270271

271272
// publish calculation_time
272273
// NOTE: This function must be called after measuring onPath calculation time
273-
/*
274-
const auto calculation_time_msg = createStringStamped(now(), time_keeper_ptr_->getLog());
275-
debug_calculation_time_str_pub_->publish(calculation_time_msg);
276-
debug_calculation_time_float_pub_->publish(
277-
createFloat64Stamped(now(), time_keeper_ptr_->getAccumulatedTime()));
278-
*/
274+
debug_calculation_time_float_pub_->publish(createFloat64Stamped(now(), stop_watch_.toc()));
279275

280276
const auto output_traj_msg =
281277
autoware::motion_utils::convertToTrajectory(full_traj_points, path_ptr->header);

0 commit comments

Comments
 (0)