Tyler Veness
91cbcea841
Replace SFINAE with concepts ( #5361 )
...
Concepts are cleaner to use and result in much better error messages for incorrect template use.
2023-06-07 09:50:09 -07:00
Tyler Veness
eed1e6e3cb
[wpimath] Replace DiscretizeAQTaylor() with DiscretizeAQ() ( #5344 )
...
Until #5339 is fixed, we have to use the slower, more accurate version.
2023-05-18 07:13: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
21d4244cf7
[wpimath] Fix DCMotor docs (NFC) ( #5309 )
2023-05-07 22:56:05 -07:00
Gold856
24828afd11
[wpimath] Fix desaturateWheelSpeeds to account for negative speeds ( #5269 )
2023-04-28 20:53:20 -07:00
Tyler Veness
e099948a77
[wpimath] Clean up rank notation in docs (NFC) ( #5274 )
2023-04-28 20:52:29 -07:00
Sriman Achanta
ba8c64bcff
[wpimath] Fix misspelled Javadoc parameters in pose estimators (NFC) ( #5292 )
2023-04-28 20:51:47 -07:00
Tyler Veness
63512bbbb8
[wpimath] Fix potential divide-by-zero in RKDP ( #5242 )
...
If f(x, u) has no dynamics, the truncation error can be zero.
2023-03-26 17:00:09 -07:00
nt
08f298e4cd
[wpimath] Fix Pose3d log returning Twist3d NaN for theta between 1E-8 and 1E-7 ( #5168 )
2023-03-13 21:27:32 -07:00
nt
099d048d9e
[wpimath] Fix Pose3d log returning Twist3d NaN for theta between 1E-9 and 1E-8 ( #5143 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2023-02-26 16:41:36 -08:00
sciencewhiz
4af84a1c12
Fix Typos (NFC) ( #5137 )
2023-02-26 15:06:37 -08:00
Tyler Veness
ce3686b80d
[wpimath] Check LTV controller max velocity precondition ( #5142 )
2023-02-26 15:05:41 -08:00
Jonah
e9a7bed988
[wpimath] Add timestamp getter to MathShared ( #5091 )
...
This makes it possible to mock the timestamp for wpimath without affecting the rest of the library.
Co-authored-by: Peter Johnson <johnson.peter@gmail.com >
2023-02-17 14:53:17 -08:00
Tyler Veness
74dea9f05e
[wpimath] Fix exception for empty pose buffer in pose estimators ( #5106 )
...
Fixes #5100 .
2023-02-16 22:00:21 -08:00
Jordan McMichael
59be120982
[wpimath] Fix Pose3d exp()/log() and add rotation vector constructor to Rotation3d ( #5072 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2023-02-08 21:31:03 -08:00
Tyler Veness
2f310a748c
[wpimath] Fix DCMotor.getSpeed() ( #5061 )
...
This bug didn't occur in C++ because the units system caught it at
compile time.
2023-02-05 13:21:16 -08:00
Jordan McMichael
4079eabe9b
[wpimath] Discard stale pose estimates ( #5045 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2023-02-03 22:04:30 -08:00
Ryan Blue
7b828ce84f
[wpimath] Add nearest to Pose2d and Translation2d ( #4882 )
...
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com >
2023-02-03 15:27:16 -08:00
Tyler Veness
8bf67b1b33
[wpimath] PIDController::Calculate(double, double): update setpoint flag ( #5021 )
...
Fixes #5020 .
2023-01-29 07:18:48 -08:00
Tyler Veness
d48a83dee2
[wpimath] Update Wikipedia links for quaternion to Euler angle conversion (NFC) ( #4995 )
2023-01-21 15:16:35 -08:00
Jordan McMichael
42c997a3c4
[wpimath] Fix Pose3d exponential and clean up Pose3d logarithm ( #4970 )
...
Implementation based on this paper: https://ethaneade.org/lie.pdf
2023-01-18 20:38:03 -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
ohowe
e5a6197633
[wpimath] Fix SwerveDriveKinematics not initializing a new array each time ( #4942 )
...
This is problematic if you call it twice before utilizing the result.
2023-01-13 20:16:50 -08:00
Matt
f7f19207e0
[wpimath] Allow multiple vision measurements from same timestamp ( #4917 )
...
Co-authored-by: Jordan McMichael <jlmcmchl@gmail.com >
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2023-01-11 23:04:30 -08:00
ohowe
330ba45f9c
[wpimath] Fix swerve kinematics util classes equals function ( #4907 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2023-01-08 16:29:35 -08:00
Tyler Veness
2121bd5fb8
[wpimath] Remove RKF45 ( #4870 )
...
RKDP is strictly better in terms of accuracy per unit of work. We used
RKF45 for sim physics in the 2021 season, but we transitioned to RKDP
before the 2022 season.
2022-12-27 19:29:59 -06:00
Sriman Achanta
26bdbf3d41
Java optimization and formatting fixes ( #4857 )
2022-12-26 11:37:53 -08:00
Sriman Achanta
92149efa11
Spelling and grammar cleanups ( #4849 )
2022-12-26 11:32:13 -08:00
Ashray._.g
2744991771
[wpimath] Fix docs in SwerveModulePosition ( #4825 )
...
Changed m/s and speeds to m and distance.
2022-12-16 05:48:20 -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
Tyler Veness
3270d4fc86
[wpimath] Rewrite pose estimator docs ( #4807 )
2022-12-12 20:30:52 -08:00
Tyler Veness
7e84ea891f
[wpimath] Fix ComputerVisionUtil transform example in parameter docs (NFC) ( #4800 )
2022-12-11 22:44:08 -08:00
Charlie
da3ec1be10
[wpimath] Change terminology for ArmFeedforward gravity gain (NFC) ( #4791 )
2022-12-11 22:43:44 -08:00
ohowe
4a0ad6b48c
[wpimath] Rotation2d: Add reference to angleModulus in docs (NFC) ( #4786 )
2022-12-09 23:35:15 -08:00
sciencewhiz
989c9fb29a
[wpimath] Revert Rotation2D change that limits angles ( #4781 )
...
Reverts "[wpimath] Constrain Rotation2d range to -pi to pi (#4611 )"
This reverts commit d1d458db2b .
This broke multiple teams code in beta. It is also easier to limit the angle externally, then reconstruct a larger angle that got limited. This additionally adds comments to clarify the behavior and retains tests that were added in the reverted commit, and fixes a javadoc comment angle reference.
2022-12-08 18:10:44 -08:00
Tyler Veness
f18fd41ac3
[wpimath] Remove broken and obsoleted ComputerVisionUtil functions ( #4775 )
...
The ComputerVisionUtil class was added before AprilTag support was
announced. Now that it has, the functions for estimating a pose from
range and yaw are no longer needed; it's just better to get the pose
directly from the AprilTag.
The coordinate system on some function arguments was confusing or didn't
match the NWU convention the rest of the library uses. It's easier to
remove the functions now and add them back after they're fixed since the
fixes aren't trivial.
The range function was removed because it uses pitch and yaw in the
camera's spherical coordinate system, which is obsoleted by AprilTags.
AprilTags give you a 6DOF pose directly, so range can be obtained via
Pose2d.getTranslation().getDistance().
Fixes #4757 .
2022-12-06 21:11:27 -08:00
Jaci Brunning
ff88756864
[wpimath] Add new DCMotor functions for alternative calculations and reduction calculation ( #4749 )
2022-12-03 09:47:16 -08:00
superpenguin612
f58873db8e
[wpimath] Remove extra terms in matrix for pose estimator docs ( #4756 )
2022-12-03 09:46:34 -08:00
superpenguin612
37e969b41a
[wpimath] Add constructors to pose estimators with default standard deviations ( #4754 )
2022-12-03 09:46:10 -08:00
Jordan McMichael
e22d8cc343
[wpimath] Use Odometry for internal state in Pose Estimation ( #4668 )
...
This effectively replaces the Unscented Kalman Filter used for Pose Estimation with the Odometry model, and uses a recalculable Kalman gain matrix to update pose estimations whenever a vision measurement is added.
Notably, this change removes the need for the confusing generics used in Java, and the C++ implementation got quite a bit less complex as well.
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2022-12-02 08:36:10 -08:00
Tyler Veness
eae68fc165
[wpimath] Add tolerance for Rotation3d rotation matrix special orthogonality ( #4744 )
2022-11-30 19:51:31 -08:00
Starlight220
d5200db6cd
[wpimath] Rename HolonomicDriveController.calculate params ( #4683 )
2022-11-23 23:13:50 -08:00
Tyler Veness
2ee3d86de4
[wpimath] Clarify Rotation3d roll-pitch-yaw direction ( #4699 )
2022-11-23 23:12:59 -08:00
Jordan McMichael
902e8686d3
[wpimath] Rework odometry APIs to improve feature parity ( #4645 )
...
Co-authored-by: Ryan Blue <ryanzblue@gmail.com >
2022-11-18 20:42:00 -08:00
amquake
88f7a3ccb9
[wpimath] Fix Pose relativeTo documentation ( #4661 )
2022-11-18 14:07:50 -08:00
Drew Williams
2e88a496c2
[wpimath] Add support for swerve joystick normalization ( #4516 )
2022-11-17 10:53:49 -08:00
Jordan McMichael
ce4c45df13
[wpimath] Rework function signatures for Pose Estimation / Odometry ( #4642 )
...
Forcing the use of SwerveModulePostition[] and wpi::array<SwerveModulePosition, len> in place of variadic function signatures.
2022-11-17 10:36:33 -08:00
Jordan McMichael
2e5f9e45bb
[wpimath] Remove encoder reset comments on Swerve, Mecanum Odometry and Pose Estimation ( #4643 )
...
In both of these cases, encoder resets are not required for normal use.
2022-11-16 15:20:05 -08:00
Tyler Veness
14d8506b72
[wpimath] Fix units docs for LinearSystemId::IdentifyDrivetrainSystem() ( #4600 )
2022-11-14 14:26:16 -08:00