@@ -93,50 +93,30 @@ class PullOverStatus
93
93
void reset ()
94
94
{
95
95
lane_parking_pull_over_path_ = nullptr ;
96
- current_path_idx_ = 0 ;
97
- require_increment_ = true ;
98
96
prev_stop_path_ = nullptr ;
99
97
prev_stop_path_after_approval_ = nullptr ;
100
- current_lanes_.clear ();
101
- pull_over_lanes_.clear ();
102
- lanes_.clear ();
103
- has_decided_path_ = false ;
104
- is_safe_dynamic_objects_ = false ;
98
+
99
+ is_safe_ = false ;
105
100
prev_found_path_ = false ;
106
- prev_is_safe_dynamic_objects_ = false ;
107
- has_decided_velocity_ = false ;
101
+ prev_is_safe_ = false ;
108
102
}
109
103
110
104
DEFINE_SETTER_GETTER (std::shared_ptr<PullOverPath>, lane_parking_pull_over_path)
111
- DEFINE_SETTER_GETTER (size_t , current_path_idx)
112
- DEFINE_SETTER_GETTER (bool , require_increment)
113
105
DEFINE_SETTER_GETTER (std::shared_ptr<PathWithLaneId>, prev_stop_path)
114
106
DEFINE_SETTER_GETTER (std::shared_ptr<PathWithLaneId>, prev_stop_path_after_approval)
115
- DEFINE_SETTER_GETTER (lanelet::ConstLanelets, current_lanes)
116
- DEFINE_SETTER_GETTER (lanelet::ConstLanelets, pull_over_lanes)
117
- DEFINE_SETTER_GETTER (std::vector<DrivableLanes>, lanes)
118
- DEFINE_SETTER_GETTER (bool , has_decided_path)
119
- DEFINE_SETTER_GETTER (bool , is_safe_dynamic_objects)
107
+ DEFINE_SETTER_GETTER (bool , is_safe)
120
108
DEFINE_SETTER_GETTER (bool , prev_found_path)
121
- DEFINE_SETTER_GETTER (bool , prev_is_safe_dynamic_objects)
122
- DEFINE_SETTER_GETTER (bool , has_decided_velocity)
109
+ DEFINE_SETTER_GETTER (bool , prev_is_safe)
123
110
DEFINE_SETTER_GETTER (Pose, refined_goal_pose)
124
111
DEFINE_SETTER_GETTER (Pose, closest_goal_candidate_pose)
125
112
126
113
private:
127
114
std::shared_ptr<PullOverPath> lane_parking_pull_over_path_{nullptr };
128
- size_t current_path_idx_{0 };
129
- bool require_increment_{true };
130
115
std::shared_ptr<PathWithLaneId> prev_stop_path_{nullptr };
131
116
std::shared_ptr<PathWithLaneId> prev_stop_path_after_approval_{nullptr };
132
- lanelet::ConstLanelets current_lanes_{};
133
- lanelet::ConstLanelets pull_over_lanes_{};
134
- std::vector<DrivableLanes> lanes_{};
135
- bool has_decided_path_{false };
136
- bool is_safe_dynamic_objects_{false };
117
+ bool is_safe_{false };
137
118
bool prev_found_path_{false };
138
- bool prev_is_safe_dynamic_objects_{false };
139
- bool has_decided_velocity_{false };
119
+ bool prev_is_safe_{false };
140
120
141
121
Pose refined_goal_pose_{};
142
122
Pose closest_goal_candidate_pose_{};
@@ -177,6 +157,10 @@ class ThreadSafeData
177
157
bool incrementPathIndex ()
178
158
{
179
159
const std::lock_guard<std::recursive_mutex> lock (mutex_);
160
+ if (!pull_over_path_) {
161
+ return false ;
162
+ }
163
+
180
164
if (pull_over_path_->incrementPathIndex ()) {
181
165
last_path_idx_increment_time_ = clock_->now ();
182
166
return true ;
@@ -393,10 +377,10 @@ class GoalPlannerModule : public SceneModuleInterface
393
377
void decelerateForTurnSignal (const Pose & stop_pose, PathWithLaneId & path) const ;
394
378
void decelerateBeforeSearchStart (
395
379
const Pose & search_start_offset_pose, PathWithLaneId & path) const ;
396
- PathWithLaneId generateStopPath ();
397
- PathWithLaneId generateFeasibleStopPath ();
380
+ PathWithLaneId generateStopPath () const ;
381
+ PathWithLaneId generateFeasibleStopPath () const ;
398
382
399
- void keepStoppedWithCurrentPath (PathWithLaneId & path);
383
+ void keepStoppedWithCurrentPath (PathWithLaneId & path) const ;
400
384
double calcSignedArcLengthFromEgo (const PathWithLaneId & path, const Pose & pose) const ;
401
385
402
386
// status
@@ -411,6 +395,7 @@ class GoalPlannerModule : public SceneModuleInterface
411
395
bool hasDecidedPath () const ;
412
396
void decideVelocity ();
413
397
bool foundPullOverPath () const ;
398
+ void updateStatus (const BehaviorModuleOutput & output);
414
399
415
400
// validation
416
401
bool hasEnoughDistance (const PullOverPath & pull_over_path) const ;
@@ -433,16 +418,13 @@ class GoalPlannerModule : public SceneModuleInterface
433
418
const std::vector<PullOverPath> & pull_over_path_candidates,
434
419
const GoalCandidates & goal_candidates) const ;
435
420
436
- // deal with pull over partial paths
437
- void transitionToNextPathIfFinishingCurrentPath ();
438
-
439
421
// lanes and drivable area
440
- void setLanes () ;
422
+ std::vector<DrivableLanes> generateDrivableLanes () const ;
441
423
void setDrivableAreaInfo (BehaviorModuleOutput & output) const ;
442
424
443
425
// output setter
444
- void setOutput (BehaviorModuleOutput & output);
445
- void setStopPath (BehaviorModuleOutput & output);
426
+ void setOutput (BehaviorModuleOutput & output) const ;
427
+ void setStopPath (BehaviorModuleOutput & output) const ;
446
428
447
429
/* *
448
430
* @brief Sets a stop path in the current path based on safety conditions and previous paths.
@@ -453,7 +435,7 @@ class GoalPlannerModule : public SceneModuleInterface
453
435
*
454
436
* @param output BehaviorModuleOutput
455
437
*/
456
- void setStopPathFromCurrentPath (BehaviorModuleOutput & output);
438
+ void setStopPathFromCurrentPath (BehaviorModuleOutput & output) const ;
457
439
void setModifiedGoal (BehaviorModuleOutput & output) const ;
458
440
void setTurnSignalInfo (BehaviorModuleOutput & output) const ;
459
441
0 commit comments