Commit Graph

318 Commits

Author SHA1 Message Date
Tyler Veness
ae4bcefefc [wpimath] Fix incorrect docs for Rotation3d default constructor (#6571)
A Rotation3d is not defined by one angle.
2024-05-01 09:06:13 -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
Isaac Turner
70417f64da [wpimath] Remove deprecated TrapezoidProfile constructors (#6558) 2024-04-29 21:04:57 -07:00
Isaac Turner
f5e08652f8 [wpimath] Remove deprecated MatBuilder factory (#6557) 2024-04-29 21:04:43 -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
Joseph Eng
cdfa2ece6f [wpimath] Add PoseEstimator.sampleAt() (#6426) 2024-04-27 21:03:37 -07:00
Isaac Turner
d14dfed828 [wpimath] Rotation2d: add Measure<Angle> getter (Java) (#6492) 2024-04-21 20:23:36 -07:00
Tyler Veness
2def62a1ef [wpimath] Document ChassisSpeeds::Discretize() math (NFC) (#6509) 2024-04-10 22:03:44 -07:00
Wispy
4a548935d3 [wpimath] Add Pair.toString() (#6463) 2024-03-24 23:51:08 -07:00
Tyler Veness
85ea5f8497 [wpimath] Make more LinearSystemId functions not throw if Kv = 0 (#6465) 2024-03-24 23:50:41 -07:00
Tyler Veness
973bb55e66 [wpimath] LinearSystemId: Don't throw if Kv = 0 (#6424)
That's just a system with no back-EMF.
2024-03-10 08:11:18 -07:00
DeltaDizzy
7bd8c44570 [wpimath] Add structured data support for DifferentialDriveWheelPositions (#6412) 2024-03-09 10:09:02 -08:00
shueja
6afff99640 [wpimath] ExponentialProfile: Return copy of input state (#6370)
As State is mutable, this avoids accidental modification of the passed-in object by the caller modifying the return value.
2024-02-15 16:32:51 -08:00
fodfodfod
1e168f363e [wpimath] Feed forwards: Use correct 'k' value in error message (#6360) 2024-02-11 10:42:04 -08:00
Asa Paparo
62cba9a4d3 [wpimath] Add vector projection and geometry vector conversions (#6343) 2024-02-10 10:43:58 -08:00
N0tACyb0rg
3207795d0d [wpimath] Add lastValue() method to filters (#6351) 2024-02-10 10:43:23 -08:00
Thad House
e9c744c456 [wpimath] Quaternion::Log(): Remove duplicate calls to norm() (#6358) 2024-02-10 10:41:19 -08:00
Tyler Veness
68736d802d [wpimath] Clean up profile classes (#6311)
* Reorder functions so they match between languages
* Copy more complete JavaDocs to C++
* Fix incorrect description for time parameter of
  TrapezoidProfile.calculate()
2024-01-25 22:22:42 -08:00
David Vo
a274e297cd Fix trivial errorprone warnings (NFC) (#6135) 2024-01-19 20:46:38 -08:00
Tyler Veness
f29a7d2e50 [docs] Add missing JavaDocs (#6146) 2024-01-04 08:38:06 -08:00
Tyler Veness
c486972c55 [wpimath] Make ExponentialProfile.State mutable (#6138)
It was already mutable in the C++ ExponentialProfile and
TrapezoidProfile in both languages.
2024-01-02 11:39:55 -08:00
Tyler Veness
ad0859a8c9 [docs] Add missing JavaDocs (#6125) 2024-01-01 22:56:23 -08:00
Braykoff
e1d49b975c [wpimath] Add LinearFilter reset() overload to initialize input and output buffers (#6133) 2024-01-01 21:20:53 -08:00
Joseph Eng
938bf45fd9 [wpiutil] Remove type param from ProtobufSerializable and StructSerializable (#6122) 2023-12-31 14:36:11 -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
Peter Johnson
aeb1a4aa33 [wpiutil] Add serializable marker interfaces (#6060) 2023-12-23 08:20:26 -08:00
ncorrea210
4e4a468d4d [wpimath] Make feedforward classes throw exceptions for negative Kv or Ka (#6084) 2023-12-23 08:12:46 -08:00
m10653
43fb6e9f87 [glass] Add Profiled PID controller support & IZone Support (#5959) 2023-12-22 11:29:25 -08:00
Tyler Veness
0b4c6a1546 [wpimath] Add more docs to SimulatedAnnealing (NFC) (#6054) 2023-12-16 11:03:54 -08:00
Gold856
f87c64af8a [wpimath] MecanumDriveWheelSpeeds: Fix desaturate() (#6040) 2023-12-14 20:52:45 -08:00
Tyler Veness
192a28af47 Fix JDK 21 warnings (#6028) 2023-12-09 21:45:02 -08:00
Ashray._.g
9d11544c18 [wpimath] Rotate traveling salesman solution so input and solution have same initial pose (#6015) 2023-12-05 23:21:28 -08:00
Tyler Veness
2bb1409b82 Clean up Java style (#5990)
Also make equivalent changes in C++ where applicable.

Co-authored-by: Sriman Achanta <68172138+srimanachanta@users.noreply.github.com>
2023-12-03 16:21:32 -08:00
Tyler Veness
ac7d726ac3 [wpimath] Add simulated annealing (#5961)
Co-authored-by: Ashray._.g <ashray.gupta@gmail.com>
2023-11-30 22:57:50 -08:00
Tyler Veness
e09be72ee0 [wpimath] Remove unused SimpleMatrixUtils class (#5979)
It looks like it was gradually replaced by JNI wrappers around Eigen.
2023-11-30 21:12:43 -08:00
Tyler Veness
0f9ebe92d9 [wpimath] Add generic circular buffer class to Java (#5969)
The original is now called DoubleCircularBuffer.
2023-11-30 21:12:23 -08:00
Prateek Machiraju
51eecef2bd [wpimath] Optimize 2nd derivative of quintic splines (#3292)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2023-11-30 21:07:52 -08:00
Tyler Veness
dfdea9c992 [wpimath] Make KalmanFilter variant for asymmetric updates (#5951) 2023-11-23 10:56:15 -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
PJ Reiniger
35744a036e [wpimath] Move struct/proto classes to separate files (#5918)
Also add unit tests.
2023-11-21 10:11:57 -08:00
Sam Carlberg
0ca1e9b5f9 [wpimath] Add basic wpiunits support (#5821)
To reduce the need for users to manually perform unit conversions, this allows Measure objects from wpiunits to be passed into most places in wpimath that currently expect doubles in terms of SI units like meters.

For example, users would need to know that unit conversion is required - and what the correct units are. Using units would be more difficult to write code for than just hardcoding a value or using Units.inchesToMeters.

Now, using units has no more developer overhead than using raw numbers.
2023-11-17 10:45:04 -06:00
Joseph Eng
79dd795bc0 [wpimath] Clean up VecBuilder and MatBuilder (#5906) 2023-11-14 12:23:50 -08:00
DeltaDizzy
78ebc6e9ec [wpimath] change G to gearing in LinearSystemId factories (#5834) 2023-11-12 20:22:39 -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
Bryce Roethel
87f7c19f90 [wpimath] Make InterpolatingDoubleTreeMap constructor public (#5865) 2023-11-03 15:34:14 -07:00
Tyler Veness
6b53ef47cf [wpimath] Don't recreate TrapezoidProfile in ProfiledPIDController calculate() (#5863) 2023-11-03 15:21:58 -07:00
Tyler Veness
ec569a58ef [wpimath] Make KalmanTypeFilter interface public (#5830) 2023-10-26 19:18:02 -07:00
Tyler Veness
98c14f1692 [wpimath] Add EKF/UKF u-y-R correct overload (#5832)
Also clean up comments on other overloads and fix a typo.
2023-10-26 19:17:15 -07:00
sciencewhiz
f4cbcbc984 Fix typos (NFC) (#5804) 2023-10-23 09:15:58 -07:00
Peter Johnson
cf54d9ccb7 [wpiutil, ntcore] Add structured data support (#5391)
This adds support for two serialization formats for complex data types:

- Protobuf for complex objects with variable length internals that need forward and backward wire compatibility (lower speed, more flexible)
- Raw struct (ByteBuffer-style) for fixed-length objects (higher speed, less flexible)

Deserialization can be done either by creating a new object (for immutable objects) or overwriting the contents of an existing object (for mutable objects).

Implementing classes should provide inner classes that implement the Protobuf or Struct interface (in Java) or specialize the wpi::Protobuf or wpi::Struct struct (in C++). It is possible for classes to implement both. If the class itself does not implement serialization, it's possible for third parties/users to provide an implementation instead.

Uses the Google protobuf implementation for C++ and the QuickBuffers alternative protobuf implementation for Java.
2023-10-19 21:41:47 -07:00