Nicholas Armstrong
30c7632ab8
[wpimath] Make SimpleMotorFeedforward only support discrete feedforward ( #6647 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2024-07-16 17:23:11 -07:00
Tyler Veness
b8c2571638
[wpimath] Fix precondition violation messages in LQR and Kalman filters ( #6731 )
2024-06-21 20:55:01 -07:00
Carl Hauser
294c9946ae
[wpimath] PIDController.setIntegratorRange documentation fix ( #6489 )
2024-05-24 11:49:00 -07:00
Ryan Blue
65f4505e3c
[wpimath] Add constraints support to ProfiledPIDController Sendable implementation ( #6354 )
2024-05-24 10:39:56 -07:00
Tyler Veness
5359112b15
[wpimath] Deprecate RamseteController ( #6494 )
...
LTVUnicycleController is a drop-in replacement with better tuning knobs.
The RamseteCommand examples were removed instead of retrofitted with
LTVUnicycleController because we're planning on removing the command
controller classes anyway, so it would be wasted effort. The
SimpleDifferentialDriveSimulation example shows direct
LTVUnicycleController usage.
2024-04-29 22:01:42 -07:00
Nicholas Armstrong
1ec089c7f9
[wpimath] Add ArmFeedforward calculate() overload that takes current and next velocity instead of acceleration ( #6540 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2024-04-28 12:01:08 -07:00
Tyler Veness
f29a7d2e50
[docs] Add missing JavaDocs ( #6146 )
2024-01-04 08:38:06 -08:00
Tyler Veness
ad0859a8c9
[docs] Add missing JavaDocs ( #6125 )
2024-01-01 22:56:23 -08:00
Tyler Veness
22a322c9f3
[wpimath] Report error on negative PID gains ( #6055 )
...
Defaults PID gains to zero if any are invalid.
2023-12-23 12:15:29 -08:00
ncorrea210
4e4a468d4d
[wpimath] Make feedforward classes throw exceptions for negative Kv or Ka ( #6084 )
2023-12-23 08:12:46 -08:00
Joseph Eng
14c3ade155
[wpimath] Struct cleanup ( #6011 )
2023-12-04 22:40:18 -08:00
PJ Reiniger
bb05e20247
[wpimath] Add protobuf/struct for trivial types ( #5935 )
...
This implements de/serialization for the types that aren't templated (SwerveDriveKinematics) in C++ or where there is no trivial way to go round-trip (Splines) for the messages.
2023-11-21 10:14:06 -08:00
Tyler Veness
201a42a3cd
[wpimath] Reorder TrapezoidProfile.calculate() arguments ( #5874 )
...
ProfiledPIDController and ExponentialProfile use current, then goal.
This isn't a breaking change because this overload of calculate() is
new for 2024.
2023-11-04 16:28:55 -07:00
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