Commit Graph

60 Commits

Author SHA1 Message Date
Gold856
f96ded6909 Fix various typos (#8769) 2026-04-13 21:51:36 -07:00
sciencewhiz
613c86d1d7 [cmd2] Flatten wpi::cmd::cmd to wpi::cmd (#8764)
Fixes #8763
2026-04-13 21:48:13 -07:00
Tyler Veness
7af3ac579b [build] Upgrade Gradle wrapper and plugins (#8767)
This fixes builds on JDK 26 for me.
2026-04-12 22:03:50 -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
Peter Johnson
bc984234e9 [cmd2] CommandScheduler::Cancel(): Don't mutate in for loop (#8743)
Erasing elements from a container while iterating over the container may
not be well-defined.
2026-04-10 12:30:00 -07:00
sciencewhiz
ceb712b089 [docs] Change NewCommands to Commands v2 (NFC) (#8702) 2026-03-29 20:40:36 -07:00
Peter Johnson
a57d658ef1 [wpilib] Rename GenericHID and Gamepad enums to all caps
GenericHID.getSupportedOutputs(): Return EnumSet
Gamepad: Add Button-taking accessors
2026-03-21 00:37:28 -07:00
Peter Johnson
09be21c319 [wpilib] Rename TimedRobot constants to all caps 2026-03-21 00:37:28 -07:00
Peter Johnson
6559d78658 [wpilib] Rename SysIdRoutineLog constants to all caps 2026-03-21 00:37:28 -07:00
Peter Johnson
227f01f3bd [hal,wpilib] Rename DriverStation constants to all caps 2026-03-15 22:38:09 -07:00
Gold856
d1fba06851 Remove deprecated code (#8656) 2026-03-14 21:28:31 -07:00
Thad House
b2b111dc11 Rename FRC to WPILib (#8637) 2026-03-13 23:05:55 -07:00
Peter Johnson
6830c65a15 [hal] Rename HALBase.h to HAL.h (#8668) 2026-03-13 17:19:39 -07:00
Tyler Veness
907bf05607 [ci] Upgrade to wpiformat 2026.56 (#8666) 2026-03-13 13:15:01 -07:00
PJ Reiniger
c0f8159540 [copybara] Resync with mostrobotpy (#8662) 2026-03-08 21:38:21 -07:00
PJ Reiniger
51a3876330 [robotpy] Build examples (#8629)
This hooks up the bazel build to the robotpyExamples. It can use the
(formly pyfrc or whatever) automatic unit tests for an example, as well
as exposing the ability to run the example in simulation, with or
without `halsim_gui` with a command such as `bazel run
//robotpyExamples:AddressableLED-sim`

This required building and using wheels instead of just a normal
`py_library`, so that things like `ENTRY_POINTS` can be used. I took a
bare bones approach to building and naming the wheels (for example the
native ones don't have the OS info or python version in them, so they
wouldn't be suitable publish to pypi, but that can always be updated
later.
2026-03-05 23:18:37 -08:00
Peter Johnson
a7f71c9434 [hal] Consistently use .hpp for C++ header content
Some headers were renamed, but others were split.
2026-03-04 22:09:40 -07:00
Thad House
880ffe94f2 [wpiutil] Remove CombinedRuntimeLoader (#8623)
It was only ever for Java tools, which we do not support anymore.
2026-02-27 20:15:17 -08:00
Gold856
46a911d50c [docs] Fix various @see tags in Javadoc (#8644)
Most of these were leftovers from the reorg, the Commands v2 change is
from the recent merge from main and fixes our builds again.
2026-02-27 20:04:07 -08:00
Peter Johnson
7513846c72 Merge branch 'main' into 2027 2026-02-27 14:24:41 -08: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
PJ Reiniger
8f9fc4d1b6 [copybara] Import robotpy examples (#8608)
GitOrigin-RevId: 9ba4bc3040fa7e772f5a594039e78fc6c43d114e
2026-02-20 15:30:35 -08:00
Peter Johnson
af865f8020 Merge branch 'main' into 2027 2026-02-15 00:51:21 -08:00
PJ Reiniger
227c89ab23 [copybara] Resync robotpy (#8585)
Project import generated by Copybara.
    
GitOrigin-RevId: fd000778e9b78c72cc7ca7b2ebe476129b78c6e0
2026-02-08 07:36:35 -08:00
Thad House
4aa21e947d [wpilib,cmd] Rename gamepad shoulder to bumper (#8573)
Both programs used bumper, so we shouldn't rename it. There's no reason
to change it, and we don't need to match SDL.
2026-02-07 10:39:22 -08:00
PJ Reiniger
2d97cb928f [bazel] Upgrade hermetic python version to 3.13 (#8554)
Robotpy dropped support for 3.10 recently, so this updates to the next
lowest version. This will be helpful when the examples get merged into
`mostrobotpy`

There's not really a specific reason why I just jumped to 3.11 instead
of a newer version. If anybody suggests otherwise I will gladly bump it
higher.
2026-02-06 21:40:10 -08:00
Thad House
5c5d5222f4 [wpilib] Prefix all NI DS specific controller classes (#8596)
Easier then the last one that put everything in a sub namespace. By
prefixing the name less things break, and intellisense will be less
confusing to new users during the transition.
2026-02-06 21:36:01 -08:00
PJ Reiniger
1cbc25bc36 [copybara] Resync commandsv2 (#8535)
This will be the last sync from the commandsv2
[repo](https://github.com/robotpy/robotpy-commands-v2), as it has now
been merged into
[mostrobotpy](https://github.com/robotpy/mostrobotpy/pull/226).

Doing this on its own to make the diffs smaller when doing a full
`mostrobotpy` sync, which will now have a lot of other new goodies
coming along for the ride.

---------

Co-authored-by: Default email <default@default.com>
2026-01-14 20:15:00 -08:00
PJ Reiniger
40fb9ff562 [copybara] mostrobotpy to allwpilib (#8503)
Resync with `mostrobotpy`

This mostly involves the big "ignore almost everything in the HAL
project" and some fixups for the Addressable LED classes.

Required two small hand fixes to get it building over here with bazel,
and with more compiler warnings on.

I also manually zeroed out the `repo_url` field in the toml files to
avoid unnecessary churn whenever it goes from a release build to a
development build. I already did this with `version` field in there, and
will do a follow up PR that updates the copybara script to do it
automatically.

---------

Co-authored-by: Default email <default@default.com>
2025-12-31 09:06:01 -08:00
PJ Reiniger
ea71bdfba6 [py][cmd2] Fix opmodes merge (#8473)
Looks like a build failure got lost in the landing order of python
commands and the big opmode change. This makes it compile again, based
on the java / C++ changes from the opmode PR.
2025-12-13 12:11:29 -08:00
Peter Johnson
dacded37e5 [hal, wpilib] Add OpMode support (#7744)
User code:
- OpModeRobot used as the robot base class
- LinearOpMode and PeriodicOpMode are provided opmode base classes
- In Java, annotations can be used to automatically register opmode classes

Additional user code functionality:
- OpMode (string) is available in addition to the overall
auto/teleop/test robot mode
- OpMode does not indicate enable (enable/disable is still separate)
- The HAL API uses integer UIDs; these are exposed at the user API level
as well for faster checks
- User code creates opmodes on startup (these have name, category,
description, etc).

DS:
- DS will present opmode selection lists for auto and teleop for
match/practice. During a match, the DS will automatically activate the
selected opmode in the corresponding match period.
- For testing, an overall mode is selected (e.g. teleop/auto/test) and a
single opmode is selected

Future work:
- Command framework support/integration
- Python annotation support
- Unit tests (needs race-free DS sim updates)
- Porting of examples

Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
2025-12-12 20:25:57 -08:00
PJ Reiniger
13abb3d332 [py][cmdv2] Add python commands-v2 to build system (#8380)
This hooks up the recently landed robotpy commands v2 to the build
system.

The swerve controller command was deleted to match #8119
2025-12-12 20:05:31 -08:00
sciencewhiz
ccfbf5f5b3 [commands] Add conflicts for Commands v2 & v3 vendordeps (#8438) 2025-11-30 11:12:12 -08:00
Keagan Kautzer
5db6d2f500 [cmd2] Revert wait back to waitSeconds (#8391)
Fixes #8272
2025-11-16 16:57:47 -08:00
PJ Reiniger
1a99a348cb [robotpy] Mirror robotpy's commands-v2 (#8369)
Project import generated by Copybara.

GitOrigin-RevId: 715c8e8372d936f447f2937aab6b1a22dc619126
2025-11-13 21:55:54 -08:00
Tyler Veness
6e6f8dd7cc [cmd2] Fix include style of generated controller classes (#8372) 2025-11-13 21:32:45 -08:00
Tyler Veness
7a04d6a6a2 Merge wpiformat configs (#8365)
After replacing the remaining include guards with `#pragma once`, I was
able to merge all the wpiformat configs into one file in the repo root.
This should make the config easier to reason about and maintain in the
future.
2025-11-11 22:00:42 -08: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
Ryan Blue
e5f8aa2cf4 [cmd2] Rename vendordep (#8357) 2025-11-10 18:18:14 -08:00
Austin Schuh
00ff8b941d [bazel] Publish almost all artifacts (#8141)
This uses all the infrastructure we put together earlier to actually build and publish all the artifacts.

We might still want to adjust what is built by default to control CI times.

Signed-off-by: Austin Schuh <austin.linux@gmail.com>
Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2025-11-10 10:10:49 -07:00
Peter Johnson
18efd1e534 Move robot base classes from opmode to framework (#8344)
Having these in opmode will be confusing to users when opmodes are added.
2025-11-08 15:08:38 -08:00
PJ Reiniger
2109161534 SCRIPT: wpiformat 2025-11-07 23:09:21 -08:00
PJ Reiniger
106bc774d4 HAND FIX: final java package changes 2025-11-07 23:09:21 -08:00
PJ Reiniger
928ff20695 SCRIPT: FRC_ replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
013a238994 HAND FIXES: Update maven info 2025-11-07 23:09:21 -08:00
PJ Reiniger
3f740894c9 HAND FIXES: Manual cleanup of namespaces 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
c89910b7c6 HAND FIXES: Fixup gradle / cmake / styleguide 2025-11-07 23:09:21 -08:00