23
23
#include " autoware/behavior_path_planner_common/utils/utils.hpp"
24
24
25
25
#include < autoware/universe_utils/geometry/boost_polygon_utils.hpp>
26
+ #include < autoware/universe_utils/system/time_keeper.hpp>
26
27
#include < autoware_lanelet2_extension/utility/message_conversion.hpp>
27
28
#include < autoware_lanelet2_extension/utility/utilities.hpp>
28
29
@@ -55,6 +56,7 @@ NormalLaneChange::NormalLaneChange(
55
56
56
57
void NormalLaneChange::updateLaneChangeStatus ()
57
58
{
59
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
58
60
updateStopTime ();
59
61
const auto [found_valid_path, found_safe_path] = getSafePath (status_.lane_change_path );
60
62
@@ -263,6 +265,7 @@ BehaviorModuleOutput NormalLaneChange::getTerminalLaneChangePath() const
263
265
264
266
BehaviorModuleOutput NormalLaneChange::generateOutput ()
265
267
{
268
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
266
269
if (!status_.is_valid_path ) {
267
270
RCLCPP_DEBUG (logger_, " No valid path found. Returning previous module's path as output." );
268
271
return prev_module_output_;
@@ -308,6 +311,7 @@ BehaviorModuleOutput NormalLaneChange::generateOutput()
308
311
309
312
void NormalLaneChange::extendOutputDrivableArea (BehaviorModuleOutput & output) const
310
313
{
314
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
311
315
const auto & dp = planner_data_->drivable_area_expansion_parameters ;
312
316
313
317
const auto drivable_lanes = utils::lane_change::generateDrivableLanes (
@@ -327,6 +331,7 @@ void NormalLaneChange::extendOutputDrivableArea(BehaviorModuleOutput & output) c
327
331
void NormalLaneChange::insertStopPoint (
328
332
const lanelet::ConstLanelets & lanelets, PathWithLaneId & path)
329
333
{
334
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
330
335
if (lanelets.empty ()) {
331
336
return ;
332
337
}
@@ -468,6 +473,7 @@ void NormalLaneChange::insertStopPoint(
468
473
469
474
PathWithLaneId NormalLaneChange::getReferencePath () const
470
475
{
476
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
471
477
lanelet::ConstLanelet closest_lanelet;
472
478
if (!lanelet::utils::query::getClosestLanelet (
473
479
status_.lane_change_path .info .target_lanes , getEgoPose (), &closest_lanelet)) {
@@ -482,6 +488,7 @@ PathWithLaneId NormalLaneChange::getReferencePath() const
482
488
483
489
std::optional<PathWithLaneId> NormalLaneChange::extendPath ()
484
490
{
491
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
485
492
const auto path = status_.lane_change_path .path ;
486
493
const auto lc_start_point = status_.lane_change_path .info .lane_changing_start .position ;
487
494
@@ -560,6 +567,7 @@ void NormalLaneChange::resetParameters()
560
567
561
568
TurnSignalInfo NormalLaneChange::updateOutputTurnSignal () const
562
569
{
570
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
563
571
const auto & pose = getEgoPose ();
564
572
const auto & current_lanes = status_.current_lanes ;
565
573
const auto & shift_line = status_.lane_change_path .info .shift_line ;
@@ -584,6 +592,7 @@ lanelet::ConstLanelets NormalLaneChange::getCurrentLanes() const
584
592
lanelet::ConstLanelets NormalLaneChange::getLaneChangeLanes (
585
593
const lanelet::ConstLanelets & current_lanes, Direction direction) const
586
594
{
595
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
587
596
if (current_lanes.empty ()) {
588
597
return {};
589
598
}
@@ -1832,6 +1841,7 @@ PathSafetyStatus NormalLaneChange::evaluateApprovedPathWithUnsafeHysteresis(
1832
1841
1833
1842
bool NormalLaneChange::isValidPath (const PathWithLaneId & path) const
1834
1843
{
1844
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
1835
1845
const auto & route_handler = planner_data_->route_handler ;
1836
1846
const auto & dp = planner_data_->drivable_area_expansion_parameters ;
1837
1847
@@ -1869,6 +1879,7 @@ bool NormalLaneChange::isValidPath(const PathWithLaneId & path) const
1869
1879
1870
1880
bool NormalLaneChange::isRequiredStop (const bool is_object_coming_from_rear)
1871
1881
{
1882
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
1872
1883
const auto threshold = lane_change_parameters_->backward_length_buffer_for_end_of_lane ;
1873
1884
if (
1874
1885
isNearEndOfCurrentLanes (status_.current_lanes , status_.target_lanes , threshold) &&
@@ -1882,6 +1893,7 @@ bool NormalLaneChange::isRequiredStop(const bool is_object_coming_from_rear)
1882
1893
1883
1894
bool NormalLaneChange::calcAbortPath ()
1884
1895
{
1896
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
1885
1897
const auto & route_handler = getRouteHandler ();
1886
1898
const auto & common_param = getCommonParam ();
1887
1899
const auto current_velocity =
@@ -2025,6 +2037,7 @@ PathSafetyStatus NormalLaneChange::isLaneChangePathSafe(
2025
2037
const utils::path_safety_checker::RSSparams & rss_params,
2026
2038
CollisionCheckDebugMap & debug_data) const
2027
2039
{
2040
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
2028
2041
PathSafetyStatus path_safety_status;
2029
2042
2030
2043
if (collision_check_objects.empty ()) {
@@ -2108,6 +2121,7 @@ PathSafetyStatus NormalLaneChange::isLaneChangePathSafe(
2108
2121
bool NormalLaneChange::isVehicleStuck (
2109
2122
const lanelet::ConstLanelets & current_lanes, const double obstacle_check_distance) const
2110
2123
{
2124
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
2111
2125
// Ego is still moving, not in stuck
2112
2126
if (std::abs (getEgoVelocity ()) > lane_change_parameters_->stop_velocity_threshold ) {
2113
2127
RCLCPP_DEBUG (logger_, " Ego is still moving, not in stuck" );
@@ -2163,6 +2177,7 @@ bool NormalLaneChange::isVehicleStuck(
2163
2177
2164
2178
double NormalLaneChange::get_max_velocity_for_safety_check () const
2165
2179
{
2180
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
2166
2181
const auto external_velocity_limit_ptr = planner_data_->external_limit_max_velocity ;
2167
2182
if (external_velocity_limit_ptr) {
2168
2183
return std::min (
@@ -2174,6 +2189,7 @@ double NormalLaneChange::get_max_velocity_for_safety_check() const
2174
2189
2175
2190
bool NormalLaneChange::isVehicleStuck (const lanelet::ConstLanelets & current_lanes) const
2176
2191
{
2192
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
2177
2193
if (current_lanes.empty ()) {
2178
2194
lane_change_debug_.is_stuck = false ;
2179
2195
return false ; // can not check
@@ -2208,6 +2224,7 @@ void NormalLaneChange::setStopPose(const Pose & stop_pose)
2208
2224
2209
2225
void NormalLaneChange::updateStopTime ()
2210
2226
{
2227
+ universe_utils::ScopedTimeTrack st (__func__, *time_keeper_);
2211
2228
const auto current_vel = getEgoVelocity ();
2212
2229
2213
2230
if (std::abs (current_vel) > lane_change_parameters_->stop_velocity_threshold ) {
0 commit comments