@@ -57,22 +57,18 @@ PathDecisionState PathDecisionStateController::get_next_state(
57
57
auto next_state = current_state_;
58
58
59
59
// update safety
60
- if (!parameters.safety_check_params .enable_safety_check ) {
61
- next_state.is_stable_safe = true ;
62
- } else {
63
- if (is_current_safe) {
64
- if (!next_state.safe_start_time ) {
65
- next_state.safe_start_time = now;
66
- next_state.is_stable_safe = false ;
67
- } else {
68
- next_state.is_stable_safe =
69
- ((now - next_state.safe_start_time .value ()).seconds () >
70
- parameters.safety_check_params .keep_unsafe_time );
71
- }
72
- } else {
73
- next_state.safe_start_time = std::nullopt;
60
+ if (is_current_safe) {
61
+ if (!next_state.safe_start_time ) {
62
+ next_state.safe_start_time = now;
74
63
next_state.is_stable_safe = false ;
64
+ } else {
65
+ next_state.is_stable_safe =
66
+ ((now - next_state.safe_start_time .value ()).seconds () >
67
+ parameters.safety_check_params .keep_unsafe_time );
75
68
}
69
+ } else {
70
+ next_state.safe_start_time = std::nullopt;
71
+ next_state.is_stable_safe = false ;
76
72
}
77
73
78
74
// Once this function returns true, it will continue to return true thereafter
@@ -87,10 +83,9 @@ PathDecisionState PathDecisionStateController::get_next_state(
87
83
}
88
84
89
85
const auto & pull_over_path = pull_over_path_opt.value ();
90
- const bool enable_safety_check = parameters.safety_check_params .enable_safety_check ;
91
86
// If it is dangerous against dynamic objects before approval, do not determine the path.
92
87
// This eliminates a unsafe path to be approved
93
- if (enable_safety_check && !next_state.is_stable_safe && !is_activated) {
88
+ if (!next_state.is_stable_safe && !is_activated) {
94
89
RCLCPP_DEBUG (
95
90
logger_,
96
91
" [DecidingPathStatus]: NOT_DECIDED. path is not safe against dynamic objects before "
@@ -132,7 +127,7 @@ PathDecisionState PathDecisionStateController::get_next_state(
132
127
return next_state;
133
128
}
134
129
135
- if (enable_safety_check && !next_state.is_stable_safe ) {
130
+ if (!next_state.is_stable_safe ) {
136
131
RCLCPP_DEBUG (
137
132
logger_,
138
133
" [DecidingPathStatus]: DECIDING->NOT_DECIDED. path is not safe against dynamic objects" );
0 commit comments