Commit Graph

26 Commits

Author SHA1 Message Date
Gold856
97d0b15f7d Add README files for some subprojects and update various other docs (#8640)
Adds a section on design philosophy so we have something to point to
when people suggest features that aren't compatible with the way WPILib
is designed. Fixes some missed reorg changes (although the native-utils
link intentionally points to main as to be up-to-date in the future) and
generally cleans up any outdated information. Also includes wording
about supporting FTC. Per discussion in Slack, the LabVIEW wording has
been removed, and anything to do with LabVIEW is going to have to be
NI's job. And pursuant to #2757 and #5331, additional (light) developer
documentation has been added to some subprojects, mostly being a quick
summary of the what the project does and what it's for (or not for).

---------

Co-authored-by: sciencewhiz <sciencewhiz@users.noreply.github.com>
Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
2026-04-26 16:39:26 -07:00
Tyler Veness
af7d68e993 [wpiutil] Use C++23 stacktrace library on Windows (#6839)
This lets us remove the unmaintained StackWalker library and its hacky
upstream_utils script.

@Gold856 reported that StackWalker gives blank stacktraces:
https://discord.com/channels/176186766946992128/368993897495527424/1261940029287301150.
They also reported an earlier version of this PR giving the following
stacktrace instead:
```
D:\allwpilib\developerRobot\src\main\native\cpp\Robot.cpp(18): developerRobotCpp!Robot::RobotInit+0xB6
D:\allwpilib\wpilibc\src\main\native\cpp\TimedRobot.cpp(22): wpilibcd!frc::TimedRobot::StartCompetition+0x4F
D:\allwpilib\wpilibc\src\main\native\include\frc\RobotBase.h(36): developerRobotCpp!frc::impl::RunRobot<Robot>+0xC8
D:\allwpilib\wpilibc\src\main\native\include\frc\RobotBase.h(106): developerRobotCpp!frc::StartRobot<Robot>+0x17E
D:\allwpilib\developerRobot\src\main\native\cpp\Robot.cpp(60): developerRobotCpp!main+0xB
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79): developerRobotCpp!invoke_main+0x39
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288): developerRobotCpp!__scrt_common_main_seh+0x132
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331): developerRobotCpp!__scrt_common_main+0xE
D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17): developerRobotCpp!mainCRTStartup+0xE
KERNEL32!BaseThreadInitThunk+0x1D
ntdll!RtlUserThreadStart+0x28
```
2026-04-26 00:15:39 -07:00
Tyler Veness
7e9138f8c1 [upstream_utils] Upgrade to Google Benchmark 1.9.5 (#8760) 2026-04-11 16:52:24 -07:00
Gold856
2102a543d1 Change Java JSON to Avaje Jsonb (#8721)
Jackson is a very heavy library; it supports loads of features that we
don't need, and historically has caused issues due to long class loading
times (a little over 2 seconds to load AprilTagFieldLayout). This often
manifests as a help request in the form of "my robot disables when I do
X, but doesn't disable when doing X in subsequent attempts until code
restart." While SC has brought down Jackson loading times significantly,
with AprilTagFieldLayout loads taking only 330 milliseconds, that's
still a rather long delay, and while libraries should handle any JSON
loading ahead of time to prevent delays in auto/teleop, it would still
be good to make the worst case better to reduce user frustration.
Benchmarks indicate using [Avaje
Jsonb](https://github.com/avaje/avaje-jsonb) to load AprilTagFieldLayout
only takes ~70 ms, a fair chunk of which isn't actually in Avaje Jsonb
(~4 ms is spent on using getResourceAsStream to retrieve the JSON file,
~8 ms is spent on just loading the AprilTag class and its dependencies).

Note that all times listed are end-to-end, meaning nothing else was done
except for the operation being benchmarked, and doing arithmetic on them
can be flawed due to some classes being loaded twice, i.e.,
getResourceAsStream and `new AprilTag()` likely load some of the same
JDK classes and so subtracting both from the Avaje Jsonb load time is
likely slightly incorrect because class loading is being double counted.
For our purposes, it's likely accurate enough and is mostly just for
contextualization.

Benchmarks were run on a Raspberry Pi CM5 with 2 GB of RAM. Source code
for the
[results](https://github.com/user-attachments/files/26471452/benchmark.txt)
can be found in the "Fastjson2" commit
(2456d15ca8ebd17635e607cd40bf8816e77869a1).

Avaje Jsonb uses code generation via annotation processors to generate
the classes needed to do JSON serde and uses service providers to find
them, which will require downstream changes in robot projects, as the
different service providers in each library must be merged together for
Avaje Jsonb to function. We will use the Gradle shadow plugin, as its
already used by the installer and therefore adds zero additional
dependencies.
2026-04-10 23:21:00 -07:00
Tyler Veness
d248c040bf [wpimath] Add Sleipnir Java bindings (#8236)
The wrapper includes reverse mode autodiff, the Problem DSL, and the
optimal control problem API. I wrote it by directly translating the
upstream
[API](https://github.com/SleipnirGroup/Sleipnir/tree/main/include/sleipnir)
and [tests](https://github.com/SleipnirGroup/Sleipnir/tree/main/test) to
Java (i.e., copy-paste-modify).

I replaced the ArmFeedforward and Ellipse2d JNIs with implementations
using the Sleipnir Java bindings. Switching dev binary JNIs to release
by default sped up wpimath test runs from several minutes to 7 seconds.
2026-03-29 22:34:21 -07:00
Thad House
b2b111dc11 Rename FRC to WPILib (#8637) 2026-03-13 23:05:55 -07:00
Sam Carlberg
793b0a3187 [build] Migrate to Gradle version catalogs (#8524)
Also fixes the google compile-testing library to 0.23.0 (the latest
available at time of writing) instead of a wildcard

Jackson versions were inconsistent across projects; most were on 2.19.2,
but the fields subproject was on 2.15.2. All projects are now on 2.19.2
for consistency
2026-02-20 15:31:33 -08:00
Tyler Veness
245186cb15 Fix clangd #include warnings (#8565) 2026-02-11 12:15:02 -07:00
Thad House
af0a3e9c2f [build] Update to gradle 9.2.0, use new reorged plugins (#8471) 2025-12-13 21:44:00 -08:00
Tyler Veness
08784dc2d1 [upstream_utils] Upgrade to Sleipnir 0.3.2 (#8323)
Also includes a C++ benchmark, which has a Java counterpart in #8236.
2025-12-01 13:51:28 -07:00
Tyler Veness
1705b2d61c Upgrade wpiformat and use clang-format's include sorting (#8350)
This PR also uses the newly added -default-branch flag to generate the list of changed files with respect to the correct branch (2027).
2025-11-11 18:05:12 -08:00
Tyler Veness
694a79579e [benchmark] Split benchmarks into separate files (#8351)
Also add Sleipnir cart-pole benchmark from #8323.
2025-11-10 11:36:21 -07:00
Peter Johnson
fc4e922206 Use wpilib.robot instead of frc.robot (#8345) 2025-11-08 16:22:34 -08:00
PJ Reiniger
928ff20695 SCRIPT: FRC_ replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
9aca8e0fd6 SCRIPT namespace replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
1e7604f81c SCRIPT: wpiformat 2025-11-07 23:09:21 -08:00
PJ Reiniger
c48b722dac SCRIPT: Spotless Apply 2025-11-07 23:09:21 -08:00
PJ Reiniger
7c6efa41ae SCRIPT Run cc include replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
f0a3c64121 SCRIPT Run java package replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
10b4a0c971 SCRIPT fixup project rename 2025-11-07 23:09:21 -08:00
Peter Johnson
7ff312bb69 Merge branch 'main' into 2027 2025-10-06 19:43:02 -07:00
Tyler Veness
bb5ee73e46 [build] Build JNI and benchmarks as release by default (#8257)
It doesn't make sense to benchmark debug binaries. Also, wpimath JNI
performance in unit tests is drastically impacted by debug vs release.
2025-09-29 17:47:17 -07:00
Peter Johnson
ef676aca70 Merge branch 'main' into 2027 2025-09-25 22:17:00 -07:00
Tyler Veness
ab53d51c6f Fix or suppress clang-tidy warnings (#8254) 2025-09-25 21:28:04 -07:00
ninjadrknss
96004f9bb5 [wpimath] Replace Pose2/3d.exp(Twist2/3d) with Pose2/3d.plus(Twist2/3d.exp()) (#8188)
This better matches math notation.
2025-08-30 11:37:09 -07:00
Joseph Eng
2fc86a155d [benchmark] Add benchmark subproject (#8042) 2025-07-15 21:16:06 -07:00