Commit Graph

449 Commits

Author SHA1 Message Date
Colin Finn
6ef94de9b5 [wpimath] Add tests for ArmFeedforward and ElevatorFeedforward (#5663) 2023-09-18 22:25:08 -07:00
autoantwort
cb99517838 [build] cmake: Use default install location on windows for dlls (#5580) 2023-09-17 16:17:32 -07:00
Ryan Blue
4da5aee88a [wpimath] Remove SlewRateLimiter 2 argument constructor (#5648)
Deprecated in #4377
2023-09-16 22:04:29 -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
autoantwort
7a9a901a73 [build] Fix cmake config files (#5624) 2023-09-11 13:27:00 -07:00
Joseph Eng
66e6bd81ea [wpimath] Cleanup wpimath/algorithms.md (NFC) (#5621) 2023-09-10 06:26:53 -07:00
Tyler Veness
a9ab08f48b [wpimath] Rename ChassisSpeeds.fromDiscreteSpeeds() to discretize() (#5616)
This better reflects what's actually going on mathematically.
2023-09-08 20:14:59 -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
1a6df6fec6 [wpimath] Fix DARE Q decomposition (#5611) 2023-09-05 10:48:43 -07:00
Tyler Veness
814f18c7f5 [wpimath] Fix computation of C for DARE (A, C) detectability check (#5609)
If Q has off-diagonal entries, C and Cᵀ are different.
2023-09-04 21:12:25 -07:00
Tyler Veness
a750bee54d [wpimath] Use std::norm() in IsStabilizable() (#5599) 2023-08-31 22:52:18 -07:00
Gold856
8e2465f8a0 [wpimath] Add arithmetic functions to wheel speeds classes (#5465) 2023-08-31 11:57:24 -07:00
Tyler Veness
10d4f5b5df [wpimath] Clean up notation in DARE precondition docs (#5595) 2023-08-31 11:56:41 -07:00
Tyler Veness
99f66b1e24 [wpimath] Replace frc/EigenCore.h typedefs with Eigen's where possible (#5597) 2023-08-31 11:03:37 -07:00
Ryan Blue
45e7720ec1 [build] Add error message when downloading files in CMake (#5593)
CMake's file(DOWNLOAD) function fails silently, leading to an error occurring due to a missing file later in the build. This fails quickly and produces a better error message.
2023-08-30 21:16:48 -07:00
Gold856
4e0d785356 [wpimath] ChassisSpeeds: document that values aren't relative to the robot (NFC) (#5551) 2023-08-30 13:22:42 -07:00
Omar Zrien
67043a8eeb [wpimath] Add angular jerk unit (#5582) 2023-08-29 12:53:14 -07:00
Tyler Veness
51b0fb1492 [wpimath] Fix incorrect header inclusion in angular_acceleration.h (#5587)
Specific unit headers should only include units they use. In this case,
that's angle and time.
2023-08-29 12:52:39 -07:00
Tyler Veness
b7657a8e28 [wpimath] Split WPIMathJNI into logical chunks (#5552)
This makes things easier to find, and speeds up compilation.
2023-08-29 09:00:19 -07:00
Tyler Veness
f1d7b05723 [wpimath] Clean up unit formatter (#5584) 2023-08-29 08:56:48 -07:00
Tyler Veness
8e2a7fd306 Include thirdparty libraries with angle brackets (#5578) 2023-08-28 15:13:34 -07:00
Tyler Veness
e322ab8e46 [wpimath] Fix docs for DARE ABQRN stabilizability check (NFC) (#5579) 2023-08-28 15:10:42 -07:00
Tyler Veness
9d86624c00 [build] Fix CMake configure warnings (#5577)
FetchContent requires CMake 3.11 (released Mar 28, 2018).

Fixed this warning:
```
CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1316 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  imgui/CMakeLists.txt:23 (FetchContent_Declare)
```
2023-08-28 15:06:51 -07:00
Tyler Veness
0d2d989e84 [wpimath] Update to gcem 1.17.0 (#5575) 2023-08-28 15:03:06 -07:00
Tyler Veness
7889b35b67 [wpimath] Add RamseteController comparison to LTV controller docs (NFC) (#5559) 2023-08-24 00:04:54 -07:00
Joseph Eng
2e4ad35e36 [wpiutil] jni_util: Add JSpan and CriticalJSpan (#5554)
These replace JArrayRef et al and support statically sized arrays similar to std::span.
2023-08-24 00:02:56 -07:00
Tyler Veness
8f3d6a1d4b [wpimath] Remove discretizeAQTaylor() (#5562)
It gives incorrect results. Any replacement should just be an
implementation detail of discretizeAQ().

Closes #5339.
2023-08-23 10:47:32 -07:00
Tyler Veness
7c20fa1b18 [wpimath] Refactor DARE tests to reduce RAM usage at compile time (#5557) 2023-08-23 10:46:50 -07:00
Tyler Veness
96f7fa662e Upgrade Maven dependencies (#5553)
The following source code changes were required:

* Whitespace changes from spotless
* PMD warning suppressions for utility class tests
* PMD warning rename from "BeanMembersShouldSerialize" to
  "NonSerializableClass"
* Declared more class members as final
2023-08-18 19:18:33 -07:00
Tyler Veness
f9e2757d8f [wpimath] Use JDoubleArrayRef in all JNI functions (#5546) 2023-08-17 13:57:06 -07:00
Tyler Veness
0cf6e37dc1 [wpimath] Make LTV controller constructors use faster DARE solver (#5543)
Made JNI modifications to expose the faster function, made the API use
the typesafe Matrix API, and synchronized the documentation with C++.

Sped up C++ LTV diff drive test from 20 ms to 15 ms.
Sped up C++ LTV unicycle test from 15 ms to 10 ms.
2023-08-17 13:56:15 -07:00
Joseph Eng
7a37e3a496 [wpimath] Correct Rotation3d::RotateBy doc comment (NFC) (#5541)
Improve transform doc comment consistency
2023-08-15 13:12:09 -07:00
Tyler Veness
186b409e16 [wpimath] Remove internal Eigen header include (#5539) 2023-08-15 08:47:48 -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
394cfeadbd [wpimath] Use SDA algorithm instead of SSCA for DARE solver (#5526)
Both seem to work, but the SDA algorithm is specifically recommended for
solving DAREs as opposed to P-DAREs.

The QR decomposition was replaced with a partial pivoting LU
decomposition at the recommendation of section 2.4 of the paper.

More tests and a separate JNI function for each DARE solver variant were
added.
2023-08-12 19:45:45 -07:00
amquake
8121566258 [wpimath] Fix CoordinateSystem.convert() Transform3d overload (#5532) 2023-08-12 15:20:22 -07:00
Tyler Veness
e8b5d44752 [wpimath] Make Java Quaternion use doubles instead of Vector (#5525)
This avoids allocation overhead on construction. times() was also
rewritten to not allocate any temporary objects.

Getter calls in the C++ Quaternion class were modified for parity.
2023-08-11 23:27:29 -07:00
Tyler Veness
00450c3548 [wpimath] Upgrade to EJML 0.42 (#5531) 2023-08-11 23:25:43 -07:00
Joseph Eng
faf3cecd83 [wpimath] Don't copy Matrix and underlying storage in VecBuilder (#5524) 2023-08-09 22:15:39 -07:00
Joseph Eng
b5bd0771eb [wpimath] Document extrinsic vs intrinsic rotations (NFC) (#5508) 2023-08-06 19:59:42 -07:00
Tyler Veness
d8c59ccc71 [wpimath] Add tests for MathUtil clamp() and interpolate() (#5501) 2023-08-03 23:43:20 -07:00
Ryan Blue
90e37a129f [wpiutil,wpimath] Add generic InterpolatingTreeMap (#5372) 2023-08-03 21:46:17 -07:00
Tyler Veness
6db2c42966 [wpimath] Trajectory: Throw on empty lists of States (#5497)
Fixes #4141.
2023-08-03 08:24:20 -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
Joseph Eng
0c93aded8a [wpimath] Change kinematics.ToTwist2d(end - start) to kinematics.ToTwist2d(start, end) (#5493) 2023-08-01 22:25:26 -07:00
Tyler Veness
815a8403e5 [wpimath] Give infeasible trajectory constraints a better exception message (#5492)
Fixes #3146.
2023-07-31 21:43:22 -07:00
Tyler Veness
35a8b129d9 [wpimath] Add RotateBy() function to pose classes (#5491)
Fixes #5472.
2023-07-31 21:16:44 -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
Tyler Veness
d814f1d123 [wpimath] Fix copy-paste error from Pose2d docs (NFC) (#5490) 2023-07-31 19:17:17 -07:00
Tyler Veness
98f074b072 [wpimath] Add folder prefix to geometry includes (#5489) 2023-07-31 19:17:02 -07:00