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
[cmd] TrapezoidProfileCommand: Use period instead of elapsed time in new TrapezoidProfile.calculate API #6454
base: main
Are you sure you want to change the base?
Conversation
…apezoidProfile.calculate API
wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h
Outdated
Show resolved
Hide resolved
wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h
Outdated
Show resolved
Hide resolved
wpilibNewCommands/src/main/native/include/frc2/command/TrapezoidProfileCommand.h
Outdated
Show resolved
Hide resolved
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
You'll need to rebase your branch onto the development branch since it's a breaking behavior change. |
Ok, I can do that. However, this is fixing a change that actually broke the original behavior and now matches the other places where TrapezoidProfile is used (e.g. TrapezoidProfileSubsystem). Also, what do I run locally to verify lint/compilation? |
The reason to target development is that we don't want to break users in the middle of a season (even if it is a fix that restores expected behavior). For testing locally, you can use I'd recommend making some custom scripts to run the formatting checks, and you can always refer back to the lint-format workflow file (.github/workflows/lint-format.yml) for formatting instructions. |
You can use |
Ok, that makes total sense. Other teams may have already implemented workarounds for the existing behavior....so we don't want to affect them during competition. I have a few other fixes related to motion profiling, specifically |
DevilBotz 2876 experienced odd instabilities with the TrapezoidProfileCommand. Sometimes, the position returned by the calculate would go in the opposite direction. This was reproduced in simulation, so not a hardware issue. Digging into the code, we found that the new call to calculate is using the wrong parameter for "time" when calling
TrapezoidProfile.calculate(double t, State current, State goal)
. It was providing the elapsed time from the initial state but since the current state is being used, the period should be used, instead. Bug introduced in #5457My test case was with changing position as follows: