File tree 1 file changed +7
-10
lines changed
planning/behavior_path_start_planner_module/src
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -360,20 +360,17 @@ bool StartPlannerModule::isStopped()
360
360
361
361
bool StartPlannerModule::isExecutionReady () const
362
362
{
363
- bool is_safe = true ;
364
363
// Evaluate safety. The situation is not safe if any of the following conditions are met:
365
364
// 1. pull out path has not been found
366
365
// 2. there is a moving objects around ego
367
366
// 3. waiting for approval and there is a collision with dynamic objects
368
- if (!status_.found_pull_out_path ) {
369
- is_safe = false ;
370
- } else if (isWaitingApproval ()) {
371
- if (!noMovingObjectsAround ()) {
372
- is_safe = false ;
373
- } else if (requiresDynamicObjectsCollisionDetection () && hasCollisionWithDynamicObjects ()) {
374
- is_safe = false ;
375
- }
376
- }
367
+
368
+ const bool is_safe = [&]() -> bool {
369
+ if (!status_.found_pull_out_path ) return false ;
370
+ if (!isWaitingApproval ()) return true ;
371
+ if (!noMovingObjectsAround ()) return false ;
372
+ return !(requiresDynamicObjectsCollisionDetection () && hasCollisionWithDynamicObjects ());
373
+ }();
377
374
378
375
if (!is_safe) {
379
376
stop_pose_ = planner_data_->self_odometry ->pose .pose ;
You can’t perform that action at this time.
0 commit comments