From 5c9c45fadbe27435c5d5e8d684bbd93f9231da2e Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sat, 8 Nov 2025 16:58:51 -0800 Subject: [PATCH] [cscore, wpilibcExamples] Use double-quote includes for wpi/ (#8346) Use ERR and WARN in cscore to avoid conflict with Windows headers. --- cscore/.styleguide | 1 - cscore/src/main/native/cpp/HttpCameraImpl.cpp | 2 +- cscore/src/main/native/cpp/HttpCameraImpl.hpp | 3 +- cscore/src/main/native/cpp/Instance.hpp | 3 +- cscore/src/main/native/cpp/Log.hpp | 6 +-- .../src/main/native/cpp/MjpegServerImpl.cpp | 9 ++-- .../src/main/native/cpp/MjpegServerImpl.hpp | 7 ++- cscore/src/main/native/cpp/cscore_cpp.cpp | 3 +- .../src/main/native/linux/NetworkListener.cpp | 12 ++--- .../main/native/linux/UsbCameraListener.cpp | 7 ++- wpilibcExamples/.styleguide | 1 - .../commands/command2/ReplaceMeCommand2.hpp | 4 +- .../ReplaceMeInstantCommand2.hpp | 4 +- .../ReplaceMeParallelCommandGroup.hpp | 4 +- .../ReplaceMeParallelDeadlineGroup.cpp | 2 +- .../ReplaceMeParallelDeadlineGroup.hpp | 4 +- .../ReplaceMeParallelRaceGroup.hpp | 4 +- .../ReplaceMeSequentialCommandGroup.hpp | 4 +- .../subsystem2/ReplaceMeSubsystem2.hpp | 2 +- .../examples/AddressableLED/include/Robot.hpp | 6 +-- .../examples/AprilTagsVision/cpp/Robot.cpp | 21 ++++---- .../cpp/examples/ArcadeDrive/cpp/Robot.cpp | 8 +-- .../ArcadeDriveXboxController/cpp/Robot.cpp | 8 +-- .../ArmSimulation/cpp/subsystems/Arm.cpp | 8 +-- .../ArmSimulation/include/Constants.hpp | 12 ++--- .../examples/ArmSimulation/include/Robot.hpp | 5 +- .../ArmSimulation/include/subsystems/Arm.hpp | 27 +++++----- .../main/cpp/examples/CANPDP/cpp/Robot.cpp | 6 +-- .../DifferentialDriveBot/cpp/Robot.cpp | 7 ++- .../include/Drivetrain.hpp | 22 ++++---- .../cpp/Robot.cpp | 7 ++- .../include/Drivetrain.hpp | 54 +++++++++---------- .../ExampleGlobalMeasurementSensor.hpp | 4 +- .../DigitalCommunication/cpp/Robot.cpp | 2 +- .../DigitalCommunication/include/Robot.hpp | 4 +- .../DriveDistanceOffboard/cpp/Robot.cpp | 4 +- .../cpp/RobotContainer.cpp | 2 +- .../cpp/subsystems/DriveSubsystem.cpp | 2 +- .../include/Constants.hpp | 10 ++-- .../DriveDistanceOffboard/include/Robot.hpp | 5 +- .../include/RobotContainer.hpp | 9 ++-- .../include/subsystems/DriveSubsystem.hpp | 17 +++--- .../examples/DutyCycleEncoder/cpp/Robot.cpp | 8 +-- .../cpp/examples/DutyCycleInput/cpp/Robot.cpp | 8 +-- .../ElevatorExponentialProfile/cpp/Robot.cpp | 19 ++++--- .../cpp/subsystems/Elevator.cpp | 6 +-- .../include/Constants.hpp | 14 ++--- .../include/Robot.hpp | 5 +- .../include/subsystems/Elevator.hpp | 29 +++++----- .../ElevatorProfiledPID/cpp/Robot.cpp | 24 ++++----- .../cpp/subsystems/Elevator.cpp | 6 +-- .../ElevatorSimulation/include/Constants.hpp | 14 ++--- .../ElevatorSimulation/include/Robot.hpp | 5 +- .../include/subsystems/Elevator.hpp | 29 +++++----- .../ElevatorTrapezoidProfile/cpp/Robot.cpp | 19 ++++--- .../main/cpp/examples/Encoder/cpp/Robot.cpp | 6 +-- .../main/cpp/examples/EventLoop/cpp/Robot.cpp | 24 ++++----- .../FlywheelBangBangController/cpp/Robot.cpp | 22 ++++---- .../cpp/examples/GettingStarted/cpp/Robot.cpp | 10 ++-- .../src/main/cpp/examples/Gyro/cpp/Robot.cpp | 10 ++-- .../cpp/examples/GyroMecanum/cpp/Robot.cpp | 10 ++-- .../src/main/cpp/examples/HAL/c/Robot.c | 2 +- .../examples/HatchbotInlined/cpp/Robot.cpp | 8 +-- .../HatchbotInlined/cpp/RobotContainer.cpp | 2 +- .../HatchbotInlined/cpp/commands/Autos.cpp | 5 +- .../cpp/subsystems/DriveSubsystem.cpp | 2 +- .../cpp/subsystems/HatchSubsystem.cpp | 2 +- .../HatchbotInlined/include/Robot.hpp | 5 +- .../include/RobotContainer.hpp | 9 ++-- .../include/commands/Autos.hpp | 3 +- .../include/subsystems/DriveSubsystem.hpp | 9 ++-- .../include/subsystems/HatchSubsystem.hpp | 9 ++-- .../HatchbotTraditional/cpp/Robot.cpp | 8 +-- .../cpp/RobotContainer.cpp | 5 +- .../cpp/subsystems/DriveSubsystem.cpp | 2 +- .../cpp/subsystems/HatchSubsystem.cpp | 2 +- .../HatchbotTraditional/include/Robot.hpp | 5 +- .../include/RobotContainer.hpp | 7 ++- .../include/commands/ComplexAuto.hpp | 5 +- .../include/commands/DefaultDrive.hpp | 5 +- .../include/commands/DriveDistance.hpp | 5 +- .../include/commands/GrabHatch.hpp | 5 +- .../include/commands/HalveDriveSpeed.hpp | 5 +- .../include/commands/ReleaseHatch.hpp | 5 +- .../include/subsystems/DriveSubsystem.hpp | 9 ++-- .../include/subsystems/HatchSubsystem.hpp | 7 ++- .../main/cpp/examples/HidRumble/cpp/Robot.cpp | 4 +- .../cpp/examples/HttpCamera/cpp/Robot.cpp | 5 +- .../examples/I2CCommunication/cpp/Robot.cpp | 5 +- .../I2CCommunication/include/Robot.hpp | 4 +- .../examples/IntermediateVision/cpp/Robot.cpp | 5 +- .../examples/MecanumBot/cpp/Drivetrain.cpp | 2 +- .../cpp/examples/MecanumBot/cpp/Robot.cpp | 7 ++- .../MecanumBot/include/Drivetrain.hpp | 18 +++---- .../cpp/examples/MecanumDrive/cpp/Robot.cpp | 8 +-- .../cpp/Drivetrain.cpp | 3 +- .../MecanumDrivePoseEstimator/cpp/Robot.cpp | 7 ++- .../include/Drivetrain.hpp | 20 +++---- .../ExampleGlobalMeasurementSensor.hpp | 4 +- .../cpp/examples/Mechanism2d/cpp/Robot.cpp | 24 ++++----- .../cpp/examples/MotorControl/cpp/Robot.cpp | 10 ++-- .../PotentiometerPID/include/Robot.hpp | 12 ++--- .../cpp/examples/QuickVision/cpp/Robot.cpp | 4 +- .../cpp/RapidReactCommandBot.cpp | 7 ++- .../cpp/subsystems/Drive.cpp | 4 +- .../cpp/subsystems/Shooter.cpp | 2 +- .../include/Constants.hpp | 10 ++-- .../include/RapidReactCommandBot.hpp | 5 +- .../RapidReactCommandBot/include/Robot.hpp | 5 +- .../include/subsystems/Drive.hpp | 21 ++++---- .../include/subsystems/Intake.hpp | 9 ++-- .../include/subsystems/Pneumatics.hpp | 13 +++-- .../include/subsystems/Shooter.hpp | 17 +++--- .../include/subsystems/Storage.hpp | 11 ++-- .../cpp/examples/RomiReference/cpp/Robot.cpp | 2 +- .../RomiReference/cpp/RobotContainer.cpp | 5 +- .../cpp/commands/DriveDistance.cpp | 2 +- .../cpp/commands/TurnDegrees.cpp | 2 +- .../examples/RomiReference/include/Robot.hpp | 5 +- .../RomiReference/include/RobotContainer.hpp | 13 +++-- .../include/commands/AutonomousDistance.hpp | 5 +- .../include/commands/AutonomousTime.hpp | 5 +- .../include/commands/DriveDistance.hpp | 7 ++- .../include/commands/DriveTime.hpp | 9 ++-- .../include/commands/TeleopArcadeDrive.hpp | 5 +- .../include/commands/TurnDegrees.hpp | 9 ++-- .../include/commands/TurnTime.hpp | 9 ++-- .../include/subsystems/Drivetrain.hpp | 16 +++--- .../cpp/examples/SelectCommand/cpp/Robot.cpp | 4 +- .../SelectCommand/cpp/RobotContainer.cpp | 2 +- .../examples/SelectCommand/include/Robot.hpp | 5 +- .../SelectCommand/include/RobotContainer.hpp | 8 +-- .../cpp/Drivetrain.cpp | 2 +- .../cpp/Robot.cpp | 13 +++-- .../include/Drivetrain.hpp | 32 +++++------ .../main/cpp/examples/Solenoid/cpp/Robot.cpp | 4 +- .../cpp/examples/Solenoid/include/Robot.hpp | 14 ++--- .../cpp/examples/StateSpaceArm/cpp/Robot.cpp | 26 ++++----- .../examples/StateSpaceElevator/cpp/Robot.cpp | 30 +++++------ .../examples/StateSpaceFlywheel/cpp/Robot.cpp | 24 ++++----- .../StateSpaceFlywheelSysId/cpp/Robot.cpp | 22 ++++---- .../main/cpp/examples/SwerveBot/cpp/Robot.cpp | 9 ++-- .../examples/SwerveBot/cpp/SwerveModule.cpp | 2 +- .../examples/SwerveBot/include/Drivetrain.hpp | 9 ++-- .../SwerveBot/include/SwerveModule.hpp | 22 ++++---- .../cpp/Drivetrain.cpp | 3 +- .../SwerveDrivePoseEstimator/cpp/Robot.cpp | 7 ++- .../cpp/SwerveModule.cpp | 2 +- .../include/Drivetrain.hpp | 11 ++-- .../ExampleGlobalMeasurementSensor.hpp | 4 +- .../include/SwerveModule.hpp | 22 ++++---- .../cpp/examples/SysIdRoutine/cpp/Robot.cpp | 2 +- .../SysIdRoutine/cpp/SysIdRoutineBot.cpp | 2 +- .../SysIdRoutine/cpp/subsystems/Drive.cpp | 2 +- .../SysIdRoutine/cpp/subsystems/Shooter.cpp | 6 +-- .../SysIdRoutine/include/Constants.hpp | 12 ++--- .../examples/SysIdRoutine/include/Robot.hpp | 5 +- .../SysIdRoutine/include/SysIdRoutineBot.hpp | 5 +- .../SysIdRoutine/include/subsystems/Drive.hpp | 13 +++-- .../include/subsystems/Shooter.hpp | 15 +++--- .../main/cpp/examples/TankDrive/cpp/Robot.cpp | 8 +-- .../TankDriveXboxController/cpp/Robot.cpp | 8 +-- .../cpp/examples/UnitTest/include/Robot.hpp | 5 +- .../UnitTest/include/subsystems/Intake.hpp | 5 +- .../cpp/examples/XRPReference/cpp/Robot.cpp | 2 +- .../XRPReference/cpp/RobotContainer.cpp | 7 ++- .../cpp/commands/DriveDistance.cpp | 2 +- .../XRPReference/cpp/commands/TurnDegrees.cpp | 2 +- .../examples/XRPReference/include/Robot.hpp | 5 +- .../XRPReference/include/RobotContainer.hpp | 13 +++-- .../include/commands/AutonomousDistance.hpp | 5 +- .../include/commands/AutonomousTime.hpp | 5 +- .../include/commands/DriveDistance.hpp | 7 ++- .../include/commands/DriveTime.hpp | 9 ++-- .../include/commands/TeleopArcadeDrive.hpp | 5 +- .../include/commands/TurnDegrees.hpp | 9 ++-- .../include/commands/TurnTime.hpp | 9 ++-- .../XRPReference/include/subsystems/Arm.hpp | 6 +-- .../include/subsystems/Drivetrain.hpp | 16 +++--- .../snippets/ADXLAccelerometers/cpp/Robot.cpp | 8 +-- .../AccelerometerCollision/cpp/Robot.cpp | 8 +-- .../AccelerometerFilter/cpp/Robot.cpp | 10 ++-- .../AnalogAccelerometer/cpp/Robot.cpp | 6 +-- .../cpp/snippets/AnalogEncoder/cpp/Robot.cpp | 4 +- .../cpp/snippets/AnalogInput/cpp/Robot.cpp | 4 +- .../AnalogPotentiometer/cpp/Robot.cpp | 6 +-- .../cpp/snippets/DigitalInput/cpp/Robot.cpp | 4 +- .../snippets/DutyCycleEncoder/cpp/Robot.cpp | 4 +- .../main/cpp/snippets/Encoder/cpp/Robot.cpp | 6 +-- .../cpp/snippets/EncoderDrive/cpp/Robot.cpp | 8 +-- .../cpp/snippets/EncoderHoming/cpp/Robot.cpp | 8 +-- .../cpp/snippets/LimitSwitch/cpp/Robot.cpp | 10 ++-- .../cpp/snippets/OnboardIMU/cpp/Robot.cpp | 10 ++-- .../ProfiledPIDFeedforward/cpp/Robot.cpp | 18 +++---- .../cpp/templates/commandbased/cpp/Robot.cpp | 2 +- .../commandbased/cpp/RobotContainer.cpp | 3 +- .../commandbased/cpp/commands/Autos.cpp | 3 +- .../templates/commandbased/include/Robot.hpp | 5 +- .../commandbased/include/RobotContainer.hpp | 5 +- .../commandbased/include/commands/Autos.hpp | 3 +- .../include/commands/ExampleCommand.hpp | 5 +- .../include/subsystems/ExampleSubsystem.hpp | 4 +- .../commandbasedskeleton/cpp/Robot.cpp | 2 +- .../cpp/RobotContainer.cpp | 2 +- .../commandbasedskeleton/include/Robot.hpp | 5 +- .../include/RobotContainer.hpp | 2 +- .../templates/robotbaseskeleton/cpp/Robot.cpp | 8 +-- .../robotbaseskeleton/include/Robot.hpp | 2 +- .../main/cpp/templates/timed/cpp/Robot.cpp | 4 +- .../cpp/templates/timed/include/Robot.hpp | 4 +- .../templates/timedskeleton/include/Robot.hpp | 2 +- .../cpp/templates/timeslice/cpp/Robot.cpp | 4 +- .../cpp/templates/timeslice/include/Robot.hpp | 4 +- .../timesliceskeleton/include/Robot.hpp | 2 +- .../ArmSimulation/cpp/ArmSimulationTest.cpp | 16 +++--- .../cpp/examples/ArmSimulation/cpp/main.cpp | 3 +- .../cpp/DigitalCommunicationTest.cpp | 8 +-- .../DigitalCommunication/cpp/main.cpp | 3 +- .../cpp/ElevatorSimulationTest.cpp | 16 +++--- .../examples/ElevatorSimulation/cpp/main.cpp | 3 +- .../cpp/I2CCommunicationTest.cpp | 8 +-- .../examples/I2CCommunication/cpp/main.cpp | 3 +- .../cpp/PotentiometerPIDTest.cpp | 24 ++++----- .../examples/PotentiometerPID/cpp/main.cpp | 3 +- .../test/cpp/examples/UnitTest/cpp/main.cpp | 3 +- .../UnitTest/cpp/subsystems/IntakeTest.cpp | 6 +-- 226 files changed, 868 insertions(+), 951 deletions(-) diff --git a/cscore/.styleguide b/cscore/.styleguide index b0e2be473c..e92a14b205 100644 --- a/cscore/.styleguide +++ b/cscore/.styleguide @@ -41,5 +41,4 @@ includeOtherLibs { ^imgui ^support/ ^tcpsockets/ - ^wpi/net/ } diff --git a/cscore/src/main/native/cpp/HttpCameraImpl.cpp b/cscore/src/main/native/cpp/HttpCameraImpl.cpp index ca0264665f..75f1ece679 100644 --- a/cscore/src/main/native/cpp/HttpCameraImpl.cpp +++ b/cscore/src/main/native/cpp/HttpCameraImpl.cpp @@ -10,7 +10,6 @@ #include #include -#include #include "Instance.hpp" #include "JpegUtil.hpp" @@ -18,6 +17,7 @@ #include "Notifier.hpp" #include "Telemetry.hpp" #include "c_util.hpp" +#include "wpi/net/TCPConnector.h" #include "wpi/util/MemAlloc.hpp" #include "wpi/util/StringExtras.hpp" #include "wpi/util/timestamp.h" diff --git a/cscore/src/main/native/cpp/HttpCameraImpl.hpp b/cscore/src/main/native/cpp/HttpCameraImpl.hpp index 18659701a6..6ef175c731 100644 --- a/cscore/src/main/native/cpp/HttpCameraImpl.hpp +++ b/cscore/src/main/native/cpp/HttpCameraImpl.hpp @@ -15,10 +15,9 @@ #include #include -#include - #include "SourceImpl.hpp" #include "wpi/cs/cscore_cpp.hpp" +#include "wpi/net/HttpUtil.hpp" #include "wpi/util/StringMap.hpp" #include "wpi/util/condition_variable.hpp" #include "wpi/util/raw_istream.hpp" diff --git a/cscore/src/main/native/cpp/Instance.hpp b/cscore/src/main/native/cpp/Instance.hpp index 4e3e52a0a0..efdfb01c97 100644 --- a/cscore/src/main/native/cpp/Instance.hpp +++ b/cscore/src/main/native/cpp/Instance.hpp @@ -8,8 +8,6 @@ #include #include -#include - #include "Log.hpp" #include "NetworkListener.hpp" #include "Notifier.hpp" @@ -18,6 +16,7 @@ #include "Telemetry.hpp" #include "UnlimitedHandleResource.hpp" #include "UsbCameraListener.hpp" +#include "wpi/net/EventLoopRunner.hpp" #include "wpi/util/Logger.hpp" namespace wpi::cs { diff --git a/cscore/src/main/native/cpp/Log.hpp b/cscore/src/main/native/cpp/Log.hpp index b0dd9fc034..913a3c377e 100644 --- a/cscore/src/main/native/cpp/Log.hpp +++ b/cscore/src/main/native/cpp/Log.hpp @@ -30,10 +30,8 @@ inline void NamedLog(wpi::util::Logger& logger, unsigned int level, #define LOG(level, format, ...) \ WPI_LOG(m_logger, level, format __VA_OPT__(, ) __VA_ARGS__) -#undef ERROR -#define ERROR(format, ...) \ - WPI_ERROR(m_logger, format __VA_OPT__(, ) __VA_ARGS__) -#define WARNING(format, ...) \ +#define ERR(format, ...) WPI_ERROR(m_logger, format __VA_OPT__(, ) __VA_ARGS__) +#define WARN(format, ...) \ WPI_WARNING(m_logger, format __VA_OPT__(, ) __VA_ARGS__) #define INFO(format, ...) WPI_INFO(m_logger, format __VA_OPT__(, ) __VA_ARGS__) diff --git a/cscore/src/main/native/cpp/MjpegServerImpl.cpp b/cscore/src/main/native/cpp/MjpegServerImpl.cpp index 3ea6b1afd9..5a9cecce03 100644 --- a/cscore/src/main/native/cpp/MjpegServerImpl.cpp +++ b/cscore/src/main/native/cpp/MjpegServerImpl.cpp @@ -9,11 +9,6 @@ #include #include -#include -#include -#include -#include - #include "Instance.hpp" #include "JpegUtil.hpp" #include "Log.hpp" @@ -21,6 +16,10 @@ #include "SourceImpl.hpp" #include "c_util.hpp" #include "wpi/cs/cscore_cpp.hpp" +#include "wpi/net/HttpUtil.hpp" +#include "wpi/net/TCPAcceptor.h" +#include "wpi/net/raw_socket_istream.hpp" +#include "wpi/net/raw_socket_ostream.hpp" #include "wpi/util/SmallString.hpp" #include "wpi/util/StringExtras.hpp" #include "wpi/util/fmt/raw_ostream.hpp" diff --git a/cscore/src/main/native/cpp/MjpegServerImpl.hpp b/cscore/src/main/native/cpp/MjpegServerImpl.hpp index c15019f5ae..ad9572e7f1 100644 --- a/cscore/src/main/native/cpp/MjpegServerImpl.hpp +++ b/cscore/src/main/native/cpp/MjpegServerImpl.hpp @@ -12,11 +12,10 @@ #include #include -#include -#include -#include - #include "SinkImpl.hpp" +#include "wpi/net/NetworkAcceptor.hpp" +#include "wpi/net/NetworkStream.hpp" +#include "wpi/net/raw_socket_ostream.hpp" #include "wpi/util/SafeThread.hpp" #include "wpi/util/SmallVector.hpp" #include "wpi/util/raw_istream.hpp" diff --git a/cscore/src/main/native/cpp/cscore_cpp.cpp b/cscore/src/main/native/cpp/cscore_cpp.cpp index b81f265b98..9dc6d45631 100644 --- a/cscore/src/main/native/cpp/cscore_cpp.cpp +++ b/cscore/src/main/native/cpp/cscore_cpp.cpp @@ -8,8 +8,6 @@ #include #include -#include - #include "Handle.hpp" #include "Instance.hpp" #include "NetworkListener.hpp" @@ -18,6 +16,7 @@ #include "SinkImpl.hpp" #include "SourceImpl.hpp" #include "Telemetry.hpp" +#include "wpi/net/hostname.hpp" #include "wpi/util/SmallString.hpp" #include "wpi/util/json.hpp" diff --git a/cscore/src/main/native/linux/NetworkListener.cpp b/cscore/src/main/native/linux/NetworkListener.cpp index c48c9da6cc..653c1c022d 100644 --- a/cscore/src/main/native/linux/NetworkListener.cpp +++ b/cscore/src/main/native/linux/NetworkListener.cpp @@ -70,15 +70,14 @@ void NetworkListener::Impl::Thread::Main() { // Create event socket so we can be shut down m_command_fd = ::eventfd(0, 0); if (m_command_fd < 0) { - ERROR("NetworkListener: could not create eventfd: {}", - std::strerror(errno)); + ERR("NetworkListener: could not create eventfd: {}", std::strerror(errno)); return; } // Create netlink socket int sd = ::socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); if (sd < 0) { - ERROR("NetworkListener: could not create socket: {}", std::strerror(errno)); + ERR("NetworkListener: could not create socket: {}", std::strerror(errno)); ::close(m_command_fd); m_command_fd = -1; return; @@ -91,7 +90,7 @@ void NetworkListener::Impl::Thread::Main() { addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR; // NOLINTNEXTLINE(modernize-avoid-bind) if (bind(sd, reinterpret_cast(&addr), sizeof(addr)) < 0) { - ERROR("NetworkListener: could not create socket: {}", std::strerror(errno)); + ERR("NetworkListener: could not create socket: {}", std::strerror(errno)); ::close(sd); ::close(m_command_fd); m_command_fd = -1; @@ -114,7 +113,7 @@ void NetworkListener::Impl::Thread::Main() { int nfds = std::max(m_command_fd, sd) + 1; if (::select(nfds, &readfds, nullptr, nullptr, &tv) < 0) { - ERROR("NetworkListener: select(): {}", std::strerror(errno)); + ERR("NetworkListener: select(): {}", std::strerror(errno)); break; // XXX: is this the right thing to do here? } @@ -135,8 +134,7 @@ void NetworkListener::Impl::Thread::Main() { if (errno == EWOULDBLOCK || errno == EAGAIN) { continue; } - ERROR("NetworkListener: could not read netlink: {}", - std::strerror(errno)); + ERR("NetworkListener: could not read netlink: {}", std::strerror(errno)); break; // XXX: is this the right thing to do here? } if (len == 0) { diff --git a/cscore/src/main/native/linux/UsbCameraListener.cpp b/cscore/src/main/native/linux/UsbCameraListener.cpp index 457954cca3..c5c339d97f 100644 --- a/cscore/src/main/native/linux/UsbCameraListener.cpp +++ b/cscore/src/main/native/linux/UsbCameraListener.cpp @@ -6,11 +6,10 @@ #include -#include -#include -#include - #include "Notifier.hpp" +#include "wpi/net/EventLoopRunner.hpp" +#include "wpi/net/uv/FsEvent.hpp" +#include "wpi/net/uv/Timer.hpp" #include "wpi/util/StringExtras.hpp" using namespace wpi::cs; diff --git a/wpilibcExamples/.styleguide b/wpilibcExamples/.styleguide index e8f0eaf6ba..ccd3f561bb 100644 --- a/wpilibcExamples/.styleguide +++ b/wpilibcExamples/.styleguide @@ -12,5 +12,4 @@ includeOtherLibs { ^fmt/ ^gtest/ ^opencv2/ - ^wpi/ } diff --git a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.hpp b/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.hpp index 73acebd179..b8dec100c5 100644 --- a/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.hpp +++ b/wpilibcExamples/src/main/cpp/commands/command2/ReplaceMeCommand2.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" /** * An example command. diff --git a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp index b8c5aad1c6..f12a7e5e1b 100644 --- a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp +++ b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/InstantCommand.hpp" // NOTE: Consider using this command inline, rather than writing a subclass. // For more information, see: diff --git a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp index b97973c357..0e4bffa280 100644 --- a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp +++ b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/ParallelCommandGroup.hpp" // NOTE: Consider using this command inline, rather than writing a subclass. // For more information, see: diff --git a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp index c0fcc57cb2..6fc0db1946 100644 --- a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp +++ b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.cpp @@ -4,7 +4,7 @@ #include "ReplaceMeParallelDeadlineGroup.hpp" -#include +#include "wpi/commands2/InstantCommand.hpp" // NOTE: Consider using this command inline, rather than writing a subclass. // For more information, see: diff --git a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp index 0883a1f110..bbbfaeaa8c 100644 --- a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp +++ b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/ParallelDeadlineGroup.hpp" // NOTE: Consider using this command inline, rather than writing a subclass. // For more information, see: diff --git a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp index c621890b73..54ba9883ba 100644 --- a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp +++ b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/ParallelRaceGroup.hpp" // NOTE: Consider using this command inline, rather than writing a subclass. // For more information, see: diff --git a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp index 1cde0fb438..c4c0c54bca 100644 --- a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp +++ b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/SequentialCommandGroup.hpp" // NOTE: Consider using this command inline, rather than writing a subclass. // For more information, see: diff --git a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.hpp b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.hpp index 8669026d35..4ce07afd13 100644 --- a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.hpp +++ b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include "wpi/commands2/SubsystemBase.hpp" class ReplaceMeSubsystem2 : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/AddressableLED/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/AddressableLED/include/Robot.hpp index cda057f1ec..db1c4e95bd 100644 --- a/wpilibcExamples/src/main/cpp/examples/AddressableLED/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/AddressableLED/include/Robot.hpp @@ -6,9 +6,9 @@ #include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/led/AddressableLED.hpp" +#include "wpi/hardware/led/LEDPattern.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp index 00c3914e9f..e5d711321a 100644 --- a/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp @@ -12,16 +12,17 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "wpi/apriltag/AprilTagDetection.hpp" +#include "wpi/apriltag/AprilTagDetector.hpp" +#include "wpi/apriltag/AprilTagPoseEstimator.hpp" +#include "wpi/cameraserver/CameraServer.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/geometry/Transform3d.hpp" +#include "wpi/nt/IntegerArrayTopic.hpp" +#include "wpi/nt/NetworkTableInstance.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" /** * This is a demo program showing the detection of AprilTags. diff --git a/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp index 723e015c1c..5ed9e3727c 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a demo program showing the use of the DifferentialDrive class. diff --git a/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp index db86c4523b..9098074c8f 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a demo program showing the use of the DifferentialDrive class. diff --git a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/subsystems/Arm.cpp b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/subsystems/Arm.cpp index 15f0927b97..233ee9827a 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/subsystems/Arm.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/subsystems/Arm.cpp @@ -4,10 +4,10 @@ #include "subsystems/Arm.hpp" -#include -#include -#include -#include +#include "wpi/math/util/StateSpaceUtil.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/system/RobotController.hpp" +#include "wpi/util/Preferences.hpp" Arm::Arm() { m_encoder.SetDistancePerPulse(kArmEncoderDistPerPulse); diff --git a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Constants.hpp index cda5ee0317..1f439953a8 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Constants.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Constants.hpp @@ -6,12 +6,12 @@ #include -#include -#include -#include -#include -#include -#include +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/mass.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" /** * The Constants header provides a convenient place for teams to hold robot-wide diff --git a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Robot.hpp index 1b121cc859..3db1531146 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/Arm.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * This is a sample program to demonstrate the use of arm simulation. diff --git a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/subsystems/Arm.hpp b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/subsystems/Arm.hpp index ae87d939b5..bb3e7dcd46 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/subsystems/Arm.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/include/subsystems/Arm.hpp @@ -4,21 +4,20 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/ArmFeedforward.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/simulation/BatterySim.hpp" +#include "wpi/simulation/EncoderSim.hpp" +#include "wpi/simulation/PWMSim.hpp" +#include "wpi/simulation/RoboRioSim.hpp" +#include "wpi/simulation/SingleJointedArmSim.hpp" +#include "wpi/smartdashboard/Mechanism2d.hpp" +#include "wpi/smartdashboard/MechanismLigament2d.hpp" +#include "wpi/smartdashboard/MechanismRoot2d.hpp" +#include "wpi/units/length.hpp" class Arm { public: diff --git a/wpilibcExamples/src/main/cpp/examples/CANPDP/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/CANPDP/cpp/Robot.cpp index d724fd364d..b12634b8f3 100644 --- a/wpilibcExamples/src/main/cpp/examples/CANPDP/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/CANPDP/cpp/Robot.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/power/PowerDistribution.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" /** * This is a sample program showing how to retrieve information from the Power diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Robot.cpp index 2ca624e32f..7780414fc8 100644 --- a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Robot.cpp @@ -2,11 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp index c338175fcd..e1707b4b44 100644 --- a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp @@ -6,17 +6,17 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" +#include "wpi/math/kinematics/DifferentialDriveOdometry.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/velocity.hpp" /** * Represents a differential drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Robot.cpp index 7fa83dbb9d..0f9f04f774 100644 --- a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Robot.cpp @@ -2,11 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp index efbb5b0519..dac2ce98b2 100644 --- a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp @@ -6,33 +6,33 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/apriltag/AprilTagFieldLayout.hpp" +#include "wpi/apriltag/AprilTagFields.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/estimator/DifferentialDrivePoseEstimator.hpp" +#include "wpi/math/geometry/Pose2d.hpp" +#include "wpi/math/geometry/Pose3d.hpp" +#include "wpi/math/geometry/Quaternion.hpp" +#include "wpi/math/geometry/Transform3d.hpp" +#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" +#include "wpi/math/util/ComputerVisionUtil.hpp" +#include "wpi/nt/DoubleArrayTopic.hpp" +#include "wpi/nt/NetworkTableInstance.hpp" +#include "wpi/simulation/DifferentialDrivetrainSim.hpp" +#include "wpi/simulation/EncoderSim.hpp" +#include "wpi/smartdashboard/Field2d.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/system/RobotController.hpp" +#include "wpi/system/Timer.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/velocity.hpp" /** * Represents a differential drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp index cb2f85b4c7..6c34d126d3 100644 --- a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/math/geometry/Pose2d.hpp" +#include "wpi/math/util/StateSpaceUtil.hpp" /** * This dummy class represents a global measurement sensor, such as a computer diff --git a/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/cpp/Robot.cpp index 05ac9edf56..4005704bbf 100644 --- a/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/cpp/Robot.cpp @@ -4,7 +4,7 @@ #include "Robot.hpp" -#include +#include "wpi/driverstation/DriverStation.hpp" void Robot::RobotPeriodic() { // pull alliance port high if on red alliance, pull low if on blue alliance diff --git a/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/include/Robot.hpp index acd34a8d25..a19dda2f9e 100644 --- a/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DigitalCommunication/include/Robot.hpp @@ -6,8 +6,8 @@ #include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/DigitalOutput.hpp" /** * This is a sample program demonstrating how to communicate to a light diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp index b5dae18f8e..4066a07b39 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp @@ -4,8 +4,8 @@ #include "Robot.hpp" -#include -#include +#include "wpi/commands2/CommandScheduler.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp index 87502b1437..70ff2482c2 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/RobotContainer.cpp @@ -4,7 +4,7 @@ #include "RobotContainer.hpp" -#include +#include "wpi/commands2/Commands.hpp" RobotContainer::RobotContainer() { // Initialize all of your commands and subsystems here diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/subsystems/DriveSubsystem.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/subsystems/DriveSubsystem.cpp index 7d10603054..6dc25fce99 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/subsystems/DriveSubsystem.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/subsystems/DriveSubsystem.cpp @@ -4,7 +4,7 @@ #include "subsystems/DriveSubsystem.hpp" -#include +#include "wpi/system/RobotController.hpp" using namespace DriveConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Constants.hpp index 503a97b73a..99c08bfaa9 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Constants.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Constants.hpp @@ -6,11 +6,11 @@ #include -#include -#include -#include -#include -#include +#include "wpi/units/acceleration.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" /** * The Constants header provides a convenient place for teams to hold robot-wide diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Robot.hpp index 6fe0087197..06fd8e4082 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/Robot.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/RobotContainer.hpp index 265366f67c..0199f46553 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/RobotContainer.hpp @@ -4,13 +4,12 @@ #pragma once -#include -#include -#include -#include - #include "Constants.hpp" #include "subsystems/DriveSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/commands2/button/CommandXboxController.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.hpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.hpp index 3bc7dd3139..c6dcb56e74 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.hpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.hpp @@ -4,17 +4,16 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" #include "ExampleSmartMotorController.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/trajectory/TrapezoidProfile.hpp" +#include "wpi/system/Timer.hpp" +#include "wpi/units/length.hpp" class DriveSubsystem : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp index 83a4b8ba88..d8c58f2ab0 100644 --- a/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/rotation/DutyCycleEncoder.hpp" +#include "wpi/math/util/MathUtil.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" constexpr double fullRange = 1.3; constexpr double expectedZero = 0.0; diff --git a/wpilibcExamples/src/main/cpp/examples/DutyCycleInput/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DutyCycleInput/cpp/Robot.cpp index 54c2ca74c3..41819c92fa 100644 --- a/wpilibcExamples/src/main/cpp/examples/DutyCycleInput/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DutyCycleInput/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/DigitalInput.hpp" +#include "wpi/hardware/rotation/DutyCycle.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" class Robot : public wpi::TimedRobot { wpi::DutyCycle m_dutyCycle{0}; // Duty cycle input diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp index 995f6d6417..5dec55d64c 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp @@ -4,17 +4,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "ExampleSmartMotorController.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/trajectory/ExponentialProfile.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/cpp/subsystems/Elevator.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/cpp/subsystems/Elevator.cpp index 28fc2eca2d..dbebf52b59 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/cpp/subsystems/Elevator.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/cpp/subsystems/Elevator.cpp @@ -4,9 +4,9 @@ #include "subsystems/Elevator.hpp" -#include -#include -#include +#include "wpi/math/util/StateSpaceUtil.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/system/RobotController.hpp" Elevator::Elevator() { m_encoder.SetDistancePerPulse(Constants::kArmEncoderDistPerPulse); diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Constants.hpp index 9a5e38658d..27f6907cba 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Constants.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Constants.hpp @@ -6,13 +6,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/units/acceleration.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/mass.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" /** * The Constants header provides a convenient place for teams to hold robot-wide diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Robot.hpp index 0ad8678515..6a1add7288 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/Elevator.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * This is a sample program to demonstrate the use of elevator simulation. diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/subsystems/Elevator.hpp b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/subsystems/Elevator.hpp index 1ac418a5a6..07828f57dd 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/subsystems/Elevator.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/subsystems/Elevator.hpp @@ -4,22 +4,21 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/ElevatorFeedforward.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/trajectory/ExponentialProfile.hpp" +#include "wpi/simulation/BatterySim.hpp" +#include "wpi/simulation/ElevatorSim.hpp" +#include "wpi/simulation/EncoderSim.hpp" +#include "wpi/simulation/PWMMotorControllerSim.hpp" +#include "wpi/simulation/RoboRioSim.hpp" +#include "wpi/smartdashboard/Mechanism2d.hpp" +#include "wpi/smartdashboard/MechanismLigament2d.hpp" +#include "wpi/smartdashboard/MechanismRoot2d.hpp" +#include "wpi/units/length.hpp" class Elevator { public: diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp index 5eca546ffc..c605aca226 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp @@ -4,18 +4,18 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/ElevatorFeedforward.hpp" +#include "wpi/math/controller/ProfiledPIDController.hpp" +#include "wpi/math/trajectory/TrapezoidProfile.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/subsystems/Elevator.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/subsystems/Elevator.cpp index d5140a7636..bf115e1b0c 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/subsystems/Elevator.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/subsystems/Elevator.cpp @@ -4,9 +4,9 @@ #include "subsystems/Elevator.hpp" -#include -#include -#include +#include "wpi/math/util/StateSpaceUtil.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/system/RobotController.hpp" Elevator::Elevator() { m_encoder.SetDistancePerPulse(Constants::kArmEncoderDistPerPulse); diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Constants.hpp index e5afd4a072..e317177288 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Constants.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Constants.hpp @@ -6,13 +6,13 @@ #include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/units/acceleration.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/mass.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" /** * The Constants header provides a convenient place for teams to hold robot-wide diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Robot.hpp index e32864add2..4dfa94cb27 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/Elevator.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * This is a sample program to demonstrate the use of elevator simulation. diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/subsystems/Elevator.hpp b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/subsystems/Elevator.hpp index 0107320df0..3fdf7269cd 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/subsystems/Elevator.hpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/subsystems/Elevator.hpp @@ -4,22 +4,21 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/ElevatorFeedforward.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/ProfiledPIDController.hpp" +#include "wpi/simulation/BatterySim.hpp" +#include "wpi/simulation/ElevatorSim.hpp" +#include "wpi/simulation/EncoderSim.hpp" +#include "wpi/simulation/PWMMotorControllerSim.hpp" +#include "wpi/simulation/RoboRioSim.hpp" +#include "wpi/smartdashboard/Mechanism2d.hpp" +#include "wpi/smartdashboard/MechanismLigament2d.hpp" +#include "wpi/smartdashboard/MechanismRoot2d.hpp" +#include "wpi/units/length.hpp" class Elevator { public: diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp index 277a0ef847..f88758757f 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp @@ -4,17 +4,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "ExampleSmartMotorController.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/trajectory/TrapezoidProfile.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/Encoder/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/Encoder/cpp/Robot.cpp index 0db1ffed80..aa4d1eb6ea 100644 --- a/wpilibcExamples/src/main/cpp/examples/Encoder/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/Encoder/cpp/Robot.cpp @@ -4,9 +4,9 @@ #include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" /** * Sample program displaying the value of a quadrature encoder on the diff --git a/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp index c12c6e54ee..07f6ccc4c8 100644 --- a/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp @@ -2,18 +2,18 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/event/BooleanEvent.hpp" +#include "wpi/event/EventLoop.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/voltage.hpp" static const auto SHOT_VELOCITY = 200_rpm; static const auto TOLERANCE = 8_rpm; diff --git a/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp index 4d72dc6b20..091e33c377 100644 --- a/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp @@ -2,17 +2,17 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/BangBangController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" +#include "wpi/simulation/EncoderSim.hpp" +#include "wpi/simulation/FlywheelSim.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/units/moment_of_inertia.hpp" /** * This is a sample program to demonstrate the use of a diff --git a/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp index ee5fa80fd3..fe5f9391b0 100644 --- a/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/GettingStarted/cpp/Robot.cpp @@ -2,11 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/system/Timer.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/Gyro/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/Gyro/cpp/Robot.cpp index 9a828578aa..bf93c9e0fc 100644 --- a/wpilibcExamples/src/main/cpp/examples/Gyro/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/Gyro/cpp/Robot.cpp @@ -4,11 +4,11 @@ #include -#include -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a sample program to demonstrate how to use a gyro sensor to make a diff --git a/wpilibcExamples/src/main/cpp/examples/GyroMecanum/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/GyroMecanum/cpp/Robot.cpp index f8b8126e41..ace020d3c5 100644 --- a/wpilibcExamples/src/main/cpp/examples/GyroMecanum/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/GyroMecanum/cpp/Robot.cpp @@ -2,11 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include +#include "wpi/drive/MecanumDrive.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a sample program that uses mecanum drive with a gyro sensor to diff --git a/wpilibcExamples/src/main/cpp/examples/HAL/c/Robot.c b/wpilibcExamples/src/main/cpp/examples/HAL/c/Robot.c index 14d71729cb..64f732b522 100644 --- a/wpilibcExamples/src/main/cpp/examples/HAL/c/Robot.c +++ b/wpilibcExamples/src/main/cpp/examples/HAL/c/Robot.c @@ -15,7 +15,7 @@ that want even more control over what code runs on their robot. #include -#include +#include "wpi/hal/HAL.h" enum DriverStationMode { DisabledMode, diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp index 4d630d79f1..8254b6b646 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp @@ -4,10 +4,10 @@ #include "Robot.hpp" -#include -#include -#include -#include +#include "wpi/commands2/CommandScheduler.hpp" +#include "wpi/driverstation/DriverStation.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/system/DataLogManager.hpp" Robot::Robot() { // Start recording to data log diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp index fda29e5c05..92c213fb5e 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp @@ -4,7 +4,7 @@ #include "RobotContainer.hpp" -#include +#include "wpi/smartdashboard/SmartDashboard.hpp" RobotContainer::RobotContainer() { // Initialize all of your commands and subsystems here diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/commands/Autos.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/commands/Autos.cpp index 7e1edfd332..eb2a3a4558 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/commands/Autos.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/commands/Autos.cpp @@ -4,10 +4,9 @@ #include "commands/Autos.hpp" -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/commands2/FunctionalCommand.hpp" using namespace AutoConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/DriveSubsystem.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/DriveSubsystem.cpp index 3421e69341..8bae9bdad2 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/DriveSubsystem.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/DriveSubsystem.cpp @@ -4,7 +4,7 @@ #include "subsystems/DriveSubsystem.hpp" -#include +#include "wpi/util/sendable/SendableBuilder.hpp" using namespace DriveConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/HatchSubsystem.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/HatchSubsystem.cpp index 6ebc783f4a..6729b67527 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/HatchSubsystem.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/subsystems/HatchSubsystem.cpp @@ -4,7 +4,7 @@ #include "subsystems/HatchSubsystem.hpp" -#include +#include "wpi/util/sendable/SendableBuilder.hpp" using namespace HatchConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/Robot.hpp index 46630d3c0c..e85eeafd48 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/RobotContainer.hpp index bf90d22f37..41b33de0bf 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/RobotContainer.hpp @@ -4,15 +4,14 @@ #pragma once -#include -#include -#include -#include - #include "Constants.hpp" #include "commands/Autos.hpp" #include "subsystems/DriveSubsystem.hpp" #include "subsystems/HatchSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/commands2/button/CommandPS4Controller.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" namespace ac = AutoConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/commands/Autos.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/commands/Autos.hpp index 59afdd21d9..78942a635d 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/commands/Autos.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/commands/Autos.hpp @@ -4,10 +4,9 @@ #pragma once -#include - #include "subsystems/DriveSubsystem.hpp" #include "subsystems/HatchSubsystem.hpp" +#include "wpi/commands2/CommandPtr.hpp" /** Container for auto command factories. */ namespace autos { diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/DriveSubsystem.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/DriveSubsystem.hpp index f8896a27af..e0efecdb53 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/DriveSubsystem.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/DriveSubsystem.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" class DriveSubsystem : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/HatchSubsystem.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/HatchSubsystem.hpp index ba81b034f3..d1fd94643c 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/HatchSubsystem.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/include/subsystems/HatchSubsystem.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" +#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp" class HatchSubsystem : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp index 4d630d79f1..8254b6b646 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp @@ -4,10 +4,10 @@ #include "Robot.hpp" -#include -#include -#include -#include +#include "wpi/commands2/CommandScheduler.hpp" +#include "wpi/driverstation/DriverStation.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/system/DataLogManager.hpp" Robot::Robot() { // Start recording to data log diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp index 73a06463e5..fed5adf555 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp @@ -4,13 +4,12 @@ #include "RobotContainer.hpp" -#include -#include - #include "commands/DefaultDrive.hpp" #include "commands/GrabHatch.hpp" #include "commands/HalveDriveSpeed.hpp" #include "commands/ReleaseHatch.hpp" +#include "wpi/commands2/button/JoystickButton.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" RobotContainer::RobotContainer() { // Initialize all of your commands and subsystems here diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/DriveSubsystem.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/DriveSubsystem.cpp index 3421e69341..8bae9bdad2 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/DriveSubsystem.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/DriveSubsystem.cpp @@ -4,7 +4,7 @@ #include "subsystems/DriveSubsystem.hpp" -#include +#include "wpi/util/sendable/SendableBuilder.hpp" using namespace DriveConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/HatchSubsystem.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/HatchSubsystem.cpp index 517392617a..335c01daf0 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/HatchSubsystem.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/subsystems/HatchSubsystem.cpp @@ -4,7 +4,7 @@ #include "subsystems/HatchSubsystem.hpp" -#include +#include "wpi/util/sendable/SendableBuilder.hpp" using namespace HatchConstants; diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/Robot.hpp index 46630d3c0c..e85eeafd48 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/RobotContainer.hpp index b080241199..9c83ec9c69 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/RobotContainer.hpp @@ -4,16 +4,15 @@ #pragma once -#include -#include -#include - #include "Constants.hpp" #include "commands/ComplexAuto.hpp" #include "commands/DefaultDrive.hpp" #include "commands/DriveDistance.hpp" #include "subsystems/DriveSubsystem.hpp" #include "subsystems/HatchSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ComplexAuto.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ComplexAuto.hpp index b0f628805d..eae0d22753 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ComplexAuto.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ComplexAuto.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include - #include "Constants.hpp" #include "commands/DriveDistance.hpp" #include "commands/ReleaseHatch.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/SequentialCommandGroup.hpp" /** * A complex auto command that drives forward, releases a hatch, and then drives diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DefaultDrive.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DefaultDrive.hpp index d48df4bd51..a45a1b2ce3 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DefaultDrive.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DefaultDrive.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "subsystems/DriveSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" /** * A command to drive the robot with joystick input passed in through lambdas. diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DriveDistance.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DriveDistance.hpp index feda0f1f2e..6d44112163 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DriveDistance.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DriveDistance.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/DriveSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" class DriveDistance : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/GrabHatch.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/GrabHatch.hpp index 11f8f9e366..d01746d498 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/GrabHatch.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/GrabHatch.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/HatchSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" /** * A simple command that grabs a hatch with the HatchSubsystem. Written diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/HalveDriveSpeed.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/HalveDriveSpeed.hpp index b64c9209c3..452a884548 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/HalveDriveSpeed.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/HalveDriveSpeed.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/DriveSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" class HalveDriveSpeed : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ReleaseHatch.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ReleaseHatch.hpp index d741b6252a..f6e14c70e6 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ReleaseHatch.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ReleaseHatch.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/HatchSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" /** * A simple command that releases a hatch with the HatchSubsystem. Written diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/DriveSubsystem.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/DriveSubsystem.hpp index f8896a27af..e0efecdb53 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/DriveSubsystem.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/DriveSubsystem.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" class DriveSubsystem : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/HatchSubsystem.hpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/HatchSubsystem.hpp index 4a8218e74f..7560a28c81 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/HatchSubsystem.hpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/subsystems/HatchSubsystem.hpp @@ -4,11 +4,10 @@ #pragma once -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" +#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp" class HatchSubsystem : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/HidRumble/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HidRumble/cpp/Robot.cpp index c750742bc4..bcf1734839 100644 --- a/wpilibcExamples/src/main/cpp/examples/HidRumble/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HidRumble/cpp/Robot.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * This is a demo program showing the use of GenericHID's rumble feature. diff --git a/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp index 438e1c7a89..4857d7a0e4 100644 --- a/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp @@ -5,8 +5,9 @@ #include #include #include -#include -#include + +#include "wpi/cameraserver/CameraServer.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * This is a demo program showing the use of OpenCV to do vision processing. The diff --git a/wpilibcExamples/src/main/cpp/examples/I2CCommunication/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/I2CCommunication/cpp/Robot.cpp index 46798f8bb7..8bc4e8ae52 100644 --- a/wpilibcExamples/src/main/cpp/examples/I2CCommunication/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/I2CCommunication/cpp/Robot.cpp @@ -7,8 +7,9 @@ #include #include -#include -#include + +#include "wpi/driverstation/DriverStation.hpp" +#include "wpi/system/Timer.hpp" void Robot::RobotPeriodic() { // Creates a string to hold current robot state information, including diff --git a/wpilibcExamples/src/main/cpp/examples/I2CCommunication/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/I2CCommunication/include/Robot.hpp index e7ca252917..2f8877da8f 100644 --- a/wpilibcExamples/src/main/cpp/examples/I2CCommunication/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/I2CCommunication/include/Robot.hpp @@ -6,8 +6,8 @@ #include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/bus/I2C.hpp" /** * This is a sample program demonstrating how to communicate to a light diff --git a/wpilibcExamples/src/main/cpp/examples/IntermediateVision/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/IntermediateVision/cpp/Robot.cpp index e9c17c2797..95b9ffb820 100644 --- a/wpilibcExamples/src/main/cpp/examples/IntermediateVision/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/IntermediateVision/cpp/Robot.cpp @@ -8,8 +8,9 @@ #include #include #include -#include -#include + +#include "wpi/cameraserver/CameraServer.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * This is a demo program showing the use of OpenCV to do vision processing. The diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp index 01d432ffd6..311988f7c1 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp @@ -4,7 +4,7 @@ #include "Drivetrain.hpp" -#include +#include "wpi/math/kinematics/ChassisSpeeds.hpp" wpi::math::MecanumDriveWheelSpeeds Drivetrain::GetCurrentState() const { return {wpi::units::meters_per_second_t{m_frontLeftEncoder.GetRate()}, diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Robot.cpp index 735af87274..6ea04f1d1f 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Robot.cpp @@ -2,11 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp index 272624d11e..ad6ee91c60 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp @@ -6,15 +6,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/geometry/Translation2d.hpp" +#include "wpi/math/kinematics/MecanumDriveKinematics.hpp" +#include "wpi/math/kinematics/MecanumDriveOdometry.hpp" +#include "wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp" /** * Represents a mecanum drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrive/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrive/cpp/Robot.cpp index 953478a1b7..58e24b4020 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumDrive/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrive/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/drive/MecanumDrive.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a demo program showing how to use Mecanum control with the diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp index 22022a3eca..bf2105fbd4 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp @@ -4,9 +4,8 @@ #include "Drivetrain.hpp" -#include - #include "ExampleGlobalMeasurementSensor.hpp" +#include "wpi/system/Timer.hpp" wpi::math::MecanumDriveWheelSpeeds Drivetrain::GetCurrentState() const { return {wpi::units::meters_per_second_t{m_frontLeftEncoder.GetRate()}, diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Robot.cpp index 735af87274..6ea04f1d1f 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Robot.cpp @@ -2,11 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp index 2a4c022c7b..5d606f7b76 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp @@ -6,16 +6,16 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/estimator/MecanumDrivePoseEstimator.hpp" +#include "wpi/math/geometry/Translation2d.hpp" +#include "wpi/math/kinematics/MecanumDriveKinematics.hpp" +#include "wpi/math/kinematics/MecanumDriveOdometry.hpp" +#include "wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp" /** * Represents a mecanum drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp index cb2f85b4c7..6c34d126d3 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/math/geometry/Pose2d.hpp" +#include "wpi/math/util/StateSpaceUtil.hpp" /** * This dummy class represents a global measurement sensor, such as a computer diff --git a/wpilibcExamples/src/main/cpp/examples/Mechanism2d/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/Mechanism2d/cpp/Robot.cpp index f3343f5382..6191acce96 100644 --- a/wpilibcExamples/src/main/cpp/examples/Mechanism2d/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/Mechanism2d/cpp/Robot.cpp @@ -2,18 +2,18 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/AnalogPotentiometer.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/simulation/SimHooks.hpp" +#include "wpi/smartdashboard/Mechanism2d.hpp" +#include "wpi/smartdashboard/MechanismLigament2d.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/util/Color.hpp" +#include "wpi/util/Color8Bit.hpp" /** * This sample program shows how to use Mechanism2d - a visual representation of diff --git a/wpilibcExamples/src/main/cpp/examples/MotorControl/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/MotorControl/cpp/Robot.cpp index c2673de1be..ce850d3c9f 100644 --- a/wpilibcExamples/src/main/cpp/examples/MotorControl/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MotorControl/cpp/Robot.cpp @@ -4,11 +4,11 @@ #include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" /** * This sample program shows how to control a motor using a joystick. In the diff --git a/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/include/Robot.hpp index c0860024a8..4c3c6bc40d 100644 --- a/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/include/Robot.hpp @@ -6,12 +6,12 @@ #include -#include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/AnalogPotentiometer.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/units/length.hpp" /** * This is a sample program to demonstrate how to use a soft potentiometer and a diff --git a/wpilibcExamples/src/main/cpp/examples/QuickVision/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/QuickVision/cpp/Robot.cpp index ad46373e19..bc8e6d86da 100644 --- a/wpilibcExamples/src/main/cpp/examples/QuickVision/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/QuickVision/cpp/Robot.cpp @@ -4,8 +4,8 @@ #include -#include -#include +#include "wpi/cameraserver/CameraServer.hpp" +#include "wpi/framework/TimedRobot.hpp" /** * Uses the CameraServer class to automatically capture video from a USB webcam diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp index dcc4d4f575..5201752102 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/RapidReactCommandBot.cpp @@ -4,11 +4,10 @@ #include "RapidReactCommandBot.hpp" -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/commands2/button/Trigger.hpp" void RapidReactCommandBot::ConfigureBindings() { // Automatically run the storage motor whenever the ball storage is not full, diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Drive.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Drive.cpp index 266d5a36d6..0ab8fca670 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Drive.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Drive.cpp @@ -6,8 +6,8 @@ #include -#include -#include +#include "wpi/commands2/Commands.hpp" +#include "wpi/system/RobotController.hpp" Drive::Drive() { wpi::util::SendableRegistry::AddChild(&m_drive, &m_leftLeader); diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Shooter.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Shooter.cpp index ea994702b2..647ade7d8d 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Shooter.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Shooter.cpp @@ -4,7 +4,7 @@ #include "subsystems/Shooter.hpp" -#include +#include "wpi/commands2/Commands.hpp" Shooter::Shooter() { m_shooterFeedback.SetTolerance(ShooterConstants::kShooterTolerance.value()); diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Constants.hpp index caa3d0fd54..5056963989 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Constants.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Constants.hpp @@ -6,11 +6,11 @@ #include -#include -#include -#include -#include -#include +#include "wpi/units/angle.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/voltage.hpp" namespace DriveConstants { inline constexpr int kLeftMotor1Port = 0; diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/RapidReactCommandBot.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/RapidReactCommandBot.hpp index bec4bf5c59..0a7049669c 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/RapidReactCommandBot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/RapidReactCommandBot.hpp @@ -4,15 +4,14 @@ #pragma once -#include -#include - #include "Constants.hpp" #include "subsystems/Drive.hpp" #include "subsystems/Intake.hpp" #include "subsystems/Pneumatics.hpp" #include "subsystems/Shooter.hpp" #include "subsystems/Storage.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/button/CommandXboxController.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Robot.hpp index 0cbfa765bb..a8a03790c4 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/Robot.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "RapidReactCommandBot.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.hpp index 3d3b063118..5ff0a02d10 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.hpp @@ -6,18 +6,17 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/ProfiledPIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" class Drive : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.hpp index 71addb4f6a..b782977b12 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Intake.hpp @@ -6,12 +6,11 @@ #include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" class Intake : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.hpp index 0faba9eea5..3b9814a871 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Pneumatics.hpp @@ -4,14 +4,13 @@ #pragma once -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/hardware/pneumatic/Compressor.hpp" +#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp" +#include "wpi/hardware/rotation/AnalogPotentiometer.hpp" +#include "wpi/units/pressure.hpp" class Pneumatics : wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.hpp index 9861bf0616..df6496d254 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Shooter.hpp @@ -6,16 +6,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/angular_velocity.hpp" class Shooter : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.hpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.hpp index 6e16daffdd..40227711da 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Storage.hpp @@ -4,13 +4,12 @@ #pragma once -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/commands2/button/Trigger.hpp" +#include "wpi/hardware/discrete/DigitalInput.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" class Storage : wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp index b69e86743c..ac43e33927 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp @@ -4,7 +4,7 @@ #include "Robot.hpp" -#include +#include "wpi/commands2/CommandScheduler.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/RobotContainer.cpp index 99b9a38b84..07f1cd0a47 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/RobotContainer.cpp @@ -4,10 +4,9 @@ #include "RobotContainer.hpp" -#include -#include - #include "commands/TeleopArcadeDrive.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" RobotContainer::RobotContainer() { // Configure the button bindings diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/DriveDistance.cpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/DriveDistance.cpp index 61d67e3d08..e2f74edb2f 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/DriveDistance.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/DriveDistance.cpp @@ -4,7 +4,7 @@ #include "commands/DriveDistance.hpp" -#include +#include "wpi/units/math.hpp" void DriveDistance::Initialize() { m_drive->ArcadeDrive(0, 0); diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/TurnDegrees.cpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/TurnDegrees.cpp index e92dbfa5cb..c40143a522 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/TurnDegrees.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/TurnDegrees.cpp @@ -6,7 +6,7 @@ #include -#include +#include "wpi/units/math.hpp" void TurnDegrees::Initialize() { // Set motors to stop, read encoder values for starting point diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/Robot.hpp index c3dae38a53..491f60b9ce 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp index ba4905cea9..cd97b5fa50 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp @@ -4,17 +4,16 @@ #pragma once -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" #include "commands/AutonomousDistance.hpp" #include "commands/AutonomousTime.hpp" #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/button/Trigger.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/romi/OnBoardIO.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousDistance.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousDistance.hpp index 7cef535c02..7bdff20ee0 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousDistance.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousDistance.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include - #include "commands/DriveDistance.hpp" #include "commands/TurnDegrees.hpp" #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/SequentialCommandGroup.hpp" class AutonomousDistance : public wpi::cmd::CommandHelper -#include - #include "commands/DriveTime.hpp" #include "commands/TurnTime.hpp" #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/SequentialCommandGroup.hpp" class AutonomousTime : public wpi::cmd::CommandHelper -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/units/length.hpp" class DriveDistance : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveTime.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveTime.hpp index 3ab5ad2a8a..9c28f7319a 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveTime.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveTime.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/system/Timer.hpp" +#include "wpi/units/time.hpp" class DriveTime : public wpi::cmd::CommandHelper { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TeleopArcadeDrive.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TeleopArcadeDrive.hpp index e0e7ce6f22..83b111de94 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TeleopArcadeDrive.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TeleopArcadeDrive.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" class TeleopArcadeDrive : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnDegrees.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnDegrees.hpp index 9fd4f93e00..71bf68e09d 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnDegrees.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnDegrees.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" class TurnDegrees : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnTime.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnTime.hpp index 3d8ac60f0d..17f076a7d2 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnTime.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnTime.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/system/Timer.hpp" +#include "wpi/units/time.hpp" class TurnTime : public wpi::cmd::CommandHelper { public: diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/subsystems/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/subsystems/Drivetrain.hpp index eab1e2b789..d8da2f3ead 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/subsystems/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/subsystems/Drivetrain.hpp @@ -4,14 +4,14 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/motor/Spark.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/romi/RomiGyro.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" class Drivetrain : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp index 27d2e202fb..4126afdfff 100644 --- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp @@ -4,8 +4,8 @@ #include "Robot.hpp" -#include -#include +#include "wpi/commands2/CommandScheduler.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/RobotContainer.cpp index 9b832e3028..9bb102d21c 100644 --- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/RobotContainer.cpp @@ -4,7 +4,7 @@ #include "RobotContainer.hpp" -#include +#include "wpi/smartdashboard/SmartDashboard.hpp" RobotContainer::RobotContainer() { // Initialize all of your commands and subsystems here diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/Robot.hpp index 46630d3c0c..e85eeafd48 100644 --- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp index 767c8436ef..e23769e994 100644 --- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp @@ -4,10 +4,10 @@ #pragma once -#include -#include -#include -#include +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp index 3de27582a0..dd8c6a74f5 100644 --- a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp @@ -4,7 +4,7 @@ #include "Drivetrain.hpp" -#include +#include "wpi/system/RobotController.hpp" void Drivetrain::SetSpeeds( const wpi::math::DifferentialDriveWheelSpeeds& speeds) { diff --git a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp index 4257503dfe..50cc1693b8 100644 --- a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp @@ -2,14 +2,13 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/controller/LTVUnicycleController.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" +#include "wpi/math/trajectory/TrajectoryGenerator.hpp" +#include "wpi/system/Timer.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp index af01c018fd..7e73fdbfeb 100644 --- a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp @@ -6,22 +6,22 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp" +#include "wpi/math/kinematics/DifferentialDriveOdometry.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" +#include "wpi/simulation/DifferentialDrivetrainSim.hpp" +#include "wpi/simulation/EncoderSim.hpp" +#include "wpi/smartdashboard/Field2d.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/velocity.hpp" /** * Represents a differential drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/Solenoid/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/Solenoid/cpp/Robot.cpp index a74792d1e0..f08997f1fc 100644 --- a/wpilibcExamples/src/main/cpp/examples/Solenoid/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/Solenoid/cpp/Robot.cpp @@ -4,8 +4,8 @@ #include "Robot.hpp" -#include -#include +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/units/pressure.hpp" Robot::Robot() { // Publish elements to shuffleboard. diff --git a/wpilibcExamples/src/main/cpp/examples/Solenoid/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/Solenoid/include/Robot.hpp index 7ef191eb18..0930419747 100644 --- a/wpilibcExamples/src/main/cpp/examples/Solenoid/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/Solenoid/include/Robot.hpp @@ -4,13 +4,13 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/pneumatic/Compressor.hpp" +#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" +#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp" +#include "wpi/hardware/pneumatic/Solenoid.hpp" +#include "wpi/hardware/rotation/AnalogPotentiometer.hpp" /** * This is a sample program showing the use of the solenoid classes during diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp index 6146c8a04c..48dfdfa54e 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp @@ -4,19 +4,19 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/LinearQuadraticRegulator.hpp" +#include "wpi/math/estimator/KalmanFilter.hpp" +#include "wpi/math/system/LinearSystemLoop.hpp" +#include "wpi/math/system/plant/DCMotor.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" +#include "wpi/math/trajectory/TrapezoidProfile.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/moment_of_inertia.hpp" /** * This is a sample program to demonstrate how to use a state-space controller diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp index c5049c42e6..a11228f455 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp @@ -4,21 +4,21 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/LinearQuadraticRegulator.hpp" +#include "wpi/math/estimator/KalmanFilter.hpp" +#include "wpi/math/system/LinearSystemLoop.hpp" +#include "wpi/math/system/plant/DCMotor.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" +#include "wpi/math/trajectory/TrapezoidProfile.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/mass.hpp" +#include "wpi/units/velocity.hpp" /** * This is a sample program to demonstrate how to use a state-space controller diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp index f3259d704f..3733639296 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp @@ -4,18 +4,18 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/DriverStation.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/LinearQuadraticRegulator.hpp" +#include "wpi/math/estimator/KalmanFilter.hpp" +#include "wpi/math/system/LinearSystemLoop.hpp" +#include "wpi/math/system/plant/DCMotor.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" +#include "wpi/units/angular_velocity.hpp" /** * This is a sample program to demonstrate how to use a state-space controller diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp index 2f9068cbab..49db286d15 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp @@ -4,17 +4,17 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/DriverStation.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/LinearQuadraticRegulator.hpp" +#include "wpi/math/estimator/KalmanFilter.hpp" +#include "wpi/math/system/LinearSystemLoop.hpp" +#include "wpi/math/system/plant/DCMotor.hpp" +#include "wpi/math/system/plant/LinearSystemId.hpp" /** * This is a sample program to demonstrate how to use a state-space controller diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp index b0c4ed39d1..51a3d3560c 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp @@ -2,12 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" +#include "wpi/math/util/MathUtil.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp index 5b9ec7753a..aa978ea111 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp @@ -6,7 +6,7 @@ #include -#include +#include "wpi/math/geometry/Rotation2d.hpp" SwerveModule::SwerveModule(const int driveMotorChannel, const int turningMotorChannel, diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp index e68c64a668..b2f575bab7 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp @@ -6,12 +6,11 @@ #include -#include -#include -#include -#include - #include "SwerveModule.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/math/geometry/Translation2d.hpp" +#include "wpi/math/kinematics/SwerveDriveKinematics.hpp" +#include "wpi/math/kinematics/SwerveDriveOdometry.hpp" /** * Represents a swerve drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp index ee86b16214..931d3d0d56 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp @@ -6,17 +6,17 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/ProfiledPIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/kinematics/SwerveModulePosition.hpp" +#include "wpi/math/kinematics/SwerveModuleState.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" class SwerveModule { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Drivetrain.cpp index f1e0d00e6b..351d618b37 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Drivetrain.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Drivetrain.cpp @@ -4,9 +4,8 @@ #include "Drivetrain.hpp" -#include - #include "ExampleGlobalMeasurementSensor.hpp" +#include "wpi/system/Timer.hpp" void Drivetrain::Drive(wpi::units::meters_per_second_t xSpeed, wpi::units::meters_per_second_t ySpeed, diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Robot.cpp index bf5e5a5341..7695f7ac8b 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/Robot.cpp @@ -2,11 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include - #include "Drivetrain.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/math/filter/SlewRateLimiter.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp index e2d2808109..8fe6df8de2 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp @@ -6,7 +6,7 @@ #include -#include +#include "wpi/math/geometry/Rotation2d.hpp" SwerveModule::SwerveModule(const int driveMotorChannel, const int turningMotorChannel, diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp index 3cc3100082..3ee387fd37 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp @@ -6,13 +6,12 @@ #include -#include -#include -#include -#include -#include - #include "SwerveModule.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/math/estimator/SwerveDrivePoseEstimator.hpp" +#include "wpi/math/geometry/Translation2d.hpp" +#include "wpi/math/kinematics/SwerveDriveKinematics.hpp" +#include "wpi/math/kinematics/SwerveDriveOdometry.hpp" /** * Represents a swerve drive style drivetrain. diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp index cb2f85b4c7..6c34d126d3 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/math/geometry/Pose2d.hpp" +#include "wpi/math/util/StateSpaceUtil.hpp" /** * This dummy class represents a global measurement sensor, such as a computer diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp index 4c9581ced3..301e333afa 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp @@ -6,17 +6,17 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/ProfiledPIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/math/kinematics/SwerveModulePosition.hpp" +#include "wpi/math/kinematics/SwerveModuleState.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" class SwerveModule { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp index db88a5b2ce..82be3ea945 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp @@ -4,7 +4,7 @@ #include "Robot.hpp" -#include +#include "wpi/commands2/CommandScheduler.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp index 4295dd5ae9..5bc4abfaf1 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp @@ -4,7 +4,7 @@ #include "SysIdRoutineBot.hpp" -#include +#include "wpi/commands2/Commands.hpp" SysIdRoutineBot::SysIdRoutineBot() { ConfigureBindings(); diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Drive.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Drive.cpp index f371a4abf7..af710fce2f 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Drive.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Drive.cpp @@ -4,7 +4,7 @@ #include "subsystems/Drive.hpp" -#include +#include "wpi/commands2/Commands.hpp" Drive::Drive() { m_leftMotor.AddFollower(wpi::PWMSparkMax{constants::drive::kLeftMotor2Port}); diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Shooter.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Shooter.cpp index 26fd1df09a..b69cfbcc71 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Shooter.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Shooter.cpp @@ -4,9 +4,9 @@ #include "subsystems/Shooter.hpp" -#include -#include -#include +#include "wpi/commands2/Commands.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/voltage.hpp" Shooter::Shooter() { m_shooterEncoder.SetDistancePerPulse( diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp index dec709868d..7c94485f55 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp @@ -7,12 +7,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include "wpi/units/angle.hpp" +#include "wpi/units/angular_acceleration.hpp" +#include "wpi/units/angular_velocity.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/units/voltage.hpp" namespace constants { namespace drive { diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Robot.hpp index a98b7e5887..89d8bf5150 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Robot.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "SysIdRoutineBot.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/SysIdRoutineBot.hpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/SysIdRoutineBot.hpp index 1671736957..717ca732d8 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/SysIdRoutineBot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/SysIdRoutineBot.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include - #include "Constants.hpp" #include "subsystems/Drive.hpp" #include "subsystems/Shooter.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/button/CommandXboxController.hpp" class SysIdRoutineBot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Drive.hpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Drive.hpp index f4b7cbbf33..2a9e1494db 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Drive.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Drive.hpp @@ -6,14 +6,13 @@ #include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/commands2/sysid/SysIdRoutine.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/system/RobotController.hpp" class Drive : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Shooter.hpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Shooter.hpp index 1c2cc7d1be..d2f4f3f171 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Shooter.hpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Shooter.hpp @@ -6,15 +6,14 @@ #include -#include -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/commands2/sysid/SysIdRoutine.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/PIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/system/RobotController.hpp" class Shooter : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/TankDrive/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/TankDrive/cpp/Robot.cpp index 38b7d2e872..29a8a3d1e7 100644 --- a/wpilibcExamples/src/main/cpp/examples/TankDrive/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/TankDrive/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a demo program showing the use of the DifferentialDrive class. diff --git a/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp index 247f932e07..8587c1d7a6 100644 --- a/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/driverstation/XboxController.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" /** * This is a demo program showing the use of the DifferentialDrive class. diff --git a/wpilibcExamples/src/main/cpp/examples/UnitTest/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/UnitTest/include/Robot.hpp index a6fa4017f6..00091b1deb 100644 --- a/wpilibcExamples/src/main/cpp/examples/UnitTest/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/UnitTest/include/Robot.hpp @@ -4,11 +4,10 @@ #pragma once -#include -#include - #include "Constants.hpp" #include "subsystems/Intake.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/UnitTest/include/subsystems/Intake.hpp b/wpilibcExamples/src/main/cpp/examples/UnitTest/include/subsystems/Intake.hpp index 44a82c0fd0..74408412b6 100644 --- a/wpilibcExamples/src/main/cpp/examples/UnitTest/include/subsystems/Intake.hpp +++ b/wpilibcExamples/src/main/cpp/examples/UnitTest/include/subsystems/Intake.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "Constants.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" class Intake { public: diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp index b69e86743c..ac43e33927 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp @@ -4,7 +4,7 @@ #include "Robot.hpp" -#include +#include "wpi/commands2/CommandScheduler.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/RobotContainer.cpp index 54428959a6..5d4d20743b 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/RobotContainer.cpp @@ -4,11 +4,10 @@ #include "RobotContainer.hpp" -#include -#include -#include - #include "commands/TeleopArcadeDrive.hpp" +#include "wpi/commands2/Commands.hpp" +#include "wpi/commands2/button/JoystickButton.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" RobotContainer::RobotContainer() { // Configure the button bindings diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/DriveDistance.cpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/DriveDistance.cpp index 61d67e3d08..e2f74edb2f 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/DriveDistance.cpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/DriveDistance.cpp @@ -4,7 +4,7 @@ #include "commands/DriveDistance.hpp" -#include +#include "wpi/units/math.hpp" void DriveDistance::Initialize() { m_drive->ArcadeDrive(0, 0); diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/TurnDegrees.cpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/TurnDegrees.cpp index ffe5a9a98e..4461111772 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/TurnDegrees.cpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/commands/TurnDegrees.cpp @@ -6,7 +6,7 @@ #include -#include +#include "wpi/units/math.hpp" void TurnDegrees::Initialize() { // Set motors to stop, read encoder values for starting point diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/Robot.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/Robot.hpp index c3dae38a53..491f60b9ce 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/Robot.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/RobotContainer.hpp index 4592c1313b..a82f8a5d9e 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/RobotContainer.hpp @@ -4,18 +4,17 @@ #pragma once -#include -#include -#include -#include -#include -#include - #include "Constants.hpp" #include "commands/AutonomousDistance.hpp" #include "commands/AutonomousTime.hpp" #include "subsystems/Arm.hpp" #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/button/Trigger.hpp" +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" +#include "wpi/xrp/XRPOnBoardIO.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.hpp index 7cef535c02..7bdff20ee0 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include - #include "commands/DriveDistance.hpp" #include "commands/TurnDegrees.hpp" #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/SequentialCommandGroup.hpp" class AutonomousDistance : public wpi::cmd::CommandHelper -#include - #include "commands/DriveTime.hpp" #include "commands/TurnTime.hpp" #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/commands2/SequentialCommandGroup.hpp" class AutonomousTime : public wpi::cmd::CommandHelper -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/units/length.hpp" class DriveDistance : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.hpp index 3ab5ad2a8a..9c28f7319a 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveTime.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/system/Timer.hpp" +#include "wpi/units/time.hpp" class DriveTime : public wpi::cmd::CommandHelper { public: diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.hpp index e0e7ce6f22..83b111de94 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TeleopArcadeDrive.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" class TeleopArcadeDrive : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.hpp index c3745ca915..f8ad79819d 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" class TurnDegrees : public wpi::cmd::CommandHelper { diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.hpp index 3d8ac60f0d..17f076a7d2 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnTime.hpp @@ -4,12 +4,11 @@ #pragma once -#include -#include -#include -#include - #include "subsystems/Drivetrain.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" +#include "wpi/system/Timer.hpp" +#include "wpi/units/time.hpp" class TurnTime : public wpi::cmd::CommandHelper { public: diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Arm.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Arm.hpp index 6aa94b6e7c..ea33711440 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Arm.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Arm.hpp @@ -4,9 +4,9 @@ #pragma once -#include -#include -#include +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/xrp/XRPServo.hpp" class Arm : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.hpp index 32cad6090a..cb6e6cd5cc 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.hpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/subsystems/Drivetrain.hpp @@ -4,14 +4,14 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/commands2/SubsystemBase.hpp" +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/angle.hpp" +#include "wpi/units/length.hpp" +#include "wpi/xrp/XRPGyro.hpp" +#include "wpi/xrp/XRPMotor.hpp" class Drivetrain : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/snippets/ADXLAccelerometers/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/ADXLAccelerometers/cpp/Robot.cpp index d0c5846919..b77e91de58 100644 --- a/wpilibcExamples/src/main/cpp/snippets/ADXLAccelerometers/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/ADXLAccelerometers/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/accelerometer/ADXL345_I2C.hpp" +#include "wpi/hardware/bus/I2C.hpp" +#include "wpi/hardware/discrete/AnalogInput.hpp" /** * ADXL346, 362 Accelerometer snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/AccelerometerCollision/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AccelerometerCollision/cpp/Robot.cpp index b2efd41360..870408de1b 100644 --- a/wpilibcExamples/src/main/cpp/snippets/AccelerometerCollision/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/AccelerometerCollision/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/units/acceleration.hpp" /** * Collision detection snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp index 87b4c9fcf4..75f55ff712 100644 --- a/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp @@ -2,11 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/math/filter/LinearFilter.hpp" +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/units/acceleration.hpp" /** * Accelerometer filtering snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/AnalogAccelerometer/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AnalogAccelerometer/cpp/Robot.cpp index 86ca00375c..d3874dbd48 100644 --- a/wpilibcExamples/src/main/cpp/snippets/AnalogAccelerometer/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/AnalogAccelerometer/cpp/Robot.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/accelerometer/AnalogAccelerometer.hpp" +#include "wpi/hardware/discrete/AnalogInput.hpp" /** * AnalogAccelerometer snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/AnalogEncoder/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AnalogEncoder/cpp/Robot.cpp index 9200c95cfb..2bf4dd9efb 100644 --- a/wpilibcExamples/src/main/cpp/snippets/AnalogEncoder/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/AnalogEncoder/cpp/Robot.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/rotation/AnalogEncoder.hpp" /** * AnalogEncoder snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/AnalogInput/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AnalogInput/cpp/Robot.cpp index 60c6d10836..bef99a28e1 100644 --- a/wpilibcExamples/src/main/cpp/snippets/AnalogInput/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/AnalogInput/cpp/Robot.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/AnalogInput.hpp" /** * AnalogInput snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/AnalogPotentiometer/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AnalogPotentiometer/cpp/Robot.cpp index 993cae8475..6c967d8c4d 100644 --- a/wpilibcExamples/src/main/cpp/snippets/AnalogPotentiometer/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/AnalogPotentiometer/cpp/Robot.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/AnalogInput.hpp" +#include "wpi/hardware/rotation/AnalogPotentiometer.hpp" /** * AnalogPotentiometer snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/DigitalInput/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/DigitalInput/cpp/Robot.cpp index a8455a7c4a..249528a61b 100644 --- a/wpilibcExamples/src/main/cpp/snippets/DigitalInput/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/DigitalInput/cpp/Robot.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/DigitalInput.hpp" /** * Digital Input snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/DutyCycleEncoder/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/DutyCycleEncoder/cpp/Robot.cpp index 4c4ae48356..a702798ab3 100644 --- a/wpilibcExamples/src/main/cpp/snippets/DutyCycleEncoder/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/DutyCycleEncoder/cpp/Robot.cpp @@ -2,8 +2,8 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/rotation/DutyCycleEncoder.hpp" /** * DutyCycleEncoder snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/Encoder/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/Encoder/cpp/Robot.cpp index 95c82183a9..30568f5c35 100644 --- a/wpilibcExamples/src/main/cpp/snippets/Encoder/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/Encoder/cpp/Robot.cpp @@ -2,9 +2,9 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/util/deprecated.hpp" /** * Encoder snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/EncoderDrive/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/EncoderDrive/cpp/Robot.cpp index ec577037de..ce75037463 100644 --- a/wpilibcExamples/src/main/cpp/snippets/EncoderDrive/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/EncoderDrive/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/drive/DifferentialDrive.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/Spark.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" /** * Encoder drive to distance snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/EncoderHoming/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/EncoderHoming/cpp/Robot.cpp index a6cc986956..6cee4bb2f4 100644 --- a/wpilibcExamples/src/main/cpp/snippets/EncoderHoming/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/EncoderHoming/cpp/Robot.cpp @@ -2,10 +2,10 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/DigitalInput.hpp" +#include "wpi/hardware/motor/Spark.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" /** * Encoder mechanism homing snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/LimitSwitch/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/LimitSwitch/cpp/Robot.cpp index 3112580a23..1fb16fbadd 100644 --- a/wpilibcExamples/src/main/cpp/snippets/LimitSwitch/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/LimitSwitch/cpp/Robot.cpp @@ -2,11 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include +#include "wpi/driverstation/Joystick.hpp" +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/discrete/DigitalInput.hpp" +#include "wpi/hardware/motor/PWMVictorSPX.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" /** * Limit Switch snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/OnboardIMU/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/OnboardIMU/cpp/Robot.cpp index efcc03ee1b..291f9b43b1 100644 --- a/wpilibcExamples/src/main/cpp/snippets/OnboardIMU/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/OnboardIMU/cpp/Robot.cpp @@ -2,11 +2,11 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/imu/OnboardIMU.hpp" +#include "wpi/math/geometry/Rotation2d.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/angle.hpp" /** * Onboard IMU snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp index e2853b9278..5581062a88 100644 --- a/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp @@ -2,15 +2,15 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/hardware/motor/PWMSparkMax.hpp" +#include "wpi/hardware/rotation/Encoder.hpp" +#include "wpi/math/controller/ProfiledPIDController.hpp" +#include "wpi/math/controller/SimpleMotorFeedforward.hpp" +#include "wpi/units/acceleration.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/velocity.hpp" +#include "wpi/units/voltage.hpp" /** * wpi::math::ProfiledPIDController with feedforward snippets for frc-docs. diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp index 67fd6b66c4..044ead3a30 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp @@ -4,7 +4,7 @@ #include "Robot.hpp" -#include +#include "wpi/commands2/CommandScheduler.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/RobotContainer.cpp index c3e14f2554..9500eb4848 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/RobotContainer.cpp @@ -4,10 +4,9 @@ #include "RobotContainer.hpp" -#include - #include "commands/Autos.hpp" #include "commands/ExampleCommand.hpp" +#include "wpi/commands2/button/Trigger.hpp" RobotContainer::RobotContainer() { // Initialize all of your commands and subsystems here diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/commands/Autos.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/commands/Autos.cpp index 9c798e704d..a3c32215c3 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/commands/Autos.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/commands/Autos.cpp @@ -4,9 +4,8 @@ #include "commands/Autos.hpp" -#include - #include "commands/ExampleCommand.hpp" +#include "wpi/commands2/Commands.hpp" wpi::cmd::CommandPtr autos::ExampleAuto(ExampleSubsystem* subsystem) { return wpi::cmd::cmd::Sequence(subsystem->ExampleMethodCommand(), diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.hpp index 42eab89a12..b50f260d36 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/include/Robot.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/templates/commandbased/include/RobotContainer.hpp index 0b743339a6..d066714148 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/include/RobotContainer.hpp @@ -4,11 +4,10 @@ #pragma once -#include -#include - #include "Constants.hpp" #include "subsystems/ExampleSubsystem.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/button/CommandXboxController.hpp" /** * This class is where the bulk of the robot should be declared. Since diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/Autos.hpp b/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/Autos.hpp index f6a1b1f86d..735acbca9b 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/Autos.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/Autos.hpp @@ -4,9 +4,8 @@ #pragma once -#include - #include "subsystems/ExampleSubsystem.hpp" +#include "wpi/commands2/CommandPtr.hpp" namespace autos { /** diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/ExampleCommand.hpp b/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/ExampleCommand.hpp index 3acf4b5b7f..049e7591dc 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/ExampleCommand.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/include/commands/ExampleCommand.hpp @@ -4,10 +4,9 @@ #pragma once -#include -#include - #include "subsystems/ExampleSubsystem.hpp" +#include "wpi/commands2/Command.hpp" +#include "wpi/commands2/CommandHelper.hpp" /** * An example command that uses an example subsystem. diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/include/subsystems/ExampleSubsystem.hpp b/wpilibcExamples/src/main/cpp/templates/commandbased/include/subsystems/ExampleSubsystem.hpp index 1f57e8909d..0149abecef 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/include/subsystems/ExampleSubsystem.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/include/subsystems/ExampleSubsystem.hpp @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/commands2/SubsystemBase.hpp" class ExampleSubsystem : public wpi::cmd::SubsystemBase { public: diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp index db88a5b2ce..82be3ea945 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp @@ -4,7 +4,7 @@ #include "Robot.hpp" -#include +#include "wpi/commands2/CommandScheduler.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/RobotContainer.cpp index 2bee9a8925..f880768f3e 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/RobotContainer.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/RobotContainer.cpp @@ -4,7 +4,7 @@ #include "RobotContainer.hpp" -#include +#include "wpi/commands2/Commands.hpp" RobotContainer::RobotContainer() { ConfigureBindings(); diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/Robot.hpp index 2fe8c786cb..ec88e140da 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/Robot.hpp @@ -6,10 +6,9 @@ #include -#include -#include - #include "RobotContainer.hpp" +#include "wpi/commands2/CommandPtr.hpp" +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/RobotContainer.hpp index 712cf43ea4..1b205288cb 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/RobotContainer.hpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/include/RobotContainer.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include "wpi/commands2/CommandPtr.hpp" class RobotContainer { public: diff --git a/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/cpp/Robot.cpp index d4b1d79a3c..595a39b59a 100644 --- a/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/cpp/Robot.cpp @@ -4,10 +4,10 @@ #include "Robot.hpp" -#include -#include -#include -#include +#include "wpi/driverstation/DriverStation.hpp" +#include "wpi/hal/DriverStation.h" +#include "wpi/internal/DriverStationModeThread.hpp" +#include "wpi/nt/NetworkTable.hpp" Robot::Robot() {} diff --git a/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/include/Robot.hpp index b8138e8716..a4399e3aec 100644 --- a/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/robotbaseskeleton/include/Robot.hpp @@ -6,7 +6,7 @@ #include -#include +#include "wpi/framework/RobotBase.hpp" class Robot : public wpi::RobotBase { public: diff --git a/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp index 54270d8a5a..3d3fb611d9 100644 --- a/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/timed/cpp/Robot.cpp @@ -4,8 +4,8 @@ #include "Robot.hpp" -#include -#include +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/util/print.hpp" Robot::Robot() { m_chooser.SetDefaultOption(kAutoNameDefault, kAutoNameDefault); diff --git a/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.hpp index 785eb2845d..8b03088c80 100644 --- a/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/timed/include/Robot.hpp @@ -6,8 +6,8 @@ #include -#include -#include +#include "wpi/framework/TimedRobot.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/templates/timedskeleton/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/timedskeleton/include/Robot.hpp index 9eb9c8445d..92ce08434d 100644 --- a/wpilibcExamples/src/main/cpp/templates/timedskeleton/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/timedskeleton/include/Robot.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include "wpi/framework/TimedRobot.hpp" class Robot : public wpi::TimedRobot { public: diff --git a/wpilibcExamples/src/main/cpp/templates/timeslice/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/timeslice/cpp/Robot.cpp index f63bb06fcf..5c4f300f80 100644 --- a/wpilibcExamples/src/main/cpp/templates/timeslice/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/timeslice/cpp/Robot.cpp @@ -4,8 +4,8 @@ #include "Robot.hpp" -#include -#include +#include "wpi/smartdashboard/SmartDashboard.hpp" +#include "wpi/util/print.hpp" // Run robot periodic() functions for 5 ms, and run controllers every 10 ms Robot::Robot() : wpi::TimesliceRobot{5_ms, 10_ms} { diff --git a/wpilibcExamples/src/main/cpp/templates/timeslice/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/timeslice/include/Robot.hpp index 19a5dc63fb..35cb7ebd47 100644 --- a/wpilibcExamples/src/main/cpp/templates/timeslice/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/timeslice/include/Robot.hpp @@ -6,8 +6,8 @@ #include -#include -#include +#include "wpi/framework/TimesliceRobot.hpp" +#include "wpi/smartdashboard/SendableChooser.hpp" class Robot : public wpi::TimesliceRobot { public: diff --git a/wpilibcExamples/src/main/cpp/templates/timesliceskeleton/include/Robot.hpp b/wpilibcExamples/src/main/cpp/templates/timesliceskeleton/include/Robot.hpp index cb86e608c9..70ff2f93c2 100644 --- a/wpilibcExamples/src/main/cpp/templates/timesliceskeleton/include/Robot.hpp +++ b/wpilibcExamples/src/main/cpp/templates/timesliceskeleton/include/Robot.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include "wpi/framework/TimesliceRobot.hpp" class Robot : public wpi::TimesliceRobot { public: diff --git a/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/ArmSimulationTest.cpp b/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/ArmSimulationTest.cpp index 81fef9c41d..c91804658b 100644 --- a/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/ArmSimulationTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/ArmSimulationTest.cpp @@ -6,17 +6,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include "Constants.hpp" #include "Robot.hpp" +#include "wpi/hal/simulation/MockHooks.h" +#include "wpi/simulation/DriverStationSim.hpp" +#include "wpi/simulation/JoystickSim.hpp" +#include "wpi/simulation/PWMMotorControllerSim.hpp" +#include "wpi/simulation/SimHooks.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/time.hpp" +#include "wpi/util/Preferences.hpp" class ArmSimulationTest : public testing::TestWithParam { Robot m_robot; diff --git a/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/main.cpp b/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/main.cpp index d0ebd73dad..0413b855da 100644 --- a/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/main.cpp +++ b/wpilibcExamples/src/test/cpp/examples/ArmSimulation/cpp/main.cpp @@ -3,7 +3,8 @@ // the WPILib BSD license file in the root directory of this project. #include -#include + +#include "wpi/hal/HALBase.h" /** * Runs all unit tests. diff --git a/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/DigitalCommunicationTest.cpp b/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/DigitalCommunicationTest.cpp index 248d3693a4..03d891c82c 100644 --- a/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/DigitalCommunicationTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/DigitalCommunicationTest.cpp @@ -6,12 +6,12 @@ #include #include -#include -#include -#include -#include #include "Robot.hpp" +#include "wpi/simulation/DIOSim.hpp" +#include "wpi/simulation/DriverStationSim.hpp" +#include "wpi/simulation/SimHooks.hpp" +#include "wpi/units/time.hpp" template class DigitalCommunicationTest : public testing::TestWithParam { diff --git a/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/main.cpp b/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/main.cpp index d0ebd73dad..0413b855da 100644 --- a/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/main.cpp +++ b/wpilibcExamples/src/test/cpp/examples/DigitalCommunication/cpp/main.cpp @@ -3,7 +3,8 @@ // the WPILib BSD license file in the root directory of this project. #include -#include + +#include "wpi/hal/HALBase.h" /** * Runs all unit tests. diff --git a/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/ElevatorSimulationTest.cpp b/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/ElevatorSimulationTest.cpp index 04cfccb64e..a9bf78b100 100644 --- a/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/ElevatorSimulationTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/ElevatorSimulationTest.cpp @@ -6,17 +6,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include #include "Constants.hpp" #include "Robot.hpp" +#include "wpi/hal/simulation/MockHooks.h" +#include "wpi/simulation/DriverStationSim.hpp" +#include "wpi/simulation/JoystickSim.hpp" +#include "wpi/simulation/PWMMotorControllerSim.hpp" +#include "wpi/simulation/SimHooks.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/mass.hpp" +#include "wpi/units/time.hpp" using namespace Constants; diff --git a/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/main.cpp b/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/main.cpp index d0ebd73dad..0413b855da 100644 --- a/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/main.cpp +++ b/wpilibcExamples/src/test/cpp/examples/ElevatorSimulation/cpp/main.cpp @@ -3,7 +3,8 @@ // the WPILib BSD license file in the root directory of this project. #include -#include + +#include "wpi/hal/HALBase.h" /** * Runs all unit tests. diff --git a/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/I2CCommunicationTest.cpp b/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/I2CCommunicationTest.cpp index 27dfaf2972..0a06f47e24 100644 --- a/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/I2CCommunicationTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/I2CCommunicationTest.cpp @@ -6,12 +6,12 @@ #include #include -#include -#include -#include -#include #include "Robot.hpp" +#include "wpi/hal/simulation/I2CData.h" +#include "wpi/simulation/DriverStationSim.hpp" +#include "wpi/simulation/SimHooks.hpp" +#include "wpi/units/time.hpp" static std::string gString; diff --git a/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/main.cpp b/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/main.cpp index d0ebd73dad..0413b855da 100644 --- a/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/main.cpp +++ b/wpilibcExamples/src/test/cpp/examples/I2CCommunication/cpp/main.cpp @@ -3,7 +3,8 @@ // the WPILib BSD license file in the root directory of this project. #include -#include + +#include "wpi/hal/HALBase.h" /** * Runs all unit tests. diff --git a/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/PotentiometerPIDTest.cpp b/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/PotentiometerPIDTest.cpp index fbdb2330c2..10d802a69c 100644 --- a/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/PotentiometerPIDTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/PotentiometerPIDTest.cpp @@ -6,20 +6,20 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "Robot.hpp" +#include "wpi/hal/simulation/MockHooks.h" +#include "wpi/math/system/plant/DCMotor.hpp" +#include "wpi/simulation/AnalogInputSim.hpp" +#include "wpi/simulation/DriverStationSim.hpp" +#include "wpi/simulation/ElevatorSim.hpp" +#include "wpi/simulation/JoystickSim.hpp" +#include "wpi/simulation/PWMMotorControllerSim.hpp" +#include "wpi/simulation/SimHooks.hpp" +#include "wpi/system/RobotController.hpp" +#include "wpi/units/length.hpp" +#include "wpi/units/mass.hpp" +#include "wpi/units/time.hpp" class PotentiometerPIDTest : public testing::Test { wpi::math::DCMotor m_elevatorGearbox = wpi::math::DCMotor::Vex775Pro(4); diff --git a/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/main.cpp b/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/main.cpp index d0ebd73dad..0413b855da 100644 --- a/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/main.cpp +++ b/wpilibcExamples/src/test/cpp/examples/PotentiometerPID/cpp/main.cpp @@ -3,7 +3,8 @@ // the WPILib BSD license file in the root directory of this project. #include -#include + +#include "wpi/hal/HALBase.h" /** * Runs all unit tests. diff --git a/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/main.cpp b/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/main.cpp index d0ebd73dad..0413b855da 100644 --- a/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/main.cpp +++ b/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/main.cpp @@ -3,7 +3,8 @@ // the WPILib BSD license file in the root directory of this project. #include -#include + +#include "wpi/hal/HALBase.h" /** * Runs all unit tests. diff --git a/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp b/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp index 73ba07468d..cb92d5ecfa 100644 --- a/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp +++ b/wpilibcExamples/src/test/cpp/examples/UnitTest/cpp/subsystems/IntakeTest.cpp @@ -3,12 +3,12 @@ // the WPILib BSD license file in the root directory of this project. #include -#include -#include -#include #include "Constants.hpp" #include "subsystems/Intake.hpp" +#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp" +#include "wpi/simulation/DoubleSolenoidSim.hpp" +#include "wpi/simulation/PWMMotorControllerSim.hpp" class IntakeTest : public testing::Test { protected: