921 Commits

Author SHA1 Message Date
Matt
b61f08d3fa [wpilib] Add physics simulation support with state-space (#2615)
This includes physics simulation support for arms/elevator models, as well as differential drivetrains.

Swerve might be added at a later date.

Co-authored-by: Claudius Tewari <cttewari@gmail.com>
Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com>
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2020-09-20 09:39:52 -07:00
Peter Johnson
67e1796ef6 [wpimath] Fix Eigen rule-of-three violations (#2707)
This avoids deprecated-copy warnings on recent clang and GCC compilers.

Applied from https://gitlab.com/libeigen/eigen/-/merge_requests/29/diffs
2020-09-12 23:01:15 -07:00
Tyler Veness
ae2809cad4 [wpimath] Update KalmanFilter C++ class docs based on Java (NFC) (#2699) 2020-09-10 14:21:04 -07:00
Tyler Veness
b0a296477e [wpimath] Use newer link to controls book in comments (NFC) (#2700) 2020-09-10 14:20:06 -07:00
Peter Johnson
629a4574db [wpimath] Include Eigen headers in cppHeadersZip (#2696) 2020-09-06 20:53:57 -07:00
Tyler Veness
4be809499d [wpimath] Use more specific Eigen includes in headers (#2693)
This helps reduce compilation overhead. I tried slimming down includes
of <Eigen/QR>, but the householderQr() function we use from there
requires including dependency headers from Eigen that don't fit with
lexographic ordering. It didn't seem worth the effort to work around.

This won't affect user code at all since all the Eigen feature usage
here is internal only; users generally only need <Eigen/Core>.
2020-09-04 20:52:03 -07:00
Tyler Veness
35790a8990 [wpimath] Remove rho overload from LinearQuadraticRegulator constructors (#2687)
It was added as part of Bryson's rule described in
https://file.tavsys.net/control/controls-engineering-in-frc.pdf. It
doesn't really simplify usage though, and the same thing can be
replicated by multiplying the elements of Q by rho manually. It's easier
to do it that way, it's how 3512 has been doing controller debugging for
a while, and it's probably what other teams will do as well instead of
using the "more structured" way.

Removing these unhelpful overloads also simplifies the LQR interface.
2020-09-03 20:53:17 -07:00
Matt
8edc17dac9 [wpimath] Add Vector overload for times and div (#2686) 2020-09-03 20:48:43 -07:00
Matt
502f5c8b5f [wpimath] Make LinearPlantInversionFeedforward's A and B matrices final (#2688) 2020-09-03 19:07:36 -07:00
Matt
bc28fb187c [wpimath] Remove print from LinearSystemIDTest (#2684) 2020-09-03 19:06:52 -07:00
sciencewhiz
3e41d92c18 [wpilib] Use misspell to fix spelling errors (NFC) (#2674) 2020-08-31 00:33:11 -07:00
Tyler Veness
947ff655c5 [wpimath] Refactor KalmanFilter to be steady-state only (#2657)
I didn't notice a performance difference between the original
implementation and this one for a flywheel simulation, so this
simplifies a lot of internals.

This class can no longer implement KalmanTypeFilter because that class
allows setting the error covariance for use in the
KalmanFilterLatencyCompensator class. This won't impact the holonomic pose
estimators that use KalmanFilterLatencyCompensator because they all use an EKF.
2020-08-30 11:46:57 -07:00
Peter Johnson
70db0db221 [build] Don't unconditionally regenerate wpimath numbers (#2665)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2020-08-29 15:06:49 -07:00
Prateek Machiraju
807de9a0a9 [build] Fix Eigen include path for CMake install (#2649) 2020-08-22 11:55:12 -07:00
Prateek Machiraju
b23ede7d50 [wpimath] Remove unnecessary copying in constraints (#2645) 2020-08-19 19:36:58 -07:00
Matt
ef5e0c2e75 [wpimath] Remove duplicate WPIMathJNI class (#2639) 2020-08-16 17:16:53 -07:00
Matt
3b283ab9aa [wpimath] Add core State-space classes (#2614)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: Claudius Tewari <cttewari@gmail.com>
Co-authored-by: Declan Freeman-Gleason <declanfreemangleason@gmail.com>
2020-08-14 23:40:33 -07:00
Matt
e5b84e2f87 [wpimath] Use project includes for units, Drake, Eigen (#2634) 2020-08-08 11:54:03 -07:00
Peter Johnson
f86417d791 [wpimath] Move MathShared.h to wpimath/ directory
It was confusing to have it in math/ when the std <math> header exists.
2020-08-07 12:02:02 -07:00
Peter Johnson
8dc3d23831 [wpimath] Move DrakeJNI to edu.wpi.first.math.WPIMathJNI 2020-08-07 12:02:02 -07:00
Peter Johnson
42993b15c6 [wpimath] Move math functionality into new wpimath library (#2629)
The wpimath library is a new library designed to separate the reusable math functionality
from the common utility library (wpiutil) and the hardware-dependent library (wpilibc/j).

Package names / include file names were NOT changed to minimize breakage.  In a future year
it would be good to revamp these for a more uniform user experience and to reduce the risk
of accidental naming conflicts.

While theoretically all of this functionality could be placed into wpiutil, several pieces
of this library (e.g. DARE) are very time-consuming to compile, so it's nice to avoid this
expense for users who only want cscore or ntcore.  It also allows for easy future separation
of build tasks vs number of workers on memory-constrained machines.

This moves the following functionality from wpiutil into wpimath:
- Eigen
- ejml
- Drake
- DARE
- wpiutil.math package (Matrix etc)
- units

And the following functionality from wpilibc/j into wpimath:
- Geometry
- Kinematics
- Spline
- Trajectory
- LinearFilter
- MedianFilter
- Feed-forward controllers
2020-08-06 23:57:39 -07:00