@@ -40,8 +40,6 @@ SideShiftModule::SideShiftModule(
40
40
const std::unordered_map<std::string, std::shared_ptr<RTCInterface> > & rtc_interface_ptr_map)
41
41
: SceneModuleInterface{name, node, rtc_interface_ptr_map}, parameters_{parameters}
42
42
{
43
- // If lateral offset is subscribed, it approves side shift module automatically
44
- clearWaitingApproval ();
45
43
}
46
44
47
45
void SideShiftModule::initVariables ()
@@ -80,7 +78,7 @@ void SideShiftModule::setParameters(const std::shared_ptr<SideShiftParameters> &
80
78
81
79
bool SideShiftModule::isExecutionRequested () const
82
80
{
83
- if (current_state_ == ModuleStatus::RUNNING) {
81
+ if (getCurrentStatus () == ModuleStatus::RUNNING) {
84
82
return true ;
85
83
}
86
84
@@ -112,7 +110,7 @@ bool SideShiftModule::isReadyForNextRequest(
112
110
return false ;
113
111
}
114
112
115
- ModuleStatus SideShiftModule::updateState ()
113
+ bool SideShiftModule::canTransitSuccessState ()
116
114
{
117
115
// Never return the FAILURE. When the desired offset is zero and the vehicle is in the original
118
116
// drivable area,this module can stop the computation and return SUCCESS.
@@ -150,7 +148,7 @@ ModuleStatus SideShiftModule::updateState()
150
148
no_shifted_plan);
151
149
152
150
if (no_request && no_shifted_plan && no_offset_diff) {
153
- return ModuleStatus::SUCCESS ;
151
+ return true ;
154
152
}
155
153
156
154
const auto & current_lanes = utils::getCurrentLanes (planner_data_);
@@ -169,7 +167,7 @@ ModuleStatus SideShiftModule::updateState()
169
167
} else {
170
168
shift_status_ = SideShiftStatus::AFTER_SHIFT;
171
169
}
172
- return ModuleStatus::RUNNING ;
170
+ return false ;
173
171
}
174
172
175
173
void SideShiftModule::updateData ()
@@ -184,7 +182,7 @@ void SideShiftModule::updateData()
184
182
}
185
183
}
186
184
187
- if (current_state_ != ModuleStatus::RUNNING && current_state_ != ModuleStatus::IDLE) {
185
+ if (getCurrentStatus () != ModuleStatus::RUNNING && getCurrentStatus () != ModuleStatus::IDLE) {
188
186
return ;
189
187
}
190
188
@@ -331,8 +329,6 @@ BehaviorModuleOutput SideShiftModule::planWaitingApproval()
331
329
332
330
prev_output_ = shifted_path;
333
331
334
- waitApproval ();
335
-
336
332
return output;
337
333
}
338
334
0 commit comments