@@ -26,32 +26,27 @@ namespace autoware::behavior_path_planner
26
26
using autoware::motion_utils::calcSignedArcLength;
27
27
28
28
void PathDecisionStateController::transit_state (
29
- const bool found_pull_over_path , const rclcpp::Time & now,
29
+ const std::optional<PullOverPath> & pull_over_path_opt , const rclcpp::Time & now,
30
30
const PredictedObjects & static_target_objects, const PredictedObjects & dynamic_target_objects,
31
- const std::optional<GoalCandidate> modified_goal_opt,
32
31
const std::shared_ptr<const PlannerData> planner_data,
33
32
const std::shared_ptr<OccupancyGridBasedCollisionDetector> occupancy_grid_map,
34
33
const bool is_current_safe, const GoalPlannerParameters & parameters,
35
- const GoalSearcher & goal_searcher, const bool is_activated,
36
- const std::optional<PullOverPath> & pull_over_path,
34
+ const GoalSearcher & goal_searcher,
37
35
std::vector<autoware::universe_utils::Polygon2d> & ego_polygons_expanded)
38
36
{
39
37
const auto next_state = get_next_state (
40
- found_pull_over_path, now, static_target_objects, dynamic_target_objects, modified_goal_opt,
41
- planner_data, occupancy_grid_map, is_current_safe, parameters, goal_searcher, is_activated,
42
- pull_over_path, ego_polygons_expanded);
38
+ pull_over_path_opt, now, static_target_objects, dynamic_target_objects, planner_data,
39
+ occupancy_grid_map, is_current_safe, parameters, goal_searcher, ego_polygons_expanded);
43
40
current_state_ = next_state;
44
41
}
45
42
46
43
PathDecisionState PathDecisionStateController::get_next_state (
47
- const bool found_pull_over_path , const rclcpp::Time & now,
44
+ const std::optional<PullOverPath> & pull_over_path_opt , const rclcpp::Time & now,
48
45
const PredictedObjects & static_target_objects, const PredictedObjects & dynamic_target_objects,
49
- const std::optional<GoalCandidate> modified_goal_opt,
50
46
const std::shared_ptr<const PlannerData> planner_data,
51
47
const std::shared_ptr<OccupancyGridBasedCollisionDetector> occupancy_grid_map,
52
48
const bool is_current_safe, const GoalPlannerParameters & parameters,
53
- const GoalSearcher & goal_searcher, const bool is_activated,
54
- const std::optional<PullOverPath> & pull_over_path_opt,
49
+ const GoalSearcher & goal_searcher,
55
50
std::vector<autoware::universe_utils::Polygon2d> & ego_polygons_expanded) const
56
51
{
57
52
auto next_state = current_state_;
@@ -77,15 +72,15 @@ PathDecisionState PathDecisionStateController::get_next_state(
77
72
}
78
73
79
74
// if path is not safe, not decided
80
- if (!found_pull_over_path || ! pull_over_path_opt) {
75
+ if (!pull_over_path_opt) {
81
76
next_state.state = PathDecisionState::DecisionKind::NOT_DECIDED;
82
77
return next_state;
83
78
}
84
79
85
80
const auto & pull_over_path = pull_over_path_opt.value ();
86
81
// If it is dangerous against dynamic objects before approval, do not determine the path.
87
82
// This eliminates a unsafe path to be approved
88
- if (!next_state.is_stable_safe && !is_activated ) {
83
+ if (!next_state.is_stable_safe ) {
89
84
RCLCPP_DEBUG (
90
85
logger_,
91
86
" [DecidingPathStatus]: NOT_DECIDED. path is not safe against dynamic objects before "
@@ -98,11 +93,11 @@ PathDecisionState PathDecisionStateController::get_next_state(
98
93
if (current_state_.state == PathDecisionState::DecisionKind::DECIDING) {
99
94
const double hysteresis_factor = 0.9 ;
100
95
96
+ const auto & modified_goal = pull_over_path.modified_goal ();
101
97
// check goal pose collision
102
- if (
103
- modified_goal_opt && !goal_searcher.isSafeGoalWithMarginScaleFactor (
104
- modified_goal_opt.value (), hysteresis_factor, occupancy_grid_map,
105
- planner_data, static_target_objects)) {
98
+ if (!goal_searcher.isSafeGoalWithMarginScaleFactor (
99
+ modified_goal, hysteresis_factor, occupancy_grid_map, planner_data,
100
+ static_target_objects)) {
106
101
RCLCPP_DEBUG (logger_, " [DecidingPathStatus]: DECIDING->NOT_DECIDED. goal is not safe" );
107
102
next_state.state = PathDecisionState::DecisionKind::NOT_DECIDED;
108
103
next_state.deciding_start_time = std::nullopt;
0 commit comments