Tyler Veness
0d9956273c
[wpimath] Add CoordinateSystem.convert() translation and rotation overloads ( #4227 )
2022-05-18 20:41:15 -07:00
Tyler Veness
6a4752dcdc
Fix GCC 12.1 warning false positives ( #4246 )
2022-05-18 12:22:10 -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
f341e1b2be
[wpimath] Document standard coordinate systems better (NFC) ( #4228 )
2022-05-14 15:31:06 -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
Kaitlyn Kenwell
708a4bc3bc
[wpimath] Conserve previously calculated swerve module angles when updating states for stationary ChassisSpeeds ( #4208 )
...
* Calculated swerve module states now stored in a member variable
* If ChassisSpeeds(0, 0, 0) is converted to module speeds, the
previously calculated module angle will be conserved, with forward speed
set to 0
* New tests added
2022-05-06 08:38:20 -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
Tyler Veness
ebd2a303bf
[wpimath] Remove deprecated MakeMatrix() function ( #4202 )
2022-04-30 22:52:05 -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
97c493241f
[wpimath] UnscentedKalmanFilter: Move implementation out-of-line
2022-04-30 20:38:55 -07:00
Peter Johnson
8ea90d8bc9
[wpimath] ExtendedKalmanFilter: Move implementation out-of-line
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
Starlight220
18ff694f02
[wpimath] Add Rotation2d.fromRadians factory ( #4178 )
2022-04-30 00:19:29 -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
355a11a414
Update Java linters and fix new PMD errors ( #4157 )
...
PMD requires that variables only initialized in the constructor be
final. The compiler errors if those final variables aren't guaranteed to
be initialized, so extra else branches were added to ensure that.
PMD also requires that classes with only private constructors be final.
The equivalent C++ classes were finalized as well, except for
TimeInterpolatableBuffer because it doesn't expose factory functions.
2022-04-24 07:18:05 -07:00
camaj
922d50079a
[wpimath] Units: fix comment in degreesToRotations (NFC) ( #4159 )
2022-04-13 22:32:55 -07:00
Jonah Snider
dd163b62ae
[wpimath] Rotation2d: Add factory method that uses rotations ( #4166 )
...
Rotation2d.fromRotations(1).equals(new Rotation2d(2 * Math.PI)); // true
Also adds a member method to get the value of the Rotation2d in rotations.
2022-04-13 22:31:43 -07:00
Tyler Veness
aef4b16d4c
[wpimath] Remove unnecessary NOLINT in LinearPlantInversionFeedforward (NFC) ( #4155 )
2022-04-08 21:31:42 -07:00
Tyler Veness
5bf46a9093
[wpimath] Add ComputerVisionUtil ( #4124 )
...
Closes #4108 .
2022-04-08 21:20:53 -07:00
Tyler Veness
c8905ec29a
[wpimath] Remove ImplicitModelFollower dt argument ( #4119 )
...
The math works just fine without model discretization.
2022-03-29 11:29:06 -07:00
Tyler Veness
b4620f01f9
[wpimath] Fix Rotation2d interpolation in Java ( #4125 )
...
Fixes #4112 .
2022-03-29 08:42:43 -07:00
Tyler Veness
2e462a19d3
[wpimath] Constexprify units unary operators ( #4138 )
...
Fixes #4137 .
2022-03-29 08:42:08 -07:00
Tyler Veness
ba0dccaae4
[wpimath] Fix reference to Rotation2d.fromRadians() ( #4118 )
...
Rotation2d.fromRadians() doesn't exist. The constructor should be used
instead.
2022-03-20 21:57:03 -07:00
Tyler Veness
8d79dc8738
[wpimath] Add ImplicitModelFollower ( #4056 )
2022-03-20 00:36:12 -07:00
Tyler Veness
78108c2aba
[wpimath] Fix PIDController having incorrect error after calling SetSetpoint() ( #4070 )
2022-03-19 23:59:00 -07:00
Tyler Veness
765efa325e
[wpimath] Remove redundant column index from vectors ( #4116 )
2022-03-19 20:44:14 -07:00
Tyler Veness
89ffcbbe41
[wpimath] Update TrapezoidProfile class name in comment (NFC) ( #4107 )
2022-03-19 20:41:53 -07:00
Tyler Veness
95ae23b0e7
[wpimath] Improve EKF numerical stability ( #4093 )
...
The Joseph form of the error covariance update equation is more
numerically stable when the Kalman gain isn't optimal. Numerical
instability and filter divergence can occur if the user goes long time
periods between updates and the error covariance becomes ill-conditioned
(the ratio between the largest and smallest eigenvalue gets too large).
2022-03-19 20:41:28 -07:00
Tyler Veness
d5cb6fed67
[wpimath] Support zero cost entries in MakeCostMatrix() ( #4100 )
...
The existing implementation will produce a cost of NaN if a tolerance of
infinity is entered, but the limit approaches zero. Being able to
specify that a state has no cost is useful, so this change adds support for
that.
2022-03-19 20:40:26 -07:00
Tyler Veness
d0fef18378
[wpimath] Remove redundant this. from ExtendedKalmanFilter.java ( #4115 )
2022-03-19 20:39:10 -07:00
Tyler Veness
d640c0f41f
[wpimath] Fix pose estimator local measurement standard deviation docs (NFC) ( #4113 )
2022-03-19 20:38:32 -07:00
Tyler Veness
2668130e70
[wpimath] Remove SwerveDrivePoseEstimator encoder reset warning ( #4066 )
...
SwerveDrivePoseEstimator uses velocities, so position resets aren't
needed.
Closes #4065 .
2022-02-28 17:40:25 -08:00
shueja-personal
dae18308c9
[wpimath] Minor fixes to Rotation2d docs (NFC) ( #4055 )
...
Fixed incorrect examples on .plus(), and a missing word.
Make example code snippets closer to actual use.
2022-02-27 16:56:56 -08:00
Alberto Jahuey Moncada
ac5d46cfa7
[wpilibc] Fix ProfiledPID SetTolerance default velocity value ( #4054 )
...
When trying to set the tolerance of a ProfiledPID, it fails if you don't give it a velocity value. It was missing a conversion from double to the appropiate unit.
2022-02-25 20:27:56 -08:00
Tyler Veness
3f77725cd3
Remove uses of iostream ( #4004 )
...
Most of these were unused, the IMU ones were just debug messages.
The only one that wasn't removed is in portable-file-dialogs.cpp since
the replacement looks less trivial.
2022-02-05 23:00:31 -08:00
Oblarg
d68d6674e8
[examples] Armbot: rename kCos to kG ( #3975 )
2022-01-31 00:16:26 -08:00
Tyler Veness
eb4d183e48
[wpimath] Fix clang-tidy bugprone-integer-division warning ( #3966 )
...
The integer conversion is deliberate.
2022-01-26 18:38:45 -08:00