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

Update Path Manager to newest algorithm #33

Closed
iandareid opened this issue Jun 3, 2024 · 6 comments · Fixed by #35
Closed

Update Path Manager to newest algorithm #33

iandareid opened this issue Jun 3, 2024 · 6 comments · Fixed by #35
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@iandareid
Copy link
Collaborator

The newest implementation of the path management algorithm has some improvements, we need to implement them, and along the way, fix the issue of always adding (0,0) as a waypoint. While we are looking over the path manager it should also be adjusted to handle double backing waypoints or very shallow waypoints. Also it should handle only 2 waypoints.

@iandareid iandareid self-assigned this Jun 3, 2024
@iandareid iandareid converted this from a draft issue Jun 3, 2024
@iandareid iandareid added bug Something isn't working enhancement New feature or request labels Jun 3, 2024
@iandareid
Copy link
Collaborator Author

The algorithm matches closely what the newest algorithm is. The names are different than in the book, so a big part of the upgrade will simply be refactoring names for consistency, and readability. The change will also likely introduce a new state to handle the last waypoint in the list, to either orbit it or initiate the cycle again.

@iandareid
Copy link
Collaborator Author

iandareid commented Jun 4, 2024

It looks like the looping doesn't quite work, in the case of waypoints in a straight line. This is also a problem when the waypoints double back on themselves. It appears that the center radius is sent to infinity, so the aircraft simply flies on forever. This is also an issue for shallow angles waypoints (sharp turns). The radius is sent far away, there should be a check to see if it is placed strangely.

@iandareid
Copy link
Collaborator Author

For the situation that a set of three waypoints create too acute an angle, we are opting to default to vanilla line following for the points.

The criteria for "too acute" is if the center of the orbit radius is past the closest waypoint to the waypoint, w.

Image

Perhaps we should consider adding follow type between line and fillet to the path message. This would allow people to choose if they would rather have the aircraft follow the path in a fairly acute angle even if the fillet isn't 'too far'.

@iandareid
Copy link
Collaborator Author

iandareid commented Jun 5, 2024

This has been implemented along with a warning if an added point is within the minimum turning radius of the previous point. Essentially this warns that the behavior will not be what is expected.

What is yet to be done:

  • Refactoring code to match book
  • Cleaning up duplicate code
  • Implementing final waypoint as a state
  • Getting clear on what the transition state is for in the MAVsim version.

@iandareid
Copy link
Collaborator Author

Upon further study, the implementation of the final waypoint as a state is necessary. This is because the incrementing of the indexes happens else where than in the similar code in MAVsim. So this will be skipped.

@iandareid
Copy link
Collaborator Author

The refactoring has been complete, idx_a_, idx_b and idx_c because they are just as valid as any other notation and there is clear doucmentation.

@iandareid iandareid linked a pull request Jun 5, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in v2.0 Release Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant