Skip to content

fix(path_generator): bug fix for unstable behavior when the ego vehicle is close to goal #361

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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

sasakisasaki
Copy link
Contributor

Description

This PR fixes following unstable behavior of ego vehicle when the goal is close. This bug appears especially when using short backward length.

  • The ego vehicle suddenly tries to change the orientation by 180 degre
  • The goal pose of ego vehicle is rotated even in the straightforward road
  • The ego vehicle's deceleration near the goal becomes strong

Related links

Discussion in TIER IV internal slack (sorry that only limited person can see)

How was this PR tested?

The bug is frequently appears when the backward length is small (<= 0.5 [m]). I verified that the bug is fixed in the test with Psim. Also to detect the regression due to changes by this PR, I also checked with the TIER IV internal evaluator. Considering these points, our tests strategy is as following two.

Tests with Psim

(9th April 2025) If you are trying to build the Autoware, perhaps you need to use autoware_lanelet2_extension with v0.6.4.

The build procedure is very close to that of this installation tutorial. But you need to change the parameter (behavior_path_planner_type) here to switch to use autoware_path_generator.

(preparing the video here)

Tests on TIER IV internal evaluator

Notes for reviewers

Sorry for inconvenience due to the bugs I embedded.

Interface changes

None.

Effects on system behavior

The bugs in the description will be fixed after merging this PR. Hopefully, this helps autoware_core users.

Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
  * This bug occurred when the distance between the end of
    the path and the goal was less than 1.0 [m].
    In such cases, the orientation to the pre-goal was unexpectedly
    inverted by π [rad].
  * This commit resolves the issue by applying the correct offset dynamically,
    instead of relying on a hard-coded offset of 1.0 [m].

Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
  * When the goal is very close (<= 1 [m]),
    - Wrong pose pre goal is inserted: this causes inverted orientation
    - Displaced velocity is inserted

Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Copy link

github-actions bot commented Apr 9, 2025

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

Comment on lines 431 to 435
// Use the original path
finalized_path_with_lane_id = std::move(preprocessed_path);

// But set the velocity of the goal point to 0 for safety
finalized_path_with_lane_id.points.back().point.longitudinal_velocity_mps = 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this process result in a sudden path change and sudden steering if is_goal_over turns true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for a good question. Let me check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right! Now I'm fixing the non-intended behavior 👍

@sasakisasaki sasakisasaki changed the title Bug fix for wrong pose when very close to goal bug: fix unstable behavior when the ego vehicle is close to goal Apr 9, 2025
@sasakisasaki sasakisasaki changed the title bug: fix unstable behavior when the ego vehicle is close to goal fix(path_generator): bug fix for unstable behavior when the ego vehicle is close to goal Apr 9, 2025
@sasakisasaki
Copy link
Contributor Author

Somehow, after merging main into this PR, the goal connection is not performed. I'm investigating the reason.

@sasakisasaki
Copy link
Contributor Author

Perhaps I find the reason though not fully understand yet. Performing the goal connection after the crop by trajectory makes it succeeded. Now seeing the behavior on the Psim, but today I'll go back home soon (maybe the updated report will be tomorrow).

sasakisasaki and others added 2 commits April 10, 2025 21:08
  * Remove unnecessary logic after the goal
    - This might cause unexpected behavior
  * Do goal connection after the crop by trajectory
    - It seems before the crop, the tail of trajectory
      becomes far from the goal point and the goal connection
      function `modify_path_for_smooth_goal_connection` is not
      executed because of the following if condition:
```
distance_between_goal_and_path_end < params.refine_goal_search_radius_range && !is_goal_over
```

Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants