Commit Graph

847 Commits

Author SHA1 Message Date
Tyler Veness
dbffe6e8ac [wpimath] Add readme (#8209) 2025-09-08 17:26:22 -07:00
Tyler Veness
632749e6f3 [build] Upgrade Maven dependencies (#8173) 2025-09-01 08:13:46 -07:00
Jade
b0829356fa [wpimath] Fix sysid links (NFC) (#8204)
Signed-off-by: Jade Turner <spacey-sooty@proton.me>
2025-09-01 08:11:39 -07:00
ninjadrknss
96004f9bb5 [wpimath] Replace Pose2/3d.exp(Twist2/3d) with Pose2/3d.plus(Twist2/3d.exp()) (#8188)
This better matches math notation.
2025-08-30 11:37:09 -07:00
ninjadrknss
c280fce147 [wpimath] Replace MathUtil.clamp() with Java 21 Math.clamp() (#8186) 2025-08-23 09:01:51 -07:00
Gold856
d4311d5a29 [wpiutil,glass,dlt] Replace libprotobuf with upb for dynamic decode (#7988)
libprotobuf is a very annoying dependency to deal with, and with the switch to nanopb for generated C++ code, libprotobuf is only used for dynamic decode in the GUI apps. libprotobuf has been swapped out with upb, a much smaller C-based library that supports reflection and can therefore do dynamic decode. This means we can remove the libprotobuf dependency and stop dealing with build issues because of it.
2025-08-16 22:56:32 -07:00
Tyler Veness
0d9e850e22 [wpimath] Fix dt type in C++ tests (#8179)
The UKF test was calling `.value()` on an implicit
`units::millisecond_t` type assuming it was `units::second_t`.

I normalized the rest of the dt declarations while I was at it.
2025-08-16 22:51:13 -07:00
Daniel Chen
f209ecb0cb [wpimath] Add structs for TrapezoidProfile.State and ExponentialProfile.State (#8163) 2025-08-10 11:45:36 -07:00
Peter Johnson
3e4e9c9b01 Merge branch 'main' into 2027 2025-08-09 00:55:26 -07:00
Tyler Veness
9ac7e286f5 [build] Upgrade Gradle plugins (#8166)
I upgraded all plugins I could see except org.ysb33r.doxygen. 2.0 made
breaking changes, and I couldn't figure out how to migrate.

Most of the changes are for suppressing new linter purification rites.
2025-08-08 23:04:02 -07:00
Austin Schuh
6eba91bc04 [bazel] Build and test wpical with bazel (#8155)
This pulls down the prebuilt ceres libraries and uses them with Bazel to
build and test wpical.

Do note that bazel looks up artifacts used for testing differently than
the other build systems.  It wants you to use its runfiles API to find
the dependencies reliably.  Add a function to look up the paths for
files, and use runfiles only when building with Bazel to maintain
compatibility with other languages.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-08-06 22:56:42 -06:00
Austin Schuh
13852760f6 [bazel] Build wpilibc docs with doxygen (#8157)
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-08-04 23:49:47 -06:00
Peter Johnson
ed7982563b Merge branch 'main' into 2027 2025-08-03 11:51:25 -07:00
Gold856
2d11946d98 [wpical] Use updated thirdparty-ceres and move resource files (#8151) 2025-08-03 11:41:25 -07:00
Austin Schuh
1ab705b354 [bazel] Publish ntcore + wpimath for real (#8144)
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-08-01 22:12:38 -07:00
Gold856
e0e774abde [commands, wpimath] Remove Mecanum/SwerveControllerCommand and HolonomicDriveController (#8119) 2025-07-31 23:05:42 -07:00
Rain Heuer
b3aeee18c8 [wpimath] Add vector product and squared length operations to Translation2d/3d (#8133)
Adds methods to compute the dot and cross products between Translation2ds and Translation3ds, as well as methods to compute the square of Distance and Norm, which allows avoiding some calls to sqrt in many cases.

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2025-07-31 21:05:39 -07:00
Tyler Veness
feee88f40d [wpimath] Remove redundant transposes on symmetric matrices (#8131)
This likely won't have a performance impact since it only affects matrix traversal order, but it does simplify the code.
2025-07-31 21:04:55 -07:00
Austin Schuh
db95f55394 [bazel] Handle debug symbols and debug builds like gradle (#8118)
This follows the gradle build accurately.  Gradle copies debug symbols
into a second file (libfoo.so.debug) and links it back into the .so
file.  Disable this behavior when gradle doesn't do it today.

Also, name everything correctly.  When building debug builds, most
libraries get a 'd' at the end of them.  Do that here too.
2025-07-30 20:07:06 -07:00
Tyler Veness
e678a338b4 [ci] Upgrade wpiformat (#8124)
See https://github.com/wpilibsuite/styleguide/pull/312
2025-07-30 11:10:12 -06:00
Austin Schuh
373eedc77b [bazel] Generate a filtered .def file for windows for wpimath (#8113)
wpimath otherwise quickly gets too many symbols.  Instead, gradle
exports only some of the symbols from protobuf files automatically, and
then manually exports the math operations.  Do that here too.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-07-26 14:47:12 -07:00
PJ Reiniger
c78bd942bb [bazel] Make publishers for c++ hdr / srcs, and java (#8114) 2025-07-24 09:11:09 -04:00
Peter Johnson
8aa312fb6f Merge branch 'main' into 2027 2025-07-21 18:38:43 -07:00
Tyler Veness
946ab9e98f [wpimath] Fix S3UKF tests (#8097)
They weren't actually instantiating S3UKF.
2025-07-20 22:18:31 -07:00
Michael Lesirge
f308e9873a [wpimath] Add miles per hour conversation methods (#8026) 2025-07-17 21:19:32 -07:00
PJ Reiniger
b85a0d5cf3 [build] Add missing sources to published zip files (#8055)
Gradle publishing does not capture all of the source files that are used during a build. This should get most of them, and get it equivalent to what bazel pushes out.
2025-07-15 21:20:28 -07:00
Joseph Eng
1530fccbd0 [wpimath] Implement Scaled Spherical Simplex Filter (S3F) (#8091)
Adds S3SigmaPoints based on MerweScaledSigmaPoints. In addition, restructures UnscentedKalmanFilter to support different sigma point generators and provides MerweUKF and S3UKF for convenience when working with either kind of filter.

S3UKFTest is copied from MerweUKFTest (which is a rename of UnscentedKalmanFilterTest). Curiously, however, in Java the original tolerance used in MerweUKFTest.testDriveConvergence() for the final rotation was too low for S3UKFTest, so the tolerance is increased from 0.000005 (5e-6) radians to 0.00015 (1.5e-4) radians. However, the C++ version still uses the original tolerance. (This difference is probably because Java uses a final rotation of 5.846 degrees while C++ uses a final rotation of 5.846 radians)

Closes #8072.

Breaking changes:

- (C++) UnscentedKalmanFilter has a new template parameter for the sigma point generator type.
- (Java) UnscentedKalmanFilter has an additional parameter to every constructor providing an instance of a sigma point generator.
- (C++) int MerweScaledSigmaPoints.NumSigmas() has been replaced with constexpr int MerweScaledSigmaPoints::NumSigmas.
- (C++) The second parameter of SquareRootUnscentedTransform has been changed from States to NumSigmas.
2025-07-15 21:17:25 -07:00
Peter Johnson
7142fb1f5f Merge branch 'main' into 2027 2025-07-08 19:54:03 -07:00
Austin Schuh
4b39853483 [build] Check results of subprocess.run in wpimath/generate_quickbuf.py (#8069)
The generator was calling a binary of the wrong architecture and failing
internally, but passing the build (incorrectly).  Explode right away.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2025-07-06 07:24:09 -05:00
PJ Reiniger
1ccafdc13f [bazel] Simple shared library implementation (#8044) 2025-07-01 22:53:34 -07:00
crueter
6d92e2501d [wpimath] Remove unnecessary deprecation in ArmFeedForward (#8050)
Signed-off-by: crueter <swurl@swurl.xyz>
2025-06-30 21:13:54 -07:00
Peter Johnson
82ce317083 Merge branch 'main' into 2027 2025-06-30 20:21:11 -07:00
sciencewhiz
f2dd81c839 [build] Add checkstyle check for deprecation (#7738)
Ensures java deprecated notation is paired with javadoc and vice versa.
Adds javadoc deprecation for MecanumControllerCommand, ArmFeedForward,
ElevatorFeedforward, and MecanumDriveMotorVoltages
Fixes #7736
Supersedes #7737

Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
2025-06-30 00:09:02 -07:00
PJ Reiniger
e13d237390 [bazel] Create better static libraries and add basic publishing (#8029) 2025-06-27 16:36:12 -07:00
ThePixelatedCat
ffe296892c [wpimath] Fix TrapezoidProfile limiting velocity incorrectly (#8030) 2025-06-24 22:36:53 -07:00
Michael Lesirge
fb399eef3d [wpimath] Add copySignPow to MathUtil for joystick input shaping (#8013) 2025-06-15 14:08:41 -07:00
Michael Lesirge
e2517b7a21 [wpimath] Update parameter type from list to general collection (#8020) 2025-06-15 14:08:06 -07:00
Peter Johnson
3355383fe9 Merge branch 'main' into 2027 2025-06-13 22:26:09 -07:00
PJ Reiniger
fbbc4bc53c [bazel] Clean up bazel scripts (#7984) 2025-06-13 20:53:09 -07:00
Michael Lesirge
05c080328b [wpimath] Pass Translation2d by const reference instead of by value (#8021) 2025-06-13 18:50:05 -07:00
Michael Lesirge
c01e318370 [wpimath] Add Translation3d.nearest() (#8015) 2025-06-12 22:14:00 -07:00
Michael Lesirge
075cc4a20f [wpimath] Add nearest() method to Pose3d (mirroring Pose2d) (#8010) 2025-06-05 22:11:49 -07:00
DeltaDizzy
1955dcddb3 [wpimath] Fix SimpleMotorFeedforward no-accel overload returning negative voltage outputs (#7999)
SimpleMotorFeedforward::calculate(velocity) was not updated to account for the removal of calculate(velocity, acceleration), so it would pass currentVelocity = velocity and nextVelocity = 0, resulting in negative outputs in many scenarios.
2025-06-01 16:46:54 -07:00
Peter Johnson
6c16e846fa Merge branch 'main' into 2027 2025-05-29 21:41:50 -07:00
Gold856
ca05ffa1b9 [upstream_utils] Use pathlib instead of os.path (#7983)
A noteworthy change is the replacement of the `dp.startswith(os.path.join(".", "subdir"))` pattern. pathlib doesn't offer something with similar semantics besides `match` and `full_match`, so there's now a helper function that replicates the behavior.

Other notable changes include the addition of type annotations to ensure code correctness, using == to check file names instead of `endswith` for clarity (`endswith` is still used to check extensions), manual walking and copying being refactored in googletest, json, memory, nanopb, protobuf, and sleipnir to use `walk_cwd_and_copy_if`, and matching functions being shortened to the point where they can just be inlined into the lambda.

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2025-05-29 16:05:22 -06:00
Tyler Veness
de718f7ae5 [upstream_utils] Upgrade Sleipnir (#7973) 2025-05-27 08:24:15 -06:00
Tyler Veness
b4823569a4 [upstream_utils] Upgrade Eigen to latest (#7982) 2025-05-19 14:26:53 -06:00
Lucien Morey
d32e60233f [wpimath] Add dynamic size support for angle statistics (#7964) 2025-05-15 18:43:46 -07:00
PJ Reiniger
6e3f48daeb [bazel] Add scripts to validate pregeneration tools (#7690) 2025-05-13 22:01:47 -07:00
Lucien Morey
e1da917270 [wpimath] Add dynamic size support for numerical jacobian computation (#7959) 2025-05-05 21:55:51 -07:00