Commit Graph

5295 Commits

Author SHA1 Message Date
Tyler Veness
0ef8a4e1df [wpimath] Support formatting more Eigen types (#4391)
Added an Eigen::SparseMatrix formatter.

Also modified the Eigen::Matrix formatter to support Eigen::MatrixXd.
Eigen::MatrixXd sets both dimension template arguments to -1, so they
can't be used for iteration. rows() and cols() are now used instead.

rows() and cols() are constexpr for statically sized matrices, so
there's no performance loss there.
2022-09-02 01:00:05 -07:00
Thad House
c393b3b367 [build] Update to native utils 2023.1.0 and Gradle 7.5.1 (#4392) 2022-09-02 00:59:47 -07:00
ohowe
b5a17f762c [wpimath] Add direction to slew rate limiter (#4377) 2022-09-01 14:46:46 -07:00
Tyler Veness
fafc81ed1a [wpiutil] Upgrade to fmt 9.1.0 (#4389) 2022-09-01 14:45:18 -07:00
Peter Johnson
cc56bdc787 [wpiutil] SafeThread: Add Synchronization object variant (#4382)
This enables use of SafeThread with Synchronization's WaitForObjects() blocking.
2022-08-31 11:29:57 -07:00
Starlight220
4254438d8d [commands] Mark command group lifecycle methods as final (#4385)
This prevents accidental footguns due to overriding of command group lifecycle methods.
2022-08-31 09:15:28 -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
Peter Johnson
d22ff8a158 [wpiutil] Add JNI access to C++ stderr (#4381)
This is useful in some debugging scenarios.  System.err is separately buffered, so when e.g. debugging test cases it doesn't interleave correctly with the C++ stdout/stderr logging. Even using flush() doesn't seem to help, I think because Gradle does its own buffering.
2022-08-30 20:40:16 -07:00
Peter Johnson
fdb5a2791f [wpiutil] jni_util: Add Mac-friendly MakeJLongArray/JArrayRef (#4383)
Mac has jlong == long long and int64_t = long, so the types are
incompatible despite being the same size.
2022-08-30 20:39:42 -07:00
Starlight220
c3a93fb995 [commands] Revamp Interruptible (#4192) 2022-08-29 21:53:47 -07:00
OmegaMetor
f2a8d38d2a [commands] Rename Command.repeat to repeatedly (#4379) 2022-08-29 15:20:17 -07:00
Peter Johnson
9e24c6eac0 [wpiutil] Logger: paren-protect instance usage in macro (#4384) 2022-08-29 13:25:53 -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
Brandon Parsons
eb08486039 [build] Fix MacOS binary rpath generation (#4376)
For RPATH on MacOS use '@loader_path' instead of '$ORIGIN' to reference the directory where the executable is located. The latter is the mechanism used on Linux.

I think this was exposed due to newer OS X ignoring $DYLD_LIBRARY_PATH for security reasons.
2022-08-25 18:17:16 -07:00
Tyler Veness
ccf83c634a [build] Use native-utils platform names instead of raw strings (#4375) 2022-08-25 12:54:11 -07:00
Peter Johnson
3fd69749e7 [docs] Upgrade to doxygen 1.9.4 (#4370)
Doxygen 1.9.2 requires libclang-9, which is no longer available on
Ubuntu 22.04.
2022-08-21 18:49:04 -07:00
Peter Johnson
594df5fc08 [wpinet] uv/util.h: Pull in ws2_32.lib on Windows for ntohs (#4371) 2022-08-21 18:48:49 -07:00
Tyler Veness
539070820d [ci] Enable asan for wpinet and wpiutil (#4369) 2022-08-21 14:59:07 -07:00
Peter Johnson
564a56d99b [wpinet] Fix memory leak in WorkerThreadTest (#4368) 2022-08-21 10:29:31 -07:00
Tyler Veness
5adf50d93c [upstream_utils] Refactor upstream_utils scripts (#4367)
* Root folder variable names are now more descriptive
* clone_repo() now restores the current working directory
* Removed setup_upstream_repo() since it's now identical to clone_repo()
* Moved am_patches()'s for loop into user scripts so the filename prefix
  doesn't need to be included in every patch filename
* Renamed am_patches() to git_am() since its only job now is to run "git am"
* Removed unused apply_patches() function
* Fixed typo in git_am()'s ignore_whitespace arg name
2022-08-20 07:26:34 -07:00
Tyler Veness
d80e8039d7 [wpiutil] Suppress fmtlib clang-tidy warning in C++20 consteval contexts (#4364) 2022-08-19 23:52:19 -07:00
Tyler Veness
0e6d67b23b [upstream_utils] Remove yapf format disable comment (#4366) 2022-08-19 23:51:57 -07:00
Tyler Veness
be5270697a [build] Suppress enum-enum deprecation warning in OpenCV (#4365) 2022-08-19 23:51:43 -07:00
Tyler Veness
8d28851263 Add Rosetta install command to build requirements (#4363) 2022-08-18 19:58:43 -07:00
Tyler Veness
3d2115c93e [wpinet] include-what-you-use in MulticastTest (#4360)
This fixes an MSVC compilation error with C++20.
2022-08-18 14:03:55 -07:00
Tyler Veness
91002ae3cc [wpimath] Upgrade to Drake 1.6.0 (#4361) 2022-08-18 14:03:28 -07:00
Tyler Veness
148c18e658 [wpinet] Upgrade to libuv 1.44.2 (#4362) 2022-08-18 13:57:49 -07:00
Tyler Veness
a2a5c926b6 Fix clang-tidy warnings (#4359)
The warnings included recommendations of braces for if statement
readability, a recommendation for default initialization of an int
array, and include-what-you-use (indirectly through clang-tidy reporting
undefined symbols).
2022-08-17 19:53:56 -07:00
Tyler Veness
ea6b1d8449 [wpiutil] Remove unused ManagedStatic class (#4358)
We migrated to magic statics for lazy construction like the following:
```cpp
class Singleton {
  static Singleton& GetSingleton() {
    static Singleton instance;
    return instance;
  }
};
```
2022-08-17 18:04:42 -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
151dabb2af [wpiutil] Upgrade to fmt 9.0.0 (#4337)
fmt removed fmt::make_args_checked since it's no longer needed for
constexpr format string checks.

fmt deprecated implicit conversions from enums to integers in format
arguments, so I added explicit static casts.
2022-08-16 15:35:26 -07:00
Tyler Veness
340465c929 [ci] Upgrade to clang-format and clang-tidy 14 (NFC) (#4347) 2022-08-16 15:25:04 -07:00
Michael Leong
d45bcddd15 [examples] Add comments to StateSpaceDifferentialDrive (#4341) 2022-08-15 06:26:20 -07:00
Tyler Veness
0e0786331a Update LLVM libraries to 14.0.6 (#4350)
The main noticeable change is the SmallString conversion operator to std::string is now explicit instead of implicit.
2022-08-15 05:38:15 -07:00
Tyler Veness
c5db23f296 [wpimath] Add Eigen sparse matrix and iterative solver support (#4349)
These are useful for efficiently solving huge, but sparse systems of
equations that occur often in optimization problems.
2022-08-13 18:32:02 -07:00
Tyler Veness
44abc8dfa6 [upstream_utils] Remove git version from upstream patches (#4351)
This reduces commit noise when other git versions are used. The version
was removed by passing `--no-signature` to `git format-patch` which is
now documented in the readme.
2022-08-13 18:31:26 -07:00
Tyler Veness
3fdb2f767d [wpimath] Add comments with Ramsete equations (#4348) 2022-08-11 07:09:16 -07:00
Tyler Veness
0485f05da9 [wpilibjExamples] Upgrade jacoco to match allwpilib (#4346) 2022-08-05 10:21:40 -07:00
Thad House
0a5eb65231 [wpinet] Handle empty txt block for mdns announcer (#4072) 2022-08-03 11:15:56 -07:00
sciencewhiz
19ffebaf3e [wpilib] Add reference to I2C Lockup to API Docs (NFC) (#4340) 2022-07-29 21:01:21 -07:00
Tyler Veness
ce1a90d639 [hal] Replace SerialHelper "goto done" with continue (#4342)
The logic is already correct for closing all the objects. So we should just be continuing on error.
2022-07-27 14:37:32 -07:00
Tyler Veness
d25af48797 [ci] Make upstream_utils CI fail on untracked files (#4339)
This catches issues like update scripts putting new files in a different
directory from the old ones.
2022-07-24 19:34:16 -07:00
Jeffrey Morris
ebb836dacb [examples] Fix negations in event loop examples (#4334) 2022-07-24 19:33:52 -07:00
Tyler Veness
d83e202f00 [upstream_utils] Update paths in update_fmt.py (#4338) 2022-07-22 18:08:36 -07:00
Tyler Veness
3ccf806064 [wpimath] Remove redundant LinearFilter.finiteDifference() argument (#4335)
The number of samples is already determined by the length of the stencil
list.
2022-07-22 12:50:30 -05:00
Tyler Veness
6f1e01f8bd [wpimath] Document example of online filtering for LinearFilter.finiteDifference() (#4336) 2022-07-22 12:46:33 -05:00
sciencewhiz
1023c34b1c [readme] Update location of ni-libraries (#4333)
Fixes #4321
2022-07-09 17:44:03 -05:00
Tyler Veness
faa29d596c [wpilib] Improve Notifier docs (NFC) (#4326) 2022-07-01 06:45:00 -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
82fac41244 [wpimath] Better document trackwidth parameters (NFC) (#4324) 2022-07-01 06:42:49 -07:00