Ryan Blue
27b173374e
[wpimath] Add minLinearAccel parameter to DifferentialDriveAccelerationLimiter ( #4422 )
2022-10-10 08:57:37 -07:00
Starlight220
b2276e47de
[wpimath] Enable continuous angle input for HolonomicDriveController ( #4453 )
2022-10-06 17:46:22 -05:00
Tyler Veness
b53b3526a2
[wpimath] Add CoordinateSystem conversion for Transform3d ( #4443 )
...
I also refactored Pose3d's conversion implementation to use the
Translation3d and Rotation3d conversions, thereby giving Translation3d
and Rotation3d test coverage. No changes were made to the expected
values of the Pose3d conversion tests.
The expected values of the Transform3d conversion tests were copied from
the Pose3d conversion tests without modification.
2022-10-01 21:09:04 -07:00
Tyler Veness
38bb23eb18
[wpimath] Add scalar multiply and divide operators to all geometry classes ( #4438 )
...
Closes #4435 .
2022-09-28 21:34:29 -07:00
Tyler Veness
ab1baf4832
[wpimath] Add rotation matrix constructor to Rotation3d ( #4413 )
2022-09-17 00:17:30 -07:00
Tyler Veness
5149f7d894
[wpimath] Add two-vector Rotation3d constructor ( #4398 )
...
This is useful for turning a 3D vector into an orientation relative a
coordinate system vector.
2022-09-04 13:16:29 -07:00
Tyler Veness
20b5bed1cb
[wpimath] Clean up Java Quaternion class ( #4399 )
...
Vector.norm() and Vector.dot() were added to make the implementation
simpler and match the C++ version more closely.
2022-09-04 09:45:02 -07:00
CarloWoolsey
97c15af238
[wpimath] LinearSystemId: Fix docs, move C++ impls out of header ( #4388 )
...
- Fix inaccuracies and inconsistencies in Java & C++ LinearSystemId documentation.
- Move LinearSystemId function definitions to LinearSystemId.cpp
2022-08-31 09:12:48 -07:00
Tyler Veness
fe4d12ce22
[wpimath] Add LTV controller derivations and make enums private ( #4380 )
...
The LTV differential drive controller derivation wasn't included inline
because it's too long.
2022-08-28 23:04:52 -07:00
Tyler Veness
ac9be78e27
Use stricter C++ type conversions ( #4357 )
...
Now, implicit narrowing conversions are only used with wpi::Now(). This
also fixes clang-tidy warnings about C-style casts. For example:
```
== clang-tidy /__w/allwpilib/allwpilib/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.inc ==
/__w/allwpilib/allwpilib/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.inc:95:18: warning: C-style casts are discouraged; use static_cast/const_cast/reinterpret_cast [google-readability-casting]
auto curTime = units::second_t(m_timer.Get());
^
```
In that case at least, the cast was removed entirely since Get() already
returns a units::second_t.
2022-08-17 13:42:36 -07:00
Tyler Veness
3fdb2f767d
[wpimath] Add comments with Ramsete equations ( #4348 )
2022-08-11 07:09:16 -07:00
Tyler Veness
add00a96ed
[wpimath] Improve DifferentialDriveAccelerationLimiter docs (NFC) ( #4323 )
...
Defined trackwidth, added skipped steps to the algorithm's internal
proof, and grouped the algorithm steps more logically with blank lines.
2022-07-01 06:43:57 -07:00
Tyler Veness
9b1bf5c7f1
[wpimath] Move Drake and Eigen to thirdparty folders ( #4307 )
2022-06-11 21:07:15 -07:00
Connor Worley
a99c11c14c
[wpimath] Replace UKF implementation with square root form ( #4168 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2022-06-08 22:19:01 -07:00
Prateek Machiraju
d9f9cd1140
[wpimath] Reset prev_time on pose estimator reset ( #4283 )
2022-06-02 21:21:42 -07:00
Tyler Veness
5aa67f56e6
[wpimath] Clean up math comments ( #4252 )
2022-05-20 15:16:56 -07:00
Tyler Veness
0d9956273c
[wpimath] Add CoordinateSystem.convert() translation and rotation overloads ( #4227 )
2022-05-18 20:41:15 -07:00
Tyler Veness
5876b40f08
[wpimath] Memoize CoordinateSystem and CoordinateAxis statics ( #4241 )
2022-05-18 10:47:46 -07:00
Max Gordon
a3d44a1e69
[wpimath] Add Translation2d.getAngle() ( #4217 )
...
Co-authored-by: Max Gordon <tonald.drump2.0@gamil.com >
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2022-05-14 21:22:00 -07:00
Tyler Veness
b33715db15
[wpimath] Add CoordinateSystem class ( #4214 )
2022-05-07 10:25:19 -07:00
Tommy Beadle
dc6f641fd2
[wpimath] PIDController: Reset position and velocity error when reset() is called. ( #4064 )
...
In addition to m_prevError and m_totalError, m_positionError and
m_velocityError need to be reset to 0 when reset() is called.
Otherwise, the next time calculate() is called, the old values will be
used as the previous error, but this is inaccurate since the caller
wanted to reset the state of the PID controller.
2022-05-06 08:44:08 -07:00
Tyler Veness
f20a20f3f1
[wpimath] Add 3D geometry classes ( #4175 )
...
Also clean up 2D geometry documentation.
2022-05-06 08:41:23 -07:00
chen perach
ef7ed21a9d
[wpimath] Improve accuracy of ComputerVisionUtil.calculateDistanceToTarget() ( #4215 )
2022-05-06 08:36:58 -07:00
Tyler Veness
b1abf455c1
[wpimath] LTVUnicycleController: Use LUT, provide default hyperparameters ( #4213 )
2022-05-04 22:04:08 -07:00
Tyler Veness
d5456cf278
[wpimath] LTVDifferentialDriveController: Remove unused variable ( #4212 )
2022-05-04 22:03:15 -07:00
Tyler Veness
ee03a7ad3b
Remove most 2022 deprecations ( #4205 )
...
Excludes "old" commands and SimDevice functions.
2022-05-04 20:37:27 -07:00
Tyler Veness
ce1a7d698a
[wpimath] Refactor WheelVoltages inner class to a separate file ( #4203 )
2022-05-01 11:01:20 -07:00
Tyler Veness
87bf70fa8e
[wpimath] Add LTV controllers ( #4094 )
...
This adds a unicycle controller that's a drop-in replacement for Ramsete
and a differential drive controller that controls the full pose and
outputs voltages. The main benefit is LQR-like tuning knobs using a
system model.
2022-04-30 22:54:22 -07:00
Peter Johnson
e28776d361
[wpimath] LinearSystemLoop: Add extern templates for common cases
2022-04-30 20:38:55 -07:00
Peter Johnson
dac1429aa9
[wpimath] LQR: Use extern template instead of Impl class
2022-04-30 20:38:55 -07:00
Peter Johnson
e767605e94
[wpimath] Add typedefs for common types
...
This makes complex code significantly easier to read.
frc::Vectord<Size> = Eigen::Vector<double, Size>
frc::Matrixd<Rows, Cols> = Eigen::Matrix<double, Rows, Cols>
2022-04-30 20:38:55 -07:00
Peter Johnson
ae7b1851ec
[wpimath] KalmanFilter: Use extern template instead of Impl class
2022-04-30 20:38:55 -07:00
Peter Johnson
e3d62c22d3
[wpimath] Add extern templates for common cases
...
This helps reduce compile times and memory usage.
2022-04-30 20:38:55 -07:00
Oblarg
09cf6eeecb
[wpimath] ApplyDeadband: add a scale param ( #3865 )
...
Also templates it in C++ so it can work with both doubles and units.
2022-04-30 20:29:48 -07:00
Tyler Veness
d926dd1610
[wpimath] Fix pose estimator performance ( #4111 )
...
Fixes #4087 .
2022-04-26 18:43:59 -07:00
Tyler Veness
5ebe911933
[wpimath] Add DifferentialDriveAccelerationLimiter ( #4091 )
2022-04-24 07:21:40 -07:00
Tyler Veness
5bf46a9093
[wpimath] Add ComputerVisionUtil ( #4124 )
...
Closes #4108 .
2022-04-08 21:20:53 -07:00
Tyler Veness
78108c2aba
[wpimath] Fix PIDController having incorrect error after calling SetSetpoint() ( #4070 )
2022-03-19 23:59:00 -07:00
David Vo
792e735e08
[wpimath] Move TrajectoryGenerator::SetErrorHandler definition to .cpp ( #3920 )
...
Otherwise this function causes linking errors when used on Windows.
2022-01-15 08:58:49 -08:00
Matt
315be873c4
[wpimath] Add TimeInterpolatableBuffer ( #2695 )
...
These classes are useful for storing previous robot positions to use in conjunction with the upcoming pose estimators.
Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com >
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
Co-authored-by: cttew <cttewari@gmail.com >
2021-12-30 19:08:05 -08:00
Oblarg
b8d019cdb4
[wpilib] Rename NormalizeWheelSpeeds to DesaturateWheelSpeeds ( #3791 )
2021-12-30 18:30:08 -08:00
Oblarg
aa9dfabde2
[wpimath] Move debouncer to filters ( #3838 )
2021-12-28 09:49:41 -08:00
Tyler Veness
acb64dff97
[wpimath] Make RamseteController::Calculate() more concise ( #3763 )
2021-12-06 12:57:42 -08:00
Tyler Veness
04957a6d30
[wpimath] Fix units of RamseteController's b and zeta ( #3757 )
...
Fixes #3755 .
2021-12-03 18:21:30 -08:00
Oblarg
da90c1cd2c
[wpilib] Add bang-bang controller ( #3676 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2021-11-23 20:34:46 -08:00
Tyler Veness
2dc35c1399
[wpimath] Fix classpaths for JNI class loads ( #3697 )
...
Found by inspecting the results of the following rg commands:
`rg --multiline 'FindClass\(\s*"'`
`rg 'JClass' -A 1`
Fixes #3660 .
2021-10-29 16:23:46 -07:00
Tyler Veness
a939cd9c89
[wpimath] Print uncontrollable/unobservable models in LQR and KF ( #3694 )
...
IsDetectable() was added to make the code easier to read.
2021-10-29 00:03:02 -07:00
Tyler Veness
181723e573
Replace .to<double>() and .template to<double>() with .value() ( #3667 )
...
It's a less verbose way to do the same thing.
2021-10-25 08:58:12 -07:00
Tyler Veness
4647d09b50
[docs] Fix Doxygen warnings, add CI docs lint job ( #3639 )
...
The CI docs lint build is configured to fail on Doxygen warnings.
2021-10-14 18:09:38 -07:00
Tyler Veness
9359431bad
[wpimath] Clean up Eigen usage
...
* Replace Matrix<> with Vector<> where vectors are explicitly intended.
I found these via `rg "Eigen::Matrix<double, \w+, 1>"`.
* Pass all Eigen matrices by const reference. I found these via `rg
"\(Eigen"` on main (the initializer list constructors make more false
positives).
* Replace MakeMatrix() and operator<< usage with initializer list
constructors. I found these via `rg MakeMatrix` and `rg "<<"`
respectively.
* Deprecate MakeMatrix()
2021-09-17 12:12:19 -07:00