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

the path ignores the acceleration limit if the last and next segments converge #780

Open
jizelda opened this issue Oct 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jizelda
Copy link
Contributor

jizelda commented Oct 1, 2024

Describe the bug
if the robot needs to reverse it's direction at a specific point, such that the last segment and the next segment converge, it will use it's won't decelerate, and instead use its' last velocity to turn backward, effectively using infinite acceleration.

image
in this image you can see that the points remain green, even though the robot should probably decelerate and then reaccelerate in the opposite direction.

The folder of the path pictured:
pathplanner.zip

To Reproduce
Steps to reproduce the behavior:
-Try to align the control points such that the previous and the next parts of the path converge.
-It might also happen when optimizing crazy paths.

Expected behavior
A clear and concise description of what you expected to happen.
I expect the robot to decelerate and then re cerate in the opposite direction

Versions: (please complete the following information):

  • OS: Windows 10
  • GUI Version: the latest version of main, compiled manually. latest commit is 997a2bd
  • PPLib Version: the latest version of main. latest commit is 997a2bd
  • PPLib Language: java

Additional context
Add any other context about the problem here.
This problem is really avoidable while making paths, but because it allows for really fast acceleration, the optimizer uses it to "cheat" on sharp turns.

For example, here is a optimized path with 4 "cheats" in a row
image
The the path pictures
New Path.zip

@jizelda jizelda added the bug Something isn't working label Oct 1, 2024
@mjansen4857
Copy link
Owner

The generation is not meant to handle path discontinuities, which placing control points like that creates. If you want a "reversal" effect like that, you need to create multiple paths. Anywhere that the robot would need to come to a complete stop must be split into different paths.

Supporting discontinuities may be a future update but is not currently planned.

@jizelda
Copy link
Contributor Author

jizelda commented Oct 1, 2024

That makes sense.
I still think it might be a issue with the path optimization, because it's the fastest way to do a sharp turn so the optimizer will try to use those where the path has a sharp turn.

@mjansen4857
Copy link
Owner

True, but I wouldn't really trust the optimizer to give perfect results all the time anyways. If there's some weird placement of control points that finds an issue in the generator like that, it will very likely find it. It will always need to be sort of "supervised" to make sure the optimized path doesn't do something weird.

I will look into discontinuities at some point, there's a chance I could just insert a path point at those waypoints with a max velocity of 0 and have it work, we'll see. There's quite a few more important things I need to finish before that though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants