Tyler Veness
6b53ef47cf
[wpimath] Don't recreate TrapezoidProfile in ProfiledPIDController calculate() ( #5863 )
2023-11-03 15:21:58 -07:00
narmstro2020
faa1e665ba
[wpimath] Add ElevatorFeedforward.calculate(currentV, nextV) overload ( #5715 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2023-10-09 08:16:45 -07:00
Tyler Veness
4bac4dd0f4
[wpimath] Move PIDController from frc2 to frc namespace ( #5640 )
...
The old PIDController class in the frc namespace was removed for the
2023 season.
2023-09-15 19:57:31 -07:00
Tyler Veness
8e05983a4a
[wpimath] Add math docs to plant inversion feedforward internals (NFC) ( #5618 )
2023-09-08 20:14:24 -07:00
Tyler Veness
8e2a7fd306
Include thirdparty libraries with angle brackets ( #5578 )
2023-08-28 15:13:34 -07:00
Tyler Veness
7889b35b67
[wpimath] Add RamseteController comparison to LTV controller docs (NFC) ( #5559 )
2023-08-24 00:04:54 -07:00
Tyler Veness
03764dfe93
[wpimath] Add static matrix support to DARE solver ( #5536 )
...
Using static matrices where possible results in a 2x performance
improvement.
2023-08-14 09:15:58 -07:00
Tyler Veness
21439b606c
[wpimath] Disallow LTV controller max velocities above 15 m/s ( #5495 )
...
15 m/s is about 50 ft/s, which is way above what FRC robots should be
able to achieve. This limit lets us catch user errors from bad unit
conversions immediately instead of the LUT generation in the LTV
controllers hanging for a really long time.
Fixes #5027 .
2023-08-02 23:37:49 -07:00
Tyler Veness
a01b6467d3
[wpimath] Link to docs on LQR and KF tolerances ( #5486 )
...
Fixes #4151 .
2023-07-31 19:17:44 -07:00
Gold856
86e91e6724
[wpimath] Refactor TrapezoidProfile API ( #5457 )
2023-07-19 17:25:10 -07:00
Gold856
991f4b0f62
[wpimath] PIDController: Add IZone ( #5315 )
...
Co-authored-by: Ryan Blue <ryanzblue@gmail.com >
2023-06-19 23:01:01 -07:00
Ryan Blue
d6bd72d738
[wpimath] ProfiledPIDController: Add getConstraints ( #5399 )
2023-06-19 17:11:20 -07:00
Tyler Veness
52bd5b972d
[wpimath] Rewrite DARE solver ( #5328 )
...
I timed the DARE unit tests, and the new solver is 0 to 100% faster in
all cases (that is, it's at least as fast as Drake's and up to 2x faster
in some cases).
The new solver is also much simpler, takes less time to compile, and
drops the libwpimath.so size from 325 MB to 301 MB.
I think most of the compilation time is coming from the eigenvalue
decompositions used to enforce argument preconditions.
2023-05-14 22:23:00 -07:00
Tyler Veness
ce3686b80d
[wpimath] Check LTV controller max velocity precondition ( #5142 )
2023-02-26 15:05:41 -08:00
Oliver W
a8c465f3fb
[wpimath] HolonomicDriveController: Add getters for the controllers ( #4948 )
2023-01-16 08:33:15 -08:00
sciencewhiz
1e05b21ab5
[wpimath] Fix PID atSetpoint to not return true prematurely ( #4906 )
...
Wait until setpoint and measurement have been set.
2023-01-13 22:26:30 -08:00
Ryan Blue
6efb9ee405
[commands] Add constructor for SwerveControllerCommand that takes a HolonomicDriveController ( #4785 )
...
Also adds copy and move constructors to HolonomicDriveController.
2022-12-25 18:48:27 -08:00
shueja-personal
7ba8a9ee1f
[wpimath] ProfiledPIDController: Add to SendableRegistry ( #4656 )
...
Co-authored-by: Ryan Blue <ryanzblue@gmail.com >
2022-12-13 22:31:06 -08:00
Starlight220
d5200db6cd
[wpimath] Rename HolonomicDriveController.calculate params ( #4683 )
2022-11-23 23:13:50 -08:00
CarloWoolsey
dbcc1de37f
[wpimath] Add DifferentialDriveFeedforward classes which wrap LinearPlantInversionFeedforward ( #4598 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2022-11-10 16:54:51 -08:00
Tyler Veness
0da169dd84
[wpimath] Remove template argument from ElevatorFeedforward ( #4554 )
2022-11-02 22:54:32 -07:00
Justin
2a98d6b5d7
[wpimath] PIDController: Add getters for position & velocity tolerances ( #4458 )
2022-10-25 16:10:19 -07:00
Ryan Blue
27b173374e
[wpimath] Add minLinearAccel parameter to DifferentialDriveAccelerationLimiter ( #4422 )
2022-10-10 08:57:37 -07:00
Tyler Veness
ab1baf4832
[wpimath] Add rotation matrix constructor to Rotation3d ( #4413 )
2022-09-17 00:17:30 -07:00
Tyler Veness
9730032866
[wpimath] Document LQR and KalmanFilter exceptions ( #4418 )
2022-09-17 00:16:40 -07:00
Tyler Veness
ac9be78e27
Use stricter C++ type conversions ( #4357 )
...
Now, implicit narrowing conversions are only used with wpi::Now(). This
also fixes clang-tidy warnings about C-style casts. For example:
```
== clang-tidy /__w/allwpilib/allwpilib/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.inc ==
/__w/allwpilib/allwpilib/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.inc:95:18: warning: C-style casts are discouraged; use static_cast/const_cast/reinterpret_cast [google-readability-casting]
auto curTime = units::second_t(m_timer.Get());
^
```
In that case at least, the cast was removed entirely since Get() already
returns a units::second_t.
2022-08-17 13:42:36 -07:00
Tyler Veness
add00a96ed
[wpimath] Improve DifferentialDriveAccelerationLimiter docs (NFC) ( #4323 )
...
Defined trackwidth, added skipped steps to the algorithm's internal
proof, and grouped the algorithm steps more logically with blank lines.
2022-07-01 06:43:57 -07:00
Tyler Veness
82fac41244
[wpimath] Better document trackwidth parameters (NFC) ( #4324 )
2022-07-01 06:42:49 -07:00
Prateek Machiraju
fc37265da5
[wpimath] Add angle measurement convention to ArmFeedforward docs (NFC) ( #4285 )
2022-06-02 21:22:47 -07:00
Tyler Veness
be2fedfe50
[wpimath] Add stdexcept include for std::invalid_argument (IWYU) ( #4274 )
2022-05-29 15:33:19 -07:00
Tyler Veness
5aa67f56e6
[wpimath] Clean up math comments ( #4252 )
2022-05-20 15:16:56 -07:00
Tyler Veness
b1abf455c1
[wpimath] LTVUnicycleController: Use LUT, provide default hyperparameters ( #4213 )
2022-05-04 22:04:08 -07:00
Tyler Veness
ee03a7ad3b
Remove most 2022 deprecations ( #4205 )
...
Excludes "old" commands and SimDevice functions.
2022-05-04 20:37:27 -07:00
Tyler Veness
ce1a7d698a
[wpimath] Refactor WheelVoltages inner class to a separate file ( #4203 )
2022-05-01 11:01:20 -07:00
Tyler Veness
87bf70fa8e
[wpimath] Add LTV controllers ( #4094 )
...
This adds a unicycle controller that's a drop-in replacement for Ramsete
and a differential drive controller that controls the full pose and
outputs voltages. The main benefit is LQR-like tuning knobs using a
system model.
2022-04-30 22:54:22 -07:00
Peter Johnson
dac1429aa9
[wpimath] LQR: Use extern template instead of Impl class
2022-04-30 20:38:55 -07:00
Peter Johnson
e767605e94
[wpimath] Add typedefs for common types
...
This makes complex code significantly easier to read.
frc::Vectord<Size> = Eigen::Vector<double, Size>
frc::Matrixd<Rows, Cols> = Eigen::Matrix<double, Rows, Cols>
2022-04-30 20:38:55 -07:00
Tyler Veness
5ebe911933
[wpimath] Add DifferentialDriveAccelerationLimiter ( #4091 )
2022-04-24 07:21:40 -07:00
Tyler Veness
aef4b16d4c
[wpimath] Remove unnecessary NOLINT in LinearPlantInversionFeedforward (NFC) ( #4155 )
2022-04-08 21:31:42 -07:00
Tyler Veness
c8905ec29a
[wpimath] Remove ImplicitModelFollower dt argument ( #4119 )
...
The math works just fine without model discretization.
2022-03-29 11:29:06 -07:00
Tyler Veness
8d79dc8738
[wpimath] Add ImplicitModelFollower ( #4056 )
2022-03-20 00:36:12 -07:00
Tyler Veness
765efa325e
[wpimath] Remove redundant column index from vectors ( #4116 )
2022-03-19 20:44:14 -07:00
Alberto Jahuey Moncada
ac5d46cfa7
[wpilibc] Fix ProfiledPID SetTolerance default velocity value ( #4054 )
...
When trying to set the tolerance of a ProfiledPID, it fails if you don't give it a velocity value. It was missing a conversion from double to the appropiate unit.
2022-02-25 20:27:56 -08:00
Oblarg
d68d6674e8
[examples] Armbot: rename kCos to kG ( #3975 )
2022-01-31 00:16:26 -08:00
Tyler Veness
db0fbb6448
[wpimath] Fix LQR matrix constructor overload for Q, R, and N ( #3884 )
...
It was using the continuous B matrix to compute the feedback gain
instead of the discrete B matrix.
Tests were added for the matrix constructor overloads.
2022-01-08 23:23:53 -08:00
Tyler Veness
04957a6d30
[wpimath] Fix units of RamseteController's b and zeta ( #3757 )
...
Fixes #3755 .
2021-12-03 18:21:30 -08:00
Oblarg
da90c1cd2c
[wpilib] Add bang-bang controller ( #3676 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2021-11-23 20:34:46 -08:00
Tyler Veness
2cb171f6f5
[docs] Set Doxygen extract_all to true and fix Doxygen failures ( #3695 )
...
The template argument order for UnscentedTransform was reversed to match
all the other UKF classes. Since UnscentedTransform is intended as a
class for internal use only, this shouldn't cause much breakage.
2021-10-29 15:07:05 -07:00
Tyler Veness
a939cd9c89
[wpimath] Print uncontrollable/unobservable models in LQR and KF ( #3694 )
...
IsDetectable() was added to make the code easier to read.
2021-10-29 00:03:02 -07:00
Tyler Veness
181723e573
Replace .to<double>() and .template to<double>() with .value() ( #3667 )
...
It's a less verbose way to do the same thing.
2021-10-25 08:58:12 -07:00