Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(stop_line): fix stop_line state #1058

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
stop_margin: 0.0
stop_check_dist: 2.0
stop_duration_sec: 1.0
use_initialization_stop_line_state: true
debug:
show_stopline_collision_check: false # [-] whether to show stopline collision
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class StopLineModule : public SceneModuleInterface
double stop_margin;
double stop_check_dist;
double stop_duration_sec;
bool use_initialization_stop_line_state;
bool show_stopline_collision_check;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ StopLineModuleManager::StopLineModuleManager(rclcpp::Node & node)
p.stop_margin = node.declare_parameter(ns + ".stop_margin", 0.0);
p.stop_check_dist = node.declare_parameter(ns + ".stop_check_dist", 2.0);
p.stop_duration_sec = node.declare_parameter(ns + ".stop_duration_sec", 1.0);
p.use_initialization_stop_line_state =
node.declare_parameter(ns + ".use_initialization_stop_line_state", false);
// debug
p.show_stopline_collision_check =
node.declare_parameter(ns + ".debug.show_stopline_collision_check", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ bool StopLineModule::modifyPathVelocity(
}
} else if (state_ == State::START) {
// Initialize if vehicle is far from stop_line
constexpr bool use_initialization_after_start = false;
if (use_initialization_after_start) {
if (planner_param_.use_initialization_stop_line_state) {
if (signed_arc_dist_to_stop_point > planner_param_.stop_check_dist) {
RCLCPP_INFO(logger_, "START -> APPROACH");
state_ = State::APPROACH;
Expand Down