From 09d7b81db7ea2c63861e514e789b73c58c77b7c6 Mon Sep 17 00:00:00 2001 From: Berkay Karaman Date: Thu, 28 Dec 2023 13:50:35 +0300 Subject: [PATCH] tmp scenario_selector header update --- .../scenario_selector_node.cpp | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/planning/scenario_selector/src/scenario_selector_node/scenario_selector_node.cpp b/planning/scenario_selector/src/scenario_selector_node/scenario_selector_node.cpp index 1d5c7b44dcc45..b62ee6c8aba39 100644 --- a/planning/scenario_selector/src/scenario_selector_node/scenario_selector_node.cpp +++ b/planning/scenario_selector/src/scenario_selector_node/scenario_selector_node.cpp @@ -316,16 +316,18 @@ void ScenarioSelectorNode::onParkingTrajectory( void ScenarioSelectorNode::publishTrajectory( const autoware_auto_planning_msgs::msg::Trajectory::ConstSharedPtr msg) { - const auto now = this->now(); - const auto delay_sec = (now - msg->header.stamp).seconds(); - if (delay_sec <= th_max_message_delay_sec_) { - pub_trajectory_->publish(*msg); - } else { - RCLCPP_WARN_THROTTLE( - this->get_logger(), *this->get_clock(), std::chrono::milliseconds(1000).count(), - "trajectory is delayed: scenario = %s, delay = %f, th_max_message_delay = %f", - current_scenario_.c_str(), delay_sec, th_max_message_delay_sec_); - } + auto msg_sent = *msg; + msg_sent.header.stamp = this->now(); + pub_trajectory_->publish(msg_sent); + + // const auto delay_sec = (now - msg->header.stamp).seconds(); + // if (delay_sec <= th_max_message_delay_sec_) { + // } else { + // RCLCPP_WARN_THROTTLE( + // this->get_logger(), *this->get_clock(), std::chrono::milliseconds(1000).count(), + // "trajectory is delayed: scenario = %s, delay = %f, th_max_message_delay = %f", + // current_scenario_.c_str(), delay_sec, th_max_message_delay_sec_); + // } } ScenarioSelectorNode::ScenarioSelectorNode(const rclcpp::NodeOptions & node_options)