@@ -47,11 +47,6 @@ LaneChangeInterface::LaneChangeInterface(
47
47
logger_ = utils::lane_change::getLogger (module_type_->getModuleTypeStr ());
48
48
}
49
49
50
- void LaneChangeInterface::processOnEntry ()
51
- {
52
- waitApproval ();
53
- }
54
-
55
50
void LaneChangeInterface::processOnExit ()
56
51
{
57
52
module_type_->resetParameters ();
@@ -79,7 +74,7 @@ void LaneChangeInterface::updateData()
79
74
module_type_->setPreviousModuleOutput (getPreviousModuleOutput ());
80
75
module_type_->updateSpecialData ();
81
76
82
- if (isWaitingApproval ()) {
77
+ if (isWaitingApproval () || module_type_-> isAbortState () ) {
83
78
module_type_->updateLaneChangeStatus ();
84
79
}
85
80
@@ -116,14 +111,12 @@ BehaviorModuleOutput LaneChangeInterface::plan()
116
111
117
112
updateSteeringFactorPtr (output);
118
113
if (module_type_->isAbortState ()) {
119
- waitApproval ();
120
114
const auto candidate = planCandidate ();
121
115
path_candidate_ = std::make_shared<PathWithLaneId>(candidate.path_candidate );
122
116
updateRTCStatus (
123
117
std::numeric_limits<double >::lowest (), std::numeric_limits<double >::lowest (), true ,
124
118
State::ABORTING);
125
119
} else {
126
- clearWaitingApproval ();
127
120
const auto path =
128
121
assignToCandidate (module_type_->getLaneChangePath (), module_type_->getEgoPosition ());
129
122
updateRTCStatus (
@@ -153,7 +146,7 @@ BehaviorModuleOutput LaneChangeInterface::planWaitingApproval()
153
146
154
147
if (!module_type_->isValidPath ()) {
155
148
updateRTCStatus (
156
- std::numeric_limits<double >::lowest (), std::numeric_limits<double >::lowest (), true ,
149
+ std::numeric_limits<double >::lowest (), std::numeric_limits<double >::lowest (), false ,
157
150
State::FAILED);
158
151
path_candidate_ = std::make_shared<PathWithLaneId>();
159
152
return out;
@@ -209,11 +202,6 @@ bool LaneChangeInterface::canTransitSuccessState()
209
202
}
210
203
}
211
204
212
- if (module_type_->isAbortState () && module_type_->hasFinishedAbort ()) {
213
- log_debug_throttled (" Abort process has completed." );
214
- return true ;
215
- }
216
-
217
205
if (module_type_->hasFinishedLaneChange ()) {
218
206
module_type_->resetParameters ();
219
207
log_debug_throttled (" Lane change process has completed." );
@@ -243,6 +231,16 @@ bool LaneChangeInterface::canTransitFailureState()
243
231
return false ;
244
232
}
245
233
234
+ if (!module_type_->isValidPath ()) {
235
+ log_debug_throttled (" Transit to failure state due not to find valid path" );
236
+ return true ;
237
+ }
238
+
239
+ if (module_type_->isAbortState () && module_type_->hasFinishedAbort ()) {
240
+ log_debug_throttled (" Abort process has completed." );
241
+ return true ;
242
+ }
243
+
246
244
if (module_type_->isCancelEnabled () && module_type_->isEgoOnPreparePhase ()) {
247
245
if (module_type_->isStoppedAtRedTrafficLight ()) {
248
246
log_debug_throttled (" Stopping at traffic light while in prepare phase. Cancel lane change" );
0 commit comments