-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
1043 Handle crossing paths in path follow #1058
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- the nearest point search is can be started at any point and limited to a given number of points. This is so we can handle crossover paths. - the track that is returned can be configured for how many points ahead and behind the nearest point should be included
- update inputs and outputs to match new CTE.run() method - update CTE constructor to take configuration for path search - update run method to accept from_pt and return closest_pt to maintain the search offset.
- when we reset the origin we need to reset the starting search index of the cte algorithm
- start origin at (0,0) - test makes sure origin translation is applied - test makes sure the closest point is reset when origin is reset
DocGarbanzo
reviewed
Nov 26, 2022
DocGarbanzo
reviewed
Nov 26, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I have only very minor comments.
@DocGarbanzo thank you for those comments. I updated the code and responded in comments. |
DocGarbanzo
approved these changes
Nov 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #1043
Update the path_follow template so that it can handle paths that have cross-overs. The current code tests every point in the path to find the closest point. This means that it is possible that a point on a cross-over going in the opposite direction may get selected. The approach to fix this is to make the search start at the most recent closest point and limit the search to a configurable number of points. So for instance, consider a perfectly symmetrical figure 8 path with 1000 waypoints in the path whose origin is at the top of the figure 8; then the intersection as at point 250 and point 750. If we limit the search to 250 points then only 1/4 of the path will be searched. If we have driving to the intersection from then origin, then if we are at the the 250th point. We would then search from point 250 to point 500, and so we never get close the other intersection point at 750.
To implement this we updated these parts:
Update CTE part
Update OriginOffset part
We then updated the path_follow.py template to use the updated parts and we updated cfg_path_follow.py to include configuration for number of search points, as well as the number of look ahead and look behind points used to calculate the track to follow.