Commit Graph

4392 Commits

Author SHA1 Message Date
Austin Shalit
a2e46b9a1b [glass] modernize-use-nullptr (NFC) (#3006) 2020-12-29 22:46:11 -08:00
Peter Johnson
a751fa22d2 [build] Apply spotless for java formatting (#1768)
Update checkstyle config to be compatible with spotless.

Co-authored-by: Austin Shalit <austinshalit@gmail.com>
2020-12-29 22:45:16 -08:00
Tyler Veness
e563a0b7db [wpimath] Make LinearSystemLoop move-constructible and move-assignable (#2967) 2020-12-29 20:50:26 -08:00
Austin Shalit
49085ca943 [glass] Add context menus to remove and add NetworkTables values (#2979) 2020-12-29 20:49:29 -08:00
Peter Johnson
560a850a2b [glass] Add NetworkTables Log window (#2997)
This moves NetworkTable log messages out of the console (which is hidden on some platforms).
2020-12-29 20:47:58 -08:00
PJ Reiniger
66782e2317 [sim] Create Left/Right drivetrain current accessors (#3001) 2020-12-29 20:46:51 -08:00
Peter Johnson
b60eb1544b clang-tidy: bugprone-virtual-near-miss
A few virtual functions are called by constructors or destructors, which is
dangerous in C++ (as an overridden virtual impl won't be called, only the
one in the current class).  Fix by either marking the function final or
not calling at all (if possible).
2020-12-29 14:26:19 -08:00
Peter Johnson
cbe59fa3bf clang-tidy: google-explicit-constructor 2020-12-29 14:26:19 -08:00
Peter Johnson
c97c6dc065 clang-tidy: google-readability-casting (NFC) 2020-12-29 14:26:19 -08:00
Peter Johnson
32fa97d68d clang-tidy: modernize-use-nullptr (NFC) 2020-12-29 14:26:19 -08:00
Peter Johnson
aee4603269 clang-tidy: modernize-pass-by-value 2020-12-29 14:26:19 -08:00
Peter Johnson
29c7da5f1a clang-tidy: modernize-make-unique 2020-12-29 14:26:19 -08:00
Peter Johnson
6131f4e32b clang-tidy: modernize-concat-nested-namespaces (NFC) 2020-12-29 14:26:19 -08:00
Peter Johnson
67e03e625d clang-tidy: modernize-use-equals-default 2020-12-29 14:26:19 -08:00
Peter Johnson
b124f9101b clang-tidy: modernize-use-default-member-init 2020-12-29 14:26:19 -08:00
Peter Johnson
d11a3a6380 clang-tidy: modernize-use-override (NFC)
Add NOLINT to CommandTestBase due to gmock not adding "override" keyword,
which causes warnings on clang.
2020-12-29 14:26:19 -08:00
Peter Johnson
4cc0706b06 clang-tidy: modernize-use-using (NFC)
Excludes C-compatible headers
2020-12-29 14:26:19 -08:00
Tyler Veness
885f5a9781 [wpilibc] Speed up ScopedTracerTest (#2999)
ScopedTracerTest now uses simulation time instead of wall clock time, so
it doesn't have to actually wait 1.5 seconds.
2020-12-29 10:30:23 -08:00
sciencewhiz
60b5964577 [wpilibj] Fix typos (NFC) (#3000) 2020-12-29 10:29:39 -08:00
Austin Shalit
6e1919414e [build] Bring naming checkstyle rules up to date with Google Style guide (#1781)
Also update Checkstyle to 8.38.

Google changed their style guide from the last time we imported it. This PR brings in those naming changes. The change they made is allowing single letter member, parameter, and local variable names. They also added a lambda naming scheme and I thought it would be good to bring that in too.
2020-12-29 09:27:48 -08:00
Tyler Veness
8c8ec5e63e [wpilibj] Suppress unchecked cast warnings (#2995) 2020-12-28 17:13:34 -08:00
Peter Johnson
b8413ddd5b [wpiutil] Add noexcept to timestamp static functions (#2994)
This silences a clang-tidy warning.
2020-12-28 17:12:51 -08:00
Austin Shalit
5d976b6e18 [glass] Load NetworkTableView settings on first draw (#2993)
Before this change, user settings were not loaded until after the first time they opened the settings context menu.
2020-12-28 15:29:25 -08:00
Tyler Veness
2b4317452b Replace NOLINT(runtime/explicit) comments with NOLINT (NFC) (#2992)
cpplint.py can accept either, but clang-tidy requires NOLINT.
2020-12-28 15:10:31 -08:00
Peter Johnson
1c3011ba4b [glass] Fix handling of "/" NetworkTables key (#2991) 2020-12-28 14:36:30 -08:00
Peter Johnson
574a42f3b4 [hal] Fix UnsafeManipulateDIO status check (#2987) 2020-12-28 13:04:21 -08:00
Matt
9005cd59e5 [wpilib] Clamp input voltage in sim classes (#2955) 2020-12-28 13:03:31 -08:00
Peter Johnson
dd494d4ab7 [glass] NetworkTablesModel::Update(): Avoid use-after-move (#2988) 2020-12-28 13:02:24 -08:00
Peter Johnson
7cca469a12 [wpimath] NormalizeAngle: Make inline, remove unnamed namespace (#2986) 2020-12-28 13:00:26 -08:00
Peter Johnson
2aed432b4b Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java.
Also update clang-format settings to always add a line break (even if no braces are used).
2020-12-28 12:58:06 -08:00
Peter Johnson
0291a3ff56 [wpiutil] StringRef: Add noexcept to several constructors (#2984) 2020-12-28 11:34:50 -08:00
Peter Johnson
5d7315280a [wpimath] Update UnitsTest.cpp copyright (#2985) 2020-12-28 10:40:20 -08:00
Matt
254931b9a8 [wpimath] Remove LinearSystem from LinearSystemLoop (#2968)
The system wasn't being used internally, and as LinearSystem is stateless, it doesn't need to be held by LinearSystemLoop.
2020-12-28 10:35:51 -08:00
Prateek Machiraju
aa89744c95 Update OtherVersions.md to include wpimath info (#2983)
This also updates occurrences of 2020 to 2021.
2020-12-28 10:34:19 -08:00
Peter Johnson
1cda3f5ad7 [glass] Fix styleguide (#2976) 2020-12-26 14:31:24 -08:00
Peter Johnson
8f1f64ffb6 Remove year from file copyright message (NFC) (#2972)
Also update copyright to include "and other WPILib contributors" and clarify
license referral language to not be restricted to FIRST teams.
2020-12-26 14:12:05 -08:00
Peter Johnson
2bc0a7795c [examples] Fix wpiformat warning about utility include (#2971) 2020-12-26 09:34:21 -08:00
Peter Johnson
4204da6ad4 [glass] Add application icon 2020-12-25 22:08:37 -08:00
Peter Johnson
7ac39b10f7 [wpigui] Add icon support 2020-12-25 22:08:37 -08:00
Matt
6b567e0066 [wpimath] Add support for varying vision standard deviations in pose estimators (#2956)
Exposes the R passed to vision correct to users.
2020-12-24 16:05:07 -08:00
Tyler Veness
df299d6edd [wpimath] Add UnscentedKalmanFilter::Correct() overload (#2966)
This adds an overload of UnscentedKalmanFilter::Correct() that takes a
custom measurement covariance but uses default mean and residual
calculation functions.

Closes #2965.
2020-12-24 16:00:36 -08:00
Prateek Machiraju
4e34f05238 [examples] Use ADXRS450_GyroSim class in simulation example (#2964)
This class did not exist when the original example was written. This
also changes the C++ example to use ADXRS450_Gyro for the sake of
consistency.
2020-12-24 15:42:46 -08:00
Tyler Veness
9962f6fd79 [wpilib] Give Field2d a default Sendable name (#2953) 2020-12-24 12:26:03 -08:00
Peter Johnson
f9d492f4b1 [sim] GUI: Show "Other Devices" window by default (#2961) 2020-12-24 12:24:36 -08:00
Peter Johnson
a8bb2ef1c3 [sim] Fix ADXRS450_GyroSim and DutyCycleEncoderSim (#2963)
These were broken by #2952.

Also fix Java ADXRS450_Gyro angle/rate SimValue names.
2020-12-24 12:23:38 -08:00
Peter Johnson
240c629cda [sim] Try to guess "Map Gamepad" setting (#2960)
Looks to see if the joystick name starts with "Xbox" or contains "pad".
2020-12-23 20:38:28 -08:00
Tyler Veness
952567dd3c [wpilibc] Add missing move constructors and assignment operators (#2959)
- Field2d
- FieldObject2d
- AnalogGyro
2020-12-23 20:36:51 -08:00
Peter Johnson
10b396b4c2 [sim] Various WebSockets fixes and enhancements (#2952)
This is a breaking change to the WebSockets layer to align it with
recent specification documentation work.

To support this, HAL SimValue changed readonly to a direction enum.
This allows specifying bidirectional in addition to input and output.

The SimValue change is specifically designed to avoid API and ABI breakage.
This is completely transparent in C++; in Java a new callback class was added,
and the old readonly functions have been marked deprecated.

A new SimValue creation function for enums allows specifying double values
for each enum value, not just strings.  This allows mapping enum values to
doubles in the WebSockets layer.

A ":" in the SimDevice name now maps it to different WebSocket types (e.g.
"Accel:Name" becomes type "Accel", device "Name").  The type is hidden
in the GUI.

Other WebSockets changes:
* Implemented match_time and game_data
* Added joystick rumble data
* Added builtin accelerometer support
* SimValue enums are mapped to string and double value on WS interface
* Added WebSockets protocol specification
* Added READMEs
2020-12-23 15:54:11 -08:00
sciencewhiz
699bbe21a4 [examples] Fix comments in Gearsbot to match implementation (NFC) (#2957) 2020-12-22 22:26:54 -08:00
Prateek Machiraju
27b67deca6 [glass] Add more widgets (#2947)
This adds the following widgets:
- Speed Controller
- Gyroscope
- Command
- Subsystem
- PIDController
- Scheduler
2020-12-22 21:07:44 -08:00