Commit Graph

8326 Commits

Author SHA1 Message Date
Thad House
1299abc173 Remove comments and small things from repo that mention roboRIO (#9020)
The RoboRIO classes need to be fixed up, those are huge.
2026-07-01 23:08:57 -07:00
Gold856
5a06b81673 [wpilib] Publish AllianceStationID (#8856)
Glass now internally uses the AllianceStationID enum, but the two
separate topics remain for simple use cases. The Invalid alliance is now
published as Red, Station 0, instead of 3.

Fixes #6488 and fixes #8725.
2026-07-01 23:07:51 -07:00
Alan Everett
9dabcb99f3 [wpiutil] Add protobuf List pack/unpack for Java (#9042)
To aid in simplifying the packing/unpacking of Lists to protobuf, this
adds helper methods that put the iteration logic in `Protobuf.java`,
similar to arrays. This makes packing/unpacking a List a single line,
similar to other types. Useful for #8776 and #8172.
2026-07-01 23:03:06 -07:00
Austin Schuh
f494ff8c0d [bazel] Commit fully to bzlmod (#9035)
Move pybind11 over, delete the WORKSPACE files, and fix a test which
assumed WORKSPACE support was enabled.

---------

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2026-07-01 22:59:10 -07:00
Austin Schuh
ac6aaa0f3c [bazel] Use remote execution fix from wpilib_toolchains (#9037)
The latest toolchain release has my fix for remote execution. Use it.
This makes remote execution work fully in wpilib.

---------

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2026-07-01 22:58:26 -07:00
Thad House
dc20a147af [wpinet] Split mDNS headers to C and C++ (#9039) 2026-06-29 20:07:11 -07:00
Gold856
852e0dfd8e [wpiutil] Remove bit.hpp; replace with C++23 bit (#8792)
#7492 didn't catch all the uses and #7973 patched out byteswap in
Sleipnir for some reason (despite having upgraded compilers already)?
2026-06-29 08:37:27 -07:00
Gold856
54b0239984 [wpical] Fix race conditions and unnecessary alignment (#9033)
Alignment code isn't needed since C++17.

Bazel tests were segfaulting and asan traced this to use-after-frees
related to some of the atomic booleans. Worker threads are now joined to
ensure the thread is completely stopped and destroyed before the atomic
boolean is freed. The primary camera calibration thread also has had its
finished flag moved to a shared_ptr to ensure it lives long enough.
2026-06-28 16:55:01 -07:00
Thad House
8b9351ffa0 [wpimath,wpiutil] Switch std::is_constant_evaluated() to consteval (#9013)
Works around an ICE in the newest MSVC

gcem still uses the old method, at least for now
2026-06-28 16:53:44 -07:00
PJ Reiniger
329d214b90 [robotpy] Fix pybind11 stubgen (#9034)
#8787 Added a new compound unit that was tripping up the pybind11
stubgen when trying to mirror over to mostrobotpy land. This fixes the
error, and also cleans up some `create-imports` things.

```
[680/680] Generating semiwrap/modules/_wpimath.pyi with a custom command
FAILED: [code=1] semiwrap/modules/_wpimath.pyi 
/usr/local/bin/python -m semiwrap.cmd.make_pyi wpimath._wpimath wpimath/_wpimath.pyi semiwrap/modules/_wpimath.pyi -- wpimath /tmp/build-via-sdist-2hfn0_cv/robotpy_wpimath-2027.0.0a6.post1/wpimath/__init__.py wpimath._init__wpimath semiwrap/_init__wpimath.py wpimath._wpimath semiwrap/modules/_wpimath.cpython-311-x86_64-linux-gnu.so
pybind11_stubgen - [  ERROR] In wpimath._wpimath.AntiTipping.__init__ : Invalid expression 'wpi::units::unit_t<wpi::units::unit<std::ratio<1l'
pybind11_stubgen - [  ERROR] In wpimath._wpimath.AntiTipping.getP : Invalid expression 'wpi::units::unit_t<wpi::units::unit<std::ratio<1l, 1l>, wpi::units::base_unit<std::ratio<1l, 1l>, std::ratio<0l, 1l>, std::ratio<-1l, 1l>, std::ratio<-1l, 1l>, std::ratio<0l, 1l>, std::ratio<0l, 1l>, std::ratio<0l, 1l>, std::ratio<0l, 1l>, std::ratio<0l, 1l> >, std::ratio<0l, 1l>, std::ratio<0l, 1l> >, double, wpi::units::linear_scale>'
pybind11_stubgen - [  ERROR] In wpimath._wpimath.AntiTipping.setP : Invalid expression 'wpi::units::unit_t<wpi::units::unit<std::ratio<1l'
Warning: stubgen - [WARNING] Raw C++ types/values were found in signatures extracted from docstrings.
Please check the corresponding sections of pybind11 documentation to avoid common mistakes in binding code:
 - https://pybind11.readthedocs.io/en/latest/advanced/misc.html#avoiding-cpp-types-in-docstrings
 - https://pybind11.readthedocs.io/en/latest/advanced/functions.html#default-arguments-revisited
pybind11_stubgen - [   INFO] Terminating due to previous errors
ninja: build stopped: subcommand failed.
```
2026-06-28 16:42:57 -07:00
Austin Schuh
1b014e9e95 [bazel] Fix sandbox leaks and add support for remote execution (#9031)
These were caught by building on engflow. This fixes a
couple of places where paths were escaping the sandbox and resolving
back to the git repo.

---------

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
2026-06-27 15:19:44 -07:00
Tyler Veness
86cfc17a63 [ci] Rerun black on wpimath Python tests (#9032)
wpiformat uses ruff, which is ostensibly but not actually
black-compatible.
2026-06-27 15:16:42 -07:00
Thad House
5b4a578dc0 [hal] Reject duplicate apps connecting as main robot process to mrccomm (#9015) 2026-06-27 12:15:13 -07:00
PJ Reiniger
fd25e8666f [robotpy] Run black on robotpy files (#9017)
This piggy-backs off #8362. `wpiformat` will handle all the non-python
files (C++ trailing spaces in yaml files, etc), and the robotpy files
(guarded by being under src/main/python or src/test/python) will be
handled by black only.
2026-06-27 12:13:13 -07:00
Tyler Veness
a5d66fb4ff [build] Add CMake option to use system Sleipnir install (#9028)
This allows using an alternate version from FetchContent.
2026-06-27 12:11:54 -07:00
Tyler Veness
32bf24aa19 [upstream_utils] Upgrade to Sleipnir 0.6.3 (#9030)
Also drop patches since we're now on C++23.
2026-06-27 12:10:39 -07:00
PJ Reiniger
f8de482385 [bazel] Update toolchains to 2027-1 (#9016)
This updates to the 2027-1 toolchains. This also is the first version
with the `rules_bzlmodrio_toolchains -> wpilib_toolchains` rename, so
the surface area of the change is a little bit big.

The opencv dep has bzlmod'ified as part of this as well.
2026-06-26 22:44:00 -07:00
Benjamin Hall
004532dac0 [hal] Add Python wpistruct support for ControlWord (#9029)
Both C++ and Java already have Struct support for `ControlWord`.
2026-06-26 22:39:13 -07:00
Tyler Veness
a99c090332 [upstream_utils] Upgrade to fmt 12.2.0 (#9018) 2026-06-25 16:27:48 -07:00
Tyler Veness
27ce84d367 [hal] Include-what-you-use in CTREPCM.cpp (#9026)
This fixes another compiler error in #9018.
2026-06-23 19:36:47 -07:00
Tyler Veness
ebd5dcd25d [hal] Include-what-you-use in REVPH.cpp (#9023)
This fixes another compiler error in #9018.
2026-06-23 18:10:00 -06:00
Tyler Veness
22f8503aac Run wpiformat (#9024) 2026-06-23 11:57:45 -06:00
Gold856
de961b2b7e [wpilibj] Fix incorrect robot name in reported error (#8294) 2026-06-23 11:45:24 -06:00
Drew Williams
38f113ae4b [wpimath] Add BiquadFilter class for Second Order Section filters (#8814)
This adds a C++, Java and Python version of a Biquad filter class to
wpimath.

For testing, I took output from scipi functions and commented the inputs
I used above each test case.

---------

Co-authored-by: Drew Williams <drew.williams@capstanmedical.com>
2026-06-23 11:43:56 -06:00
Peter Johnson
ada1191265 [romi,xrp] Translate unit tests to catch2 (#9012) 2026-06-23 09:35:48 -06:00
Peter Johnson
a5c92df1f6 [build] Enhance javacpp/setupBuild.gradle with catch2 support (#9022) 2026-06-23 09:35:16 -06:00
Thad House
cd17feaa40 [build] Switch to classpath based developerRobot deploy (#9000)
Matches the gradlerio change.
2026-06-23 07:23:20 -07:00
Thad House
cc1c11c903 [build] Remove all references to Athena (#9019) 2026-06-23 06:20:34 -07:00
Thad House
e3cbc5eb30 [build] Fix gstrings accidentally being inserted into intellisense path (#9014)
JSON conversion does not handle this correctly, and errors when
generating intellisense configs
2026-06-23 06:18:54 -07:00
Tyler Veness
dce911116a [hal] Include-what-you-use in CTREPDP.cpp (#9021)
This fixes a compiler error in #9018.
2026-06-23 06:17:22 -07:00
Thad House
9ea17c1d53 [glass] Fix ANSI handling at end column (#9011)
Ported from mrccomm
2026-06-22 15:55:48 -07:00
Peter Johnson
aef281f43d [wpilib] Fix DifferentialDrivetrainSimTest (#8934)
- Fix a dependency on other test global state via Vin by calling
ResetData() to ensure consistent state
- Clamp the ground truth voltages to match sim.SetInputs()
- The C++ test was checking the noisy measurement output instead of
using sim.GetState()
- Make GetState() public in C++ and Java
2026-06-21 20:20:21 -07:00
Tyler Veness
be110d0469 [hal] Port last GoogleTest unit test to Catch2 (#9010)
This fixes a linker error I got for gtest.
2026-06-21 20:12:48 -07:00
Sam Carlberg
ffd371cbf8 [cmd3] Add example and template projects for commands v3 and make hatchbot example idiomatic (#8887)
The `command3` example project contains a program that could plausibly
play in the 2026 rebuilt game. It includes nested mechanisms (`Intake`
has an inner `IntakeWrist` and `IntakeRoller` and is similar to the v2
superstructure concept), swerve drive with localization and path
following (albeit stubbed for sake of example), opmodes and
opmode-scoped commands, and command-scoped triggers.

The template projects are basic skeletons. The larger template includes
a basic command that just increments and prints a counter variable every
time it runs.

The hatchbot v3 example has been refactored to be more idiomatic:
- `RobotContainer` removed
- "Subsystem" names in packages, comments, and classes has been replaced
with "Mechanism"
- Some v2-specific comments and structures have been reworded or deleted
- The Drive mechanism now provides commands for arcade drive and driving
a distance, instead of exposing public methods that write directly to
hardware (which broke encapsulation and made it possible to issue
conflicting hardware requests)
2026-06-21 20:10:53 -07:00
Thad House
8444a58640 [wpilib,cmd] Add expanded game controller list (#8959)
Extension of #8957
2026-06-21 19:37:32 -07:00
PJ Reiniger
4a2cd3e5d0 [robotpy] Run wpiformat on non-python robotpy files (#8362)
This turns the styleguide on for the non-python robotpy files.

The overwhelming amount of changes were
related to whitespace, followed by some IWYU for standard library
headers.
2026-06-21 19:36:03 -07:00
PJ Reiniger
6bc7051e23 [robotpy] Port more wpilibc tests to python (#8903)
I tasked Claude with converting the existing C++ tests to python for
wpilib. I gave it a decent review for comparison to the existing tests,
and it seems to have covered everything. I did do some small cleanup in
a couple of places. One notable test that is missing is the LED
patterns, but that is getting handled in
[mostrobotpy](https://github.com/robotpy/mostrobotpy/pull/254) land.
2026-06-21 19:33:50 -07:00
PJ Reiniger
45d4ed5bca [wpilibc] Change DriverStationSim to use a C++ enum for alliance station (#8991) 2026-06-21 19:29:19 -07:00
Peter Johnson
af91ba39f2 [glass,sim] Add sim GUI support for DS display (#8998) 2026-06-21 19:27:02 -07:00
Peter Johnson
c3fe63b2f7 [hal] Translate unit tests to catch2 (#9003) 2026-06-21 19:26:10 -07:00
Peter Johnson
912938b434 [tools] Translate unit tests to catch2 (#9006) 2026-06-21 19:24:30 -07:00
Peter Johnson
edbf2db5a7 [sim] Translate unit tests to catch2 (#9004) 2026-06-21 19:13:33 -07:00
Satchit Kulkarni
678176cd3c [wpimath] Add drivetrain anti-tipping utility (#8787)
Resolves #8587

This PR implements the requested anti-tipping utility and refactors the
math to correctly adhere to the NWU coordinate system.

**Key Changes:**
* Fixed the axis mapping: Positive pitch now correctly maps to a forward
tip (+X), and positive roll maps to a rightward tip (-Y).
* Inverted the proportional control logic: The correction vector now
applies a positive `kP` to drive *into* the direction of the fall to get
the wheels back under the center of gravity, rather than driving away
from it.
* Added a comprehensive JUnit test suite (`AntiTippingTest.java`) to
verify the calculated `ChassisSpeeds` correctly zero out the orthogonal
axis and provide the correct positive/negative velocity across all four
tipping directions.

Tested locally against `testDesktopJava` and passes all style/formatting
guidelines.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 19:11:48 -07:00
Tyler Veness
d4f89c11c3 [wpimath] Use triangular solves to compute UKF Kalman gain (#9009) 2026-06-21 15:09:34 -07:00
Peter Johnson
7298d9eafb [wpinet] Unit tests: use UNSCOPED_INFO in several places (#9007) 2026-06-21 13:52:38 -07:00
Peter Johnson
7dcb70cfcd [datalog] Translate unit tests to catch2 (#9002) 2026-06-21 13:51:49 -07:00
Peter Johnson
3d6df4a50e [apriltag] Translate unit tests to catch2 (#9001) 2026-06-21 13:50:11 -07:00
Peter Johnson
50eab65b07 [cscore] Translate unit tests to catch2 (#8999) 2026-06-21 13:49:07 -07:00
Thad House
f1c9d82d50 [hal,wpilib] Add DS Display API (#8975) 2026-06-20 10:28:24 -07:00
Tyler Veness
481a586009 [upstream_utils] Upgrade to Sleipnir 0.6.2 (#8996) 2026-06-19 20:16:03 -07:00