SCRIPT: wpiformat

This commit is contained in:
PJ Reiniger
2025-11-07 19:57:55 -05:00
committed by Peter Johnson
parent c48b722dac
commit 1e7604f81c
1218 changed files with 2709 additions and 3267 deletions

View File

@@ -7,9 +7,9 @@
#include <array>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/led/AddressableLED.hpp"
namespace frc::sim {

View File

@@ -5,12 +5,12 @@
#include <numbers>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/units/math.hpp"
#include "wpi/hardware/rotation/AnalogEncoder.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/AnalogInput.hpp"
#include "wpi/hardware/rotation/AnalogEncoder.hpp"
#include "wpi/simulation/AnalogEncoderSim.hpp"
#include "wpi/units/math.hpp"
#define EXPECT_NEAR_UNITS(val1, val2, eps) \
EXPECT_LE(units::math::abs(val1 - val2), eps)

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/AnalogInputSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/AnalogInput.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/CTREPCMSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"

View File

@@ -4,15 +4,15 @@
#include <gtest/gtest.h>
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/DCMotorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/system/RobotController.hpp"
TEST(DCMotorSimTest, VoltageSteadyState) {
frc::DCMotor gearbox = frc::DCMotor::NEO(1);

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DIOSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/DigitalInput.hpp"
#include "wpi/hardware/discrete/DigitalOutput.hpp"

View File

@@ -3,19 +3,19 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/units/current.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/moment_of_inertia.hpp"
#include "wpi/math/controller/LTVUnicycleController.hpp"
#include "wpi/math/controller/LinearPlantInversionFeedforward.hpp"
#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/math/system/NumericalIntegration.hpp"
#include "wpi/math/system/plant/DCMotor.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/math/trajectory/TrajectoryGenerator.hpp"
#include "wpi/math/trajectory/constraint/DifferentialDriveKinematicsConstraint.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/units/current.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/moment_of_inertia.hpp"
TEST(DifferentialDrivetrainSimTest, Convergence) {
auto motor = frc::DCMotor::NEO(2);

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DigitalPWMSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/DigitalOutput.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DutyCycleEncoderSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/rotation/DutyCycleEncoder.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/DutyCycleSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/DigitalInput.hpp"
#include "wpi/hardware/rotation/DutyCycle.hpp"

View File

@@ -3,18 +3,18 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/units/math.hpp"
#include "wpi/units/time.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/system/NumericalIntegration.hpp"
#include "wpi/math/system/plant/DCMotor.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/units/math.hpp"
#include "wpi/units/time.hpp"
#define EXPECT_NEAR_UNITS(val1, val2, eps) \
EXPECT_LE(units::math::abs(val1 - val2), eps)

View File

@@ -5,11 +5,11 @@
#include "wpi/simulation/EncoderSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/util/deprecated.hpp"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/util/deprecated.hpp"
namespace frc::sim {

View File

@@ -7,9 +7,9 @@
#include <vector>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/power/PowerDistribution.hpp"
namespace frc::sim {

View File

@@ -5,8 +5,8 @@
#include "wpi/simulation/PWMMotorControllerSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/motor/Spark.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/PWMSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/discrete/PWM.hpp"
namespace frc::sim {

View File

@@ -5,9 +5,9 @@
#include "wpi/simulation/REVPHSim.hpp" // NOLINT(build/include_order)
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticHub.hpp"

View File

@@ -7,10 +7,10 @@
#include <string>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HALBase.h"
#include "callback_helpers/TestCallbackHelpers.hpp"
#include "wpi/hal/HAL.h"
#include "wpi/hal/HALBase.h"
#include "wpi/system/RobotController.hpp"
namespace frc::sim {

View File

@@ -5,8 +5,8 @@
#include <string_view>
#include <gtest/gtest.h>
#include "wpi/hal/SimDevice.h"
#include "wpi/hal/SimDevice.h"
#include "wpi/simulation/SimDeviceSim.hpp"
using namespace frc::sim;

View File

@@ -5,8 +5,8 @@
#include <exception>
#include <gtest/gtest.h>
#include "wpi/hal/HAL.h"
#include "wpi/hal/HAL.h"
#include "wpi/simulation/AddressableLEDSim.hpp"
#include "wpi/simulation/AnalogInputSim.hpp"
#include "wpi/simulation/CTREPCMSim.hpp"

View File

@@ -3,14 +3,12 @@
// the WPILib BSD license file in the root directory of this project.
#include <gtest/gtest.h>
#include "wpi/units/angular_acceleration.hpp"
#include "wpi/units/angular_velocity.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/hardware/motor/PWMVictorSPX.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
@@ -19,7 +17,9 @@
#include "wpi/simulation/LinearSystemSim.hpp"
#include "wpi/simulation/PWMSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/units/angular_acceleration.hpp"
#include "wpi/units/angular_velocity.hpp"
TEST(StateSpaceSimTest, FlywheelSim) {
const frc::LinearSystem<1, 1, 1> plant =