Commit Graph

21 Commits

Author SHA1 Message Date
Joseph Eng
633c5a8a22 [commands] Add C++ Requirements struct (#5504) 2023-09-17 20:48:39 -07:00
Tyler Veness
4bac4dd0f4 [wpimath] Move PIDController from frc2 to frc namespace (#5640)
The old PIDController class in the frc namespace was removed for the
2023 season.
2023-09-15 19:57:31 -07:00
Ryan Blue
aaea85ff16 [commands] Merge CommandBase into Command and SubsystemBase into Subsystem (#5392)
Moves all CommandBase functionality into Command and deprecates CommandBase for removal.
Moves all SubsystemBase functionality into Subsystem and deprecates SubsystemBase for removal.
Adds a function to CommandScheduler to remove all registered Subsystems.
2023-07-13 22:12:01 -07:00
Tyler Veness
1501607e48 [commands] Fix clang-tidy warnings (#5402) 2023-06-19 23:01:46 -07:00
Sriman Achanta
f75acd11ce [commands] Use Timer.restart() (#5023) 2023-01-29 07:21:07 -08:00
Starlight220
fbabd0ef15 [commands] Enhance Command Sendable implementations (#4822) 2022-12-15 18:28:52 -08:00
Tyler Veness
fbdc810887 Upgrade to C++20 (#4239)
* Use explicit this capture required by C++20
* Use C++20 span
* Replace wpi::numbers with std::numbers
* Fix C++20 clang-tidy warning false positive in fmt
* Remove ciso646 include since C++20 removed that header
* Fix global-buffer-overflow asan warnings in ntcore tests
* Add DIOSetProxy constructor to HAL

* Upgrade MSVC compiler to 2022
* Bump native-utils to 2023.2.7 (changes to std=c++20)

Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
2022-10-15 16:33:14 -07:00
Tyler Veness
ac9be78e27 Use stricter C++ type conversions (#4357)
Now, implicit narrowing conversions are only used with wpi::Now(). This
also fixes clang-tidy warnings about C-style casts. For example:
```
== clang-tidy /__w/allwpilib/allwpilib/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.inc ==
/__w/allwpilib/allwpilib/wpilibNewCommands/src/main/native/include/frc2/command/SwerveControllerCommand.inc:95:18: warning: C-style casts are discouraged; use static_cast/const_cast/reinterpret_cast [google-readability-casting]
  auto curTime = units::second_t(m_timer.Get());
                 ^
```
In that case at least, the cast was removed entirely since Get() already
returns a units::second_t.
2022-08-17 13:42:36 -07:00
Tyler Veness
181723e573 Replace .to<double>() and .template to<double>() with .value() (#3667)
It's a less verbose way to do the same thing.
2021-10-25 08:58:12 -07:00
Peter Johnson
64f5413253 Use wpi::span instead of wpi::ArrayRef across all libraries (#3414)
- Remove ArrayRef.h
- Add SpanExtras.h for a couple of convenience functions
2021-06-06 19:51:14 -07:00
Starlight220
435bbb6a8c [command] RamseteCommand: Output 0 if interrupted (#3216) 2021-02-28 22:06:34 -08:00
Peter Johnson
aee4603269 clang-tidy: modernize-pass-by-value 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
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
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
9a8067465c Fix incomplete .styleguide (#2113)
Also clean up other .styleguides.

Fixes #2111.
2019-11-20 22:44:18 -08:00
Prateek Machiraju
5891628112 Use DifferentialDriveWheelSpeeds in RamseteCommand ctor (#2091) 2019-11-18 22:11:05 -08:00
Oblarg
7dc7c71b58 Add feedforward components (#2045)
Add helper classes for computing feedforwards with parameters supplied by the characterization tool.
2019-11-09 20:16:42 -08:00
Thad House
509819d83f Split the two command implementations into separate libraries (#2012)
This will allow us at the user code side to determine to include old commands, new commands or both.
2019-11-01 21:58:54 -07:00