Peter Johnson
8d961dfd25
[wpilibc] Remove ErrorBase ( #3306 )
...
Replace with new exception-based error reporting, consistent with Java.
This also builds stacktraces into the reporting/exceptions.
2021-04-18 20:35:29 -07:00
Peter Johnson
a79faace1b
[wpilibc] Return reference from GetInstance ( #3247 )
...
Improves consistency across all classes.
Affects Preferences, LiveWindow, and CameraServer.
Old commands Scheduler::GetInstance() was not updated as this is already
deprecated.
2021-03-21 11:13:49 -07:00
Peter Johnson
8afa596fdf
[wpilib] Remove deprecated Sendable functions and SendableBase ( #3210 )
2021-03-19 13:41:11 -07:00
Prateek Machiraju
d6f6ceaba5
[build] Run Spotless formatter (NFC) ( #3221 )
...
The original PR (#2934 ) was created before we moved to Spotless so the
formatting check was never run.
2021-03-04 08:24:05 -08:00
Blake Bourque
0922f8af59
[commands] CommandScheduler.requiring(): Note return can be null (NFC) ( #2934 )
2021-03-03 23:56:57 -08:00
Matt Soucy
1a2680b9e5
[wpilibj] Change CommandBase.withName() to return CommandBase ( #3209 )
...
Doing this retains the Sendable portion of the type.
2021-03-03 23:35:37 -08:00
Starlight220
435bbb6a8c
[command] RamseteCommand: Output 0 if interrupted ( #3216 )
2021-02-28 22:06:34 -08:00
Thad House
99b5ad9ebb
[wpilibj] Fix warnings that are not unused variables or deprecation ( #3161 )
...
Fix all warnings given by intellisense that are not unused variables or deprecation.
2021-02-12 22:22:11 -08:00
Prateek Machiraju
749c7adb13
[command] Fix use-after-free in CommandScheduler ( #3024 )
2020-12-31 20:35:17 -08:00
Peter Johnson
b7e46c558f
Include .h from .inc/.inl files (NFC) ( #3017 )
...
This helps both IDEs and linting tools.
Also add some missing braces.
2020-12-31 11:26:53 -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
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
aee4603269
clang-tidy: modernize-pass-by-value
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
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
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
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
Prateek Machiraju
f7f9087fb5
[command] Fix timing issue in RamseteCommand ( #2871 )
...
This issue only existed on the initial iteration. When timing is paused and stepped,
initialize() and execute() get called with the same timestamp the first time, which
would result in a divide by zero. All subsequent steps advance timing and only
call execute() so the time deltas are all set correctly.
2020-11-21 10:03:01 -08:00
Austin Shalit
6e7c7374fd
[build] Globally Exclude PMD.TooManyMethods ( #2793 )
...
This was not a useful check, as every time we hit it, we simply excluded it.
2020-10-22 20:53:48 -07:00
sciencewhiz
7fc48b75dd
[command] Add PIDSubsystem PIDController as child ( #2784 )
...
Previously, the PIDSubsystem's PID Controller would show as ungrouped in
LiveWindow.
Fixes wpilibsuite/RobotBuilder#260
2020-10-19 20:04:18 -07:00
Tyler Veness
8e538aa82f
[wpilibc] Make IsSimulation() checks constexpr ( #2769 )
2020-10-03 22:26:19 -07:00
sciencewhiz
f758af826d
[wpilib] Use misspell to find more spelling errors (NFC) ( #2679 )
2020-09-02 19:41:05 -07:00
sciencewhiz
3e41d92c18
[wpilib] Use misspell to fix spelling errors (NFC) ( #2674 )
2020-08-31 00:33:11 -07:00
Prateek Machiraju
aba035eb3d
[command] Modify swerve and mecanum commands to use new controller
2020-08-02 00:03:21 -07:00
Matt
a175f6e862
[command] Add simulationPeriodic method to Subsystem ( #2577 )
...
This method is run periodically during simulation, after periodic().
2020-07-06 23:32:18 -07:00
Tyler Veness
2a0f79b90f
[wpilib] Add X and Y component getters to Pose2d and Transform2d ( #2563 )
...
pose.Translation().X() and pose.Translation.Y() are common operations,
so shortening them to pose.X() and pose.Y() would be convenient.
Java uses the getX() convention so that is used instead of X() for Java.
2020-07-02 18:09:36 -07:00
Tyler Veness
d30d1088da
[wpiutil] Split units.h into separate headers for each unit ( #2551 )
...
Closes #2508 .
Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com >
2020-06-29 22:25:09 -07:00
Tyler Veness
22c0e2813a
[build] Upgrade CI to clang-format 10.0 ( #1961 )
...
MacOS no longer ships 6.0, and Arch Linux's mesa GPU drivers are no longer compatible with LLVM 6.0.
2020-06-27 20:39:00 -07:00
sciencewhiz
27566abb06
[command] PIDSubsystem: Add GetSetpoint ( #2534 )
...
Co-authored-by: Tyler Veness <calcmogul@gmail.com >
2020-06-20 16:30:21 -07:00
Starlight220
92380485c8
[command] Make cancel safe to call from initialize ( #2440 )
...
Fixes #2388 .
2020-05-20 21:00:34 -07:00
Austin Shalit
e504b3ecbd
[command] Add NetworkButton ( #2373 )
...
Closes #2371
2020-04-05 23:07:17 -07:00
Starlight220
f4c5c0f5b5
[command] Add withName inline decorator to Java ( #2420 )
...
This is an inline decorator for setting the name of a command
(equivalent to calling setName()).
It's not possible to implement this for C++, as it would slice the derived
class to return it by value.
2020-04-05 16:11:23 -07:00
Prateek Machiraju
b7a79c70cc
C++: Add Watchdog to CommandScheduler ( #2437 )
...
C++ counterpart to #2319
2020-03-28 09:29:51 -07:00
Daniel Z
6e6f28d1ac
Add watchdog and epoch reporting to CommandScheduler ( #2319 )
2020-03-28 09:29:15 -07:00
Starlight220
d14978e549
New commands: add docs to end() ( #2450 )
...
Added documentation to prevent looping end() by scheduling commands.
2020-03-28 09:18:06 -07:00
sciencewhiz
1b85066d26
Fix C++ ParallelRaceGroup multiple calls behavior ( #2339 )
...
The Java version was correct, but the C++ version would only run once.
2020-02-08 10:26:06 -08:00
Oblarg
f0a18f31e7
Timer: add hasElapsed, advanceIfElapsed ( #2322 )
...
The current hasPeriodPassed() function is confusing. In preparation for deprecating it,
add new advanceIfElapsed() function with same functionality and hasElapsed() function
which only checks that the time period has elapsed and does not advance the timer.
Also fix a couple of incorrect usages of hasPeriodPassed().
2020-02-08 10:23:29 -08:00
Peter Johnson
b9b31069cc
Fix C++ POVButton ( #2294 )
...
Also add unit test.
2020-01-20 21:35:19 -08:00
Chris Russell
a61fcbd68d
Make Button class concrete ( #2244 )
2020-01-15 18:59:51 -08:00
Thad House
cb66bcca3c
Add callback handlers for LiveWindow ( #2053 )
...
Fixes #2223
2020-01-12 22:37:24 -08:00
Oblarg
cba21a768f
Fix C++ JoystickButton and POVButton ( #2259 )
...
C++ JoystickButton and POVButton were both nonfunctional due to slicing when trigger passes itself by value to the button scheduler it creates.
Fix is to remove the virtual Get() method entirely and use only the m_isActive functor; since the subclass now passes the button condition back as a functor to the base class, in which it's stored as a member, it will now still work after being sliced.
2020-01-12 14:57:28 -08:00
Peter Johnson
ab9647ff5b
CommandScheduler: Don't store NetworkTableEntry
2020-01-10 23:42:18 -08:00
Peter Johnson
56765cf49a
C++ CommandBase: Don't add to LiveWindow ( #2255 )
2020-01-10 20:37:49 -08:00
Peter Johnson
bf7012fa2d
Fix new CommandScheduler.cancelAll() ( #2251 )
...
When called outside the run loop, it would result in a CME in Java.
2020-01-10 16:10:16 -08:00
Peter Johnson
32c62449be
Add ArrayRef overloads to new command classes ( #2216 )
...
Also default requirements to {} in all cases for consistency.
2020-01-01 20:09:17 -08:00
Tyler Veness
6190fcb237
Run wpiformat ( #2218 )
2020-01-01 20:04:56 -08:00
Matt
222669dc2c
Fix trapezoidal profile PID controller setpoint bug ( #2210 )
...
Co-Authored-By: Austin Shalit <austinshalit@gmail.com >
2020-01-01 15:23:25 -08:00
Peter Johnson
9abce8eb06
Fix subsystem LiveWindow usage ( #2202 )
2019-12-29 21:28:38 -06:00
Peter Johnson
7b952d599d
Add usage reporting for many new things ( #2184 )
...
- new CommandScheduler
- kinematics and odometry classes
- new PIDController
- ProfiledPIDController
- TrapezoidProfile (reported in Constraints class)
Also update instances.txt to match latest NI version.
One side effect is that a couple of classes are no longer constexpr.
2019-12-25 00:42:14 -06:00