-
Notifications
You must be signed in to change notification settings - Fork 689
[wpimath] Fix trapezoid profile #8556
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
Open
cb144p
wants to merge
20
commits into
wpilibsuite:2027
Choose a base branch
from
cb144p:fix-trapezoid-profile
base: 2027
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
dc4fbcb
Fix Trapezoid Profile.
cb144p f635074
Comparison Bug.
cb144p 67615ac
C++ Trapezoid Profile implementation.
cb144p 0cd0c21
Remove debug stuff.
cb144p 45010b0
Format files.
cb144p 8c2b894
All tests passing on Java and C++.
cb144p 7792177
Update RobotPy files.
cb144p ea39d67
Revert RobotPy file generation fixes.
cb144p 47e5dfc
Merge branch '2027' into fix-trapezoid-profile
cb144p dc8e303
Fix lint errors and RobotPy pregen files.
cb144p bc13492
Add section to algorithms.md and fix sign functions.
cb144p 5462f50
Revert robotpy patch.
cb144p 8442e91
Merge branch '2027' into fix-trapezoid-profile
cb144p 2e8a7fd
Apply RobotPy patches and fix formatting error in derivation.
cb144p 7cbc479
Fixed typos and improved phrasing. Also updated and added new python …
cb144p 7a77039
Push the renamed python tests.
cb144p 06cefb0
Fix failing python tests.
cb144p cd45a0f
Fix more failing python tests.
cb144p 1cd74e7
Fixed typos and improved phrasing in algorithms.md.
cb144p e329080
Improve clarity in derivation of equation 3.
cb144p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Could you explain why we can't choose to apply 0 acceleration when the initial and target velocities are equal?
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.
I think this is explained by the beginning of the derivation where I state that the acceleration of the optimal profile has the form of bang-bang or bang-zero-bang and the part where I discuss the optimal sign. If the velocities have the same sign as the displacement, you could just apply no input and wait for the system to reach the required displacement. If you have a zero displacement, or the velocities are equal to the constraint times the sign of the displacement, then this is indeed optimal. In every other case, applying an acceleration can get you there faster, or in the case where the sign of the velocities and displacement is different, there must be an acceleration applied in order to achieve the desired displacement.