Commit Graph

194 Commits

Author SHA1 Message Date
Tyler Veness
9f6f267f5c [wpimath] DARE: Use wpi::expected instead of exceptions (#7312) 2024-10-31 20:37:57 -07:00
Joseph Eng
6745fc7c2f [wpimath] Fix C++ pose estimator poseEstimate initialization (#7249) 2024-10-21 22:29:04 -07:00
Tyler Veness
95b9bd880b [wpimath] Make geometry classes constexpr (#7222) 2024-10-18 16:08:41 -07:00
Joseph Eng
2054d0f57e [wpimath] Fix pose estimator reset methods (#7225) 2024-10-18 16:06:32 -07:00
Nicholas Armstrong
4adfa8bf64 [wpimath] Fully discretized ElevatorFF and ArmFF (#7024)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2024-10-10 22:10:45 -07:00
Nicholas Armstrong
fe80d72fba [wpimath] Add cosineScale method to SwerveModuleState and instance optimize (#7114) 2024-09-30 13:23:30 -06:00
Nicholas Armstrong
6281ec0810 [wpimath] PIDController: Update field and method names for error and errorDerivative (#7088) 2024-09-23 11:57:20 -06:00
Tyler Veness
554024767e Fix errors from new cpplint.py (#7105) 2024-09-20 17:43:39 -07:00
Tyler Veness
d44b651558 [build] Make Protobuf optional in CMake build (#7061) 2024-09-12 23:44:19 -07:00
Gold856
b12b83aa89 Fix typos with cspell (#6972) 2024-08-17 07:44:34 -07:00
Tyler Veness
8e0d9ac805 Clean up unit UDL usage (#6961) 2024-08-14 10:44:00 -07:00
Tyler Veness
685c732568 [wpimath] Make trajectory constraints use Rectangle2d and Ellipse2d (#6901) 2024-08-01 16:46:23 -07:00
Joseph Eng
073192d513 [wpimath] Add remaining struct and protobuf implementations (#5953) 2024-07-29 07:55:44 -07:00
Joseph Eng
e83a432731 [wpimath] Fix C++ feedforward constructors and add tests (#6873) 2024-07-27 16:28:59 -07:00
Joseph Eng
b4d42d8980 [wpimath] Make public final values in feedforwards private and add getters (#6851) 2024-07-20 07:01:56 -07:00
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
deb5f3d7af [wpimath] Exit early when parameterizing malformed spline (#6827)
Currently, a max iteration heuristic is used to determine when a spline
is malformed. Instead, we can report a failure immediately if dx and dy
are too small, because the heading won't be accurate either.

Fixes #6826.
2024-07-12 21:52:28 -07:00
Brendan Raykoff
8def7b2222 [wpimath] Add geometry classes for Rectangle2d and Ellipse2d (#6555)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2024-06-04 18:27:32 -07:00
Nicholas Armstrong
7fc17811fa [wpimath] Add full state support to LinearSystemId functions (#6554)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2024-05-15 07:23:22 -06:00
Tyler Veness
d88c71ffdc [wpiutil] Upgrade to fmt 10.2.1, add wpi::print (#6161)
We now use a wrapper (wpi::print) to catch exceptions since we can't patch
std::print() to not throw when we ultimately migrate to it.

fmtlib and std format/print throw the same exceptions and always have. We previously patched fmt::print() to not throw a write failure exception, but we can't do that for std::print(); wpi::print() is the migration plan.
2024-05-12 06:25:42 -07:00
Tyler Veness
dc00a13d83 [wpimath] Make cost and covariance matrix functions constexpr (#6444) 2024-05-07 15:32:14 -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
fd363fdf5a [wpimath] Add Sleipnir (#6541)
This is useful for solving quadratic programs.
2024-04-27 22:42:42 -07:00
Joseph Eng
cdfa2ece6f [wpimath] Add PoseEstimator.sampleAt() (#6426) 2024-04-27 21:03:37 -07:00
Peter Johnson
c88be31ec2 Merge branch 'development' 2024-04-21 20:15:51 -07:00
Tyler Veness
d26e6d9ecc [wpimath] Support formatting Eigen array types (#6496) 2024-04-04 09:19:50 -07:00
Tyler Veness
5370f249a1 [build] Upgrade to wpiformat 2024.33 (#6449)
This upgrades to clang-format and clang-tidy 18.1.1. This has the
constructor attribute formatting fix, so we can remove our
WPI_DEPRECATED macro.
2024-03-18 23:11:20 -07:00
DeltaDizzy
7bd8c44570 [wpimath] Add structured data support for DifferentialDriveWheelPositions (#6412) 2024-03-09 10:09:02 -08:00
Asa Paparo
62cba9a4d3 [wpimath] Add vector projection and geometry vector conversions (#6343) 2024-02-10 10:43:58 -08:00
Tyler Veness
177132fa2a Replace C++ unit .to<double>() with .value() (#6317)
The latter is shorter and is what we use everywhere else.
2024-01-27 07:58:25 -08:00
Tyler Veness
f29a7d2e50 [docs] Add missing JavaDocs (#6146) 2024-01-04 08:38:06 -08:00
Gold856
f87c64af8a [wpimath] MecanumDriveWheelSpeeds: Fix desaturate() (#6040) 2023-12-14 20:52:45 -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
Joseph Eng
14c3ade155 [wpimath] Struct cleanup (#6011) 2023-12-04 22:40:18 -08:00
Peter Johnson
a583ca01e1 [wpiutil] Change Struct to allow non-constexpr implementation (#5992)
This required changing the constant values (e.g. kSize) into functions
(e.g. GetSize()).

Fixed implementations of ForEachNested to be inline (as these are actually
templates).

Also added a ntcore Struct test.
2023-12-02 23:36:44 -08:00
Tyler Veness
30816111db [wpimath] Fix TimeInterpolatableBuffer crash (#5972)
Don't decrement buffer iterator if it's at the beginning of the
container.
2023-11-30 23:18:38 -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
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
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
Tyler Veness
3a1194be40 Replace static_cast<void>() with [[maybe_unused]] attribute (#5892)
This clarifies intent. Not done for thirdparty libraries or
structured binding variables.
2023-11-08 12:47:23 -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
Jordan McMichael
ecb7cfa9ef [wpimath] Add Exponential motion profile (#5720) 2023-10-19 17:26:32 -07:00
Brayden Zee
e814595ea7 [wpimath] Add ChassisSpeeds.fromRobotRelativeSpeeds() (#5744) 2023-10-17 10:13:04 -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
Jordan McMichael
33243f982b [wpimath] Expand Quaternion class with additional operators (#5600)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2023-10-08 16:42:53 -07:00
Colin Finn
6ef94de9b5 [wpimath] Add tests for ArmFeedforward and ElevatorFeedforward (#5663) 2023-09-18 22:25:08 -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
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