Commit Graph

754 Commits

Author SHA1 Message Date
Peter Johnson
adbe95e610 [wpilib] Remove Shuffleboard API (#7730) 2025-01-24 23:47:42 -08:00
Thad House
5898cdd5c3 [hal, wpilib] Remove interrupt (#7724) 2025-01-23 21:45:18 -08:00
Thad House
e2b6beb28a [hal, wpilib] Remove DigitalGlitchFilter (#7725) 2025-01-23 21:44:18 -08:00
Thad House
5a6c895b87 [hal, wpilib] Remove built in accelerometer (#7702) 2025-01-17 14:06:09 -08:00
Thad House
1600e773f4 [hal, wpilib] Remove DMA (#7701) 2025-01-17 14:05:34 -08:00
Thad House
f80874dd4b [hal, wpilib] Remove analog accumulator and analog gyro (#7697)
The 2 high level classes were temporarily kept to keep the examples compiling. We will remove those when we have the interface into the built in IMU.
2025-01-17 12:58:31 -08:00
Thad House
92f0a3c961 [hal, wpilib] Remove SPI support (#7678) 2025-01-17 00:22:29 -08:00
Thad House
ff1b2a205e [hal, wpilib] Remove analog output (#7696) 2025-01-16 23:20:44 -08:00
Thad House
5017393b3a [hal, wpilib] Remove relay (#7695) 2025-01-16 23:20:07 -08:00
Peter Johnson
d9f8fded09 Merge branch 'main' into 2027 2025-01-16 23:17:59 -08:00
Thad House
1cad4f64a4 [hal] Add high level way of getting systemserver NT instance (#7683) 2025-01-16 10:49:40 -07:00
Thad House
58cb395d76 [hal] Add systemcore duty cycle (#7682) 2025-01-15 12:57:31 -07:00
Thad House
fa71fb55a2 [wpilib] Remove I2C Warnings (#7677)
SystemCore won't have the I2C issues.
2025-01-14 12:31:47 -07:00
Tyler Veness
786d22049b [wpilibc] Rename DCMotorSim getters (#7614) 2024-12-31 16:48:45 -08:00
Dustin Spicuzza
86137c49f5 [wpilibc] DCMotorSim: Add setAngle/setAngularVelocity (parity with Java) (#7613) 2024-12-31 14:30:16 -08:00
Tyler Veness
4edf52d3b6 [wpilibc] Clean up Joystick::GetDirection() (#7612) 2024-12-31 13:31:05 -08:00
sciencewhiz
9807d60566 [hal,wpilib] Change Power Distribution usage reporting to Instances (#7465)
LabVIEW doesn't appear to report PDP. This should reduce the number of
Unknowns in the parsed UsageReporting.
2024-11-30 20:32:21 -08:00
Nicholas Armstrong
b91864a5ec [wpilib] Fix acceleration getter for DCMotorSim (#7449) 2024-11-29 22:15:00 -08:00
sciencewhiz
0941251375 [wpilib] Add usage reporting for loggers (#7450) 2024-11-29 22:13:31 -08:00
Sam Carlberg
5e1c6a84ce [wpilibj, wpilibc] Fix LED patterns not offsetting reads (#6948)
Was causing bugs when combined with patterns that need to read back from the buffer (eg masks and overlays)

Co-authored-by: Joseph Eng <s-engjo@bsd405.org>
2024-11-28 21:25:54 -08:00
Tyler Veness
a04c40f589 Replace std::make_pair with std::pair CTAD (#7405) 2024-11-17 20:29:23 -08:00
Jonah Bonner
ca51197486 [wpilib] Add timestamp getters with configurable time base (#7378) 2024-11-16 07:43:38 -08:00
Tyler Veness
a66fa339dc [wpimath] Make controllers and some trajectory classes constexpr (#7343) 2024-11-07 14:02:11 -07:00
Ryan Blue
5a16b0e108 [wpilib] Refactor Alert (#7279)
This refactors Alert in both c++ and java to fix the issues with the current c++ implementation and improve performance.

Currently, constructing an Alert adds it to a list of Alerts with the same group and type. Activating an alert sets a flag on the alert. When the SendableAlerts is polled (GetStrings), the entire list is iterated over, filtered, and the filtered list is sorted by timestamp. This leads to a worst case O(m + nlog(n)) time complexity for GetStrings, where m and n are the count of total constructed alerts active alerts respectively. It also allocates intermediate data structures to hold the active alert strings for sorting.

This changes the implementation to improve the performance of GetStrings, by shifting the sorting overhead to Alert.Set
Constructing the Alert only initializes the alert's initial state, and initializes the SendableAlerts for the group if it is not already initialized.
Activating or deactivating an alert sets an internal flag for state tracking, and inserts or removes a structure containing the timestamp and text into a self-sorting data structure (std::set, TreeSet) containing other active alerts with the same group and type. (worst case O(log(n))
Now, SendableAlerts.GetStrings only has to iterate over the structure and copy the strings to the returned array. (amortized O(n))

This also fixes the c++ implementation by removing the need for SendableAlerts to directly access the Alert.

This also adds a helper method to SendableRegistry to force initialization of the instance to prevent static initialization ordering issues.
2024-11-06 16:09:06 -07:00
Jade
043c155087 Fix a few clangd warnings (#7335) 2024-11-05 09:47:54 -07:00
Peter Johnson
caae5357b7 [wpilibc] Mechanism2d: Store roots by value 2024-10-31 22:04:13 -07:00
Peter Johnson
22e91bfacd [wpilibc] ShuffleboardInstance: Store ShuffleboardTab by value 2024-10-31 22:04:13 -07:00
Peter Johnson
f620141e0d [wpiutil] Replace LLVM StringMap impl with std::map
As string_view operations on std::map<std::string> won't be integrated
until C++26, placeholder implementations are used which are less efficient
in a couple of situations (e.g. insert with hint).
2024-10-31 22:04:13 -07:00
Gold856
40af8db28a [wpilibc] DataLogManager: Rename console log entry to "console" (#7240)
This matches Java.
2024-10-21 06:34:29 -06:00
Étienne Beaulac
796dbd3b86 [wpilib] Add Timer.isRunning() method (#7220) 2024-10-17 17:03:40 -07:00
Ryan Blue
2b1c5aa4fc [wpilibc] Check for invalid handle in destructors (#7212)
Moved-from objects have invalid handles.
2024-10-15 19:56:13 -07:00
Nicholas Armstrong
5d9a553104 [wpilib] DCMotorSim cleanup/enhancement (#7021)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2024-10-10 22:09:22 -07:00
Sam Carlberg
2085ab3d47 [wpilib] Allow LED pattern gradients to be discontinuous (#7174) 2024-10-10 22:05:33 -07:00
Jade
466a4a52fa [wpilibc] Fix missing symbols on Windows (#7140)
Windows doesn't support direct static variable access across library boundaries in a mixed static/shared environment, so change to accessor functions.
2024-10-01 08:46:06 -06:00
Gold856
ba1b97cd78 [wpilib] ADIS IMUs: Add back null checks (#7117)
* Revert "Move creation of objects to ctor"

This reverts commit b1d8001652.

* [wpilib] ADIS IMUs: Add back null checks
2024-09-22 18:05:09 -07:00
Tyler Veness
554024767e Fix errors from new cpplint.py (#7105) 2024-09-20 17:43:39 -07:00
Gold856
3bbbf86632 [wpiutil, wpilib] Add FileLogger and log console output (#6977) 2024-09-12 22:13:06 -07:00
Jade
cd9922af49 [wpilib] Add getVoltage to PWMMotorController (#6044) 2024-09-07 22:24:51 -07:00
Ryan Blue
496e7c1bba [hal] Refactor C++ handle closing; check for invalid handle before closing (#7016)
Adds a close function pointer template parameter to hal::Handle.  This allows default destructors in many places.
The status parameter has been removed from close functions; in most places it was not used. Where it was, an error is printed instead.
2024-09-07 10:58:15 -07:00
Ryan Blue
dc18f71004 [wpilibc] Refactor AnalogTrigger to use shared_ptr (#7010) 2024-08-28 21:34:28 -07:00
Jonah
173ffca14a [wpilib] Add persistent alerts API (#6735) 2024-08-23 07:05:53 -07:00
Gold856
b12b83aa89 Fix typos with cspell (#6972) 2024-08-17 07:44:34 -07:00
Gold856
0c58426f4c [sim] Add SendableChooserSim (#6763)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
2024-08-15 15:00:10 -07:00
Tyler Veness
8e0d9ac805 Clean up unit UDL usage (#6961) 2024-08-14 10:44:00 -07:00
Gold856
05e955f87e [wpilib] Deprecate Resource (#6952) 2024-08-12 15:26:11 -07:00
Ryan Blue
dd99ff420c [wpilib, hal] DigitalGlitchFilter: Fix sim crash and clean up construction (#6937)
Fixes error when >3 are constructed- in java, m_filterAllocated[index] would be evaluated before the bounds check and throw IndexOutOfBounds, in c++ a vague assertion error would be thrown.

Makes DoAdd static in c++

Makes the error message when HAL_SetFilterSelect fails consistent with java
2024-08-10 23:30:02 -07:00
Ryan Blue
19b478a33b [hal] Expose more FPGA functionality (#6942)
- function to reset user rail fault counters
- function to get comms disable count
- correct docs for user rail count functions
2024-08-10 23:25:02 -07:00
Ryan Blue
01c47e5bcc [wpilibc] Fix default properties for DS NT publisher (#6909) 2024-08-02 19:07:31 -07:00
Ryan Blue
0e9c514ebf [hal, wpilib] Fix REV PH disabled solenoid list (#6887) 2024-07-29 07:59:49 -07:00
Jade
5dcaa6d671 [wpilibc] Add FRC_ReportWarning (#6681) 2024-07-27 20:20:08 -07:00