Commit Graph

1150 Commits

Author SHA1 Message Date
Peter Johnson
b7122f0fda [hal] Rename HAL_kInvalidHandle to HAL_INVALID_HANDLE (#8698) 2026-03-21 00:34:46 -07:00
Gold856
dba033eaee [hal] Clean up references to removed HAL features (#8695)
#7695, #7696, #7697, #7701, #7724, #7753, #7861 removed various features
from the HAL, but forgot to clean up the handles, the WS API, or both.
Additionally, since AnalogInput is the only remaining analog I/O,
AnalogJNI was renamed to the more specific AnalogInputJNI.
2026-03-20 16:50:02 -07:00
Gold856
f1aa84aecf [hal,wpilib] Remove MXP mentions in API docs (NFC) (#8694) 2026-03-20 16:48:53 -07:00
Peter Johnson
4059797635 [hal,ntcore,cscore] Update Handle constants to all caps 2026-03-20 13:24:22 -06:00
Peter Johnson
0665aed66b [hal] Fix Python CAN API types prefix (#8687) 2026-03-16 21:47:58 -07:00
Gold856
e81d47fb46 [hal,wpilib] Remove unused error/warning codes (#8684) 2026-03-16 20:26:43 -07:00
Peter Johnson
aad08b9ad1 [hal] Rename SimDevice constants to all caps
Also use enum class for SimDevice C++ wrapper.
2026-03-15 22:38:09 -07:00
Peter Johnson
70f77a1f8e [hal,wpilib] Rename SerialPort constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
68ca74c129 [hal,wpilib] Rename REVPH compressor constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
c18f811ea7 [hal,wpilib] Rename PowerDistribution constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
261a0ebbd7 [hal,wpilib] Rename I2C constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
b68fbb1adc [hal,wpilib] Rename Encoder constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
f6fdae3212 [hal,wpilib] Rename RuntimeType constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
227f01f3bd [hal,wpilib] Rename DriverStation constants to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
614eb1db18 [hal,wpilib] Rename CAN device and manufacturer types to all caps 2026-03-15 22:38:09 -07:00
Peter Johnson
fc3be46e6c [hal] Rename kAddressableLEDLength to all caps 2026-03-15 22:38:09 -07:00
Tyler Veness
86dd3ca2b7 [hal] Simplify monotonic_clock (#8678)
The epoch() function, zero() function, and min_time member are all not
part of the std::chrono clock interface.

The default constructor of time_point is
[documented](https://en.cppreference.com/w/cpp/chrono/time_point/time_point.html)
to initialize to the clock's epoch.
2026-03-15 20:42:52 -07:00
Tyler Veness
14e2c1c4cf [ci] Fix all warnings from clang-tidy 22 (#8680)
I ran the following locally:
```bash
gradle generateCompileCommands
./.github/workflows/fix_compile_commands.py build/TargetedCompileCommands/linuxx86-64release/compile_commands.json
wpiformat -default-branch 2027 -no-format -tidy-all -compile-commands=build/TargetedCompileCommands/linuxx86-64release
```

The `HeaderFilterRegex` option is used to filter out warnings from
thirdparty headers.
2026-03-15 20:42:35 -07:00
Peter Johnson
e944ae9aca [hal,wpilib] Rename FPGA clock to monotonic clock (#8672)
- Remove status return from HAL level (clock getting should never fail)
- Remove 32-bit timestamp expand function
- Make monotonic_clock.hpp (formerly fpga_clock.hpp) header-only and
move to root hal include directory
2026-03-15 15:08:41 -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
Peter Johnson
ab4700854c [hal] Remove HAL.h single header include (#8667) 2026-03-13 15:53:24 -07:00
Peter Johnson
80647654c3 [hal] Add HAL_Status typedef (#8671) 2026-03-13 15:51:43 -07:00
PJ Reiniger
c0f8159540 [copybara] Resync with mostrobotpy (#8662) 2026-03-08 21:38:21 -07:00
Tyler Veness
9bd9656871 [wpimath] Replace Speeds with Velocities (#8479)
I left "free speed" alone since that's the technical term for it. In
general, velocity is a vector quantity, and speed is a magnitude (i.e.,
a strictly positive value).

This PR also replaces the speed verbiage in MotorController with duty
cycle.

Fixes #8423.
2026-03-06 14:19:15 -08: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
f08258f784 [wpiutil] Split C++ header files 2026-03-04 22:09:40 -07: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
Peter Johnson
733cfa4b07 [hal,wpilib] Move Alert to HAL (#8646)
SystemCore implementation is not yet connected to MRCComm.
2026-03-03 20:58:47 -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
Gold856
1806cd2d78 [hal] Remove useless usage reporting return (#8625)
The value is not used anywhere and it also just returns 0 (was a value
from Netcomm in pre-2027).
2026-02-20 15:28:57 -08:00
Ryan Blue
0c44e63465 [wpilib] Make joystick unplugged warning better in cases of out of range axis/button (#8614)
Closes #8594 
Fixes #7700 
Also fixes DS HAL to zero out joysticks not received from DS.
2026-02-17 20:22:02 -08:00
Peter Johnson
af865f8020 Merge branch 'main' into 2027 2026-02-15 00:51:21 -08:00
sciencewhiz
7ac0612397 [hal,wpilib] Update MatchTime docs for teleop and auto mode (NFC) (#8606)
Update Timer and JNI MatchTime functions to latest docs
2026-02-09 17:14:42 -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
85adbf990e [hal,wpilib] Switch to new game data (#8584)
Game data is now limited to 8 bytes, and comes through the UDP packets.
2026-02-06 21:38:15 -08:00
crueter
c89401250f [hal, wpilib] Usage Reporting: QFRCDashboard -> QDash (#8571) 2026-01-15 19:55:55 -07:00
Dave Oleksy
812a1b8e1a [hal] Add 2026 REV products for usage reporting (#8567)
Adding REV Easy Swerve and MAXSpline Encoder to usage reporting.

Co-authored-by: Dave Oleksy <dave.oleksy@revrobotics.com>
2026-01-14 20:14:20 -08:00
PJ Reiniger
762d1e8b93 [copybara] mostrobotpy to allwpilib (#8545)
Project import generated by Copybara.
GitOrigin-RevId: f10284b37498bb6a088891ca41f160793ec7fd90
2026-01-12 19:11:02 -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
bdc9391738 [py] Fix opmodes (#8498)
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2025-12-31 09:05:00 -08:00
Thad House
5a22abb85b [hal] Explicitly wait for mrccomm server to be ready (#8490)
Avoids a race if robot ready happens before mrccomm is fully booted
2025-12-16 22:24:13 -08:00
Thad House
8b10a0546d [hal] Fix typo in NumOccurrences (#8487)
Closes #8439
2025-12-16 22:20:48 -08:00
PJ Reiniger
e2c9af862e [py] Fix maven coordinates for native downloads (#8474)
This got missed in the reorg, and these values aren't actually used for
anything when building in `allwpilb`, but we might as well fix them here
to make the copybara process easier.
2025-12-13 21:44:31 -08:00
Thad House
bcb5c5c16c [hal] Fix controldataproto SupportsOpModes (#8476)
It wasn't updated, so DS was always assumed to be NI DS
2025-12-13 16:07:23 -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
Peter Johnson
cbe447aad7 [hal] Notifier: Reset signal object on ack (#8466)
This is needed to avoid spurious wakeups in WaitForObject due to a
previous alarm having set the signal object.
2025-12-11 22:31:49 -08:00
Peter Johnson
5aaf2d7138 [hal] Handle: free on operator= (#8462) 2025-12-11 22:31:30 -08:00
Peter Johnson
06a9a055b3 [hal] Notifier: simplify ack API (#8457)
Adding an ack parameter to both set and cancel is cleaner than adding
all the set alarm parameters to the ack function. It also provides an
ack-and-cancel method.
2025-12-09 19:28:15 -08:00
Levi
a61866912b [hal] Rename Lumen to Lumyn in usage reporting (#8455) 2025-12-05 19:13:39 -08:00