From 2109161534fdce08ae845452b746afaa38cf8fd6 Mon Sep 17 00:00:00 2001 From: PJ Reiniger Date: Fri, 7 Nov 2025 20:01:58 -0500 Subject: [PATCH] SCRIPT: wpiformat --- .../main/native/cpp/AprilTagFieldLayout.cpp | 29 ++- .../main/native/cpp/AprilTagPoseEstimator.cpp | 9 +- .../src/main/native/cpp/jni/AprilTagJNI.cpp | 9 +- .../wpi/apriltag/AprilTagFieldLayout.hpp | 11 +- .../wpi/apriltag/AprilTagPoseEstimator.hpp | 8 +- .../src/test/native/cpp/AprilTagJsonTest.cpp | 7 +- .../native/cpp/AprilTagPoseSetOriginTest.cpp | 15 +- .../src/test/native/cpp/LoadConfigTest.cpp | 9 +- .../src/main/native/cpp/main.cpp | 32 +-- .../native/cpp/frc2/command/CommandPtr.cpp | 6 +- .../cpp/frc2/command/CommandScheduler.cpp | 17 +- .../main/native/cpp/frc2/command/Commands.cpp | 3 +- .../cpp/frc2/command/DeferredCommand.cpp | 5 +- .../cpp/frc2/command/ParallelCommandGroup.cpp | 8 +- .../frc2/command/ParallelDeadlineGroup.cpp | 8 +- .../cpp/frc2/command/ParallelRaceGroup.cpp | 8 +- .../native/cpp/frc2/command/PrintCommand.cpp | 5 +- .../frc2/command/SequentialCommandGroup.cpp | 4 +- .../cpp/frc2/command/button/NetworkButton.cpp | 10 +- .../native/include/wpi/commands2/Command.hpp | 3 +- .../wpi/commands2/CommandScheduler.hpp | 7 +- .../wpi/commands2/sysid/SysIdRoutine.hpp | 4 +- .../cpp/wpi/command/AddRequirementsTest.cpp | 13 +- .../native/cpp/wpi/command/SchedulerTest.cpp | 5 +- .../wpi/command/button/NetworkButtonTest.cpp | 4 +- .../wpi/command/sysid/SysIdRoutineTest.cpp | 7 +- cscore/examples/enum_usb/enum_usb.cpp | 10 +- cscore/examples/httpcvstream/httpcvstream.cpp | 7 +- cscore/examples/settings/settings.cpp | 6 +- cscore/examples/usbcvstream/usbcvstream.cpp | 7 +- cscore/examples/usbstream/usbstream.cpp | 2 +- .../native/cpp/ConfigurableSourceImpl.cpp | 13 +- cscore/src/main/native/cpp/Frame.cpp | 6 +- cscore/src/main/native/cpp/Frame.hpp | 6 +- cscore/src/main/native/cpp/HttpCameraImpl.cpp | 21 +- cscore/src/main/native/cpp/HttpCameraImpl.hpp | 7 +- cscore/src/main/native/cpp/Instance.cpp | 4 +- cscore/src/main/native/cpp/Instance.hpp | 7 +- cscore/src/main/native/cpp/JpegUtil.cpp | 3 +- cscore/src/main/native/cpp/JpegUtil.hpp | 5 +- cscore/src/main/native/cpp/Log.cpp | 7 +- cscore/src/main/native/cpp/Log.hpp | 6 +- .../src/main/native/cpp/MjpegServerImpl.cpp | 91 ++++---- cscore/src/main/native/cpp/Notifier.hpp | 3 +- .../src/main/native/cpp/PropertyContainer.cpp | 6 +- .../src/main/native/cpp/PropertyContainer.hpp | 7 +- cscore/src/main/native/cpp/RawSinkImpl.cpp | 4 +- cscore/src/main/native/cpp/RawSinkImpl.hpp | 8 +- cscore/src/main/native/cpp/RawSourceImpl.cpp | 3 +- cscore/src/main/native/cpp/RawSourceImpl.hpp | 5 +- cscore/src/main/native/cpp/SinkImpl.cpp | 9 +- cscore/src/main/native/cpp/SourceImpl.cpp | 8 +- cscore/src/main/native/cpp/SourceImpl.hpp | 4 +- .../main/native/cpp/UsbCameraImplCommon.cpp | 5 +- cscore/src/main/native/cpp/cscore_c.cpp | 42 ++-- cscore/src/main/native/cpp/cscore_cpp.cpp | 16 +- .../main/native/cpp/jni/CameraServerJNI.cpp | 58 +++-- .../main/native/include/wpi/cs/cscore_cpp.hpp | 19 +- .../main/native/include/wpi/cs/cscore_cv.hpp | 20 +- .../main/native/include/wpi/cs/cscore_oo.hpp | 6 +- .../main/native/include/wpi/cs/cscore_raw.h | 15 +- .../src/main/native/linux/RunLoopHelpers.cpp | 3 +- .../src/main/native/linux/UsbCameraImpl.cpp | 31 ++- .../src/main/native/linux/UsbCameraImpl.hpp | 5 +- .../main/native/linux/UsbCameraListener.cpp | 34 +-- .../main/native/linux/UsbCameraProperty.cpp | 7 +- .../src/main/native/osx/NetworkListener.cpp | 3 +- .../src/main/native/windows/COMCreators.cpp | 3 +- .../src/main/native/windows/COMCreators.hpp | 7 +- .../main/native/windows/RunLoopHelpers.cpp | 3 +- .../src/main/native/windows/UsbCameraImpl.hpp | 9 +- .../main/native/windows/UsbCameraListener.cpp | 3 +- .../main/native/windows/UsbCameraProperty.hpp | 11 +- datalog/examples/printlog/printlog.cpp | 22 +- datalog/examples/writelog/writelog.cpp | 4 +- datalog/src/main/native/cpp/DataLog.cpp | 6 +- .../native/cpp/DataLogBackgroundWriter.cpp | 4 +- datalog/src/main/native/cpp/DataLogReader.cpp | 14 +- .../main/native/cpp/DataLogReaderThread.cpp | 7 +- datalog/src/main/native/cpp/DataLogWriter.cpp | 14 +- datalog/src/main/native/cpp/FileLogger.cpp | 4 +- .../native/include/wpi/datalog/DataLog.hpp | 12 +- .../wpi/datalog/DataLogBackgroundWriter.hpp | 2 +- .../wpi/datalog/DataLogReaderThread.hpp | 4 +- .../include/wpi/datalog/DataLogWriter.hpp | 5 +- datalog/src/test/native/cpp/DataLogTest.cpp | 4 +- glass/src/app/native/cpp/main.cpp | 25 +- glass/src/lib/native/cpp/Context.cpp | 18 +- glass/src/lib/native/cpp/DataSource.cpp | 3 +- glass/src/lib/native/cpp/Storage.cpp | 3 +- .../lib/native/cpp/hardware/AnalogInput.cpp | 5 +- glass/src/lib/native/cpp/hardware/DIO.cpp | 2 +- glass/src/lib/native/cpp/hardware/Encoder.cpp | 11 +- glass/src/lib/native/cpp/hardware/PWM.cpp | 5 +- .../src/lib/native/cpp/hardware/Pneumatic.cpp | 17 +- .../native/cpp/hardware/PowerDistribution.cpp | 8 +- glass/src/lib/native/cpp/other/DeviceTree.cpp | 12 +- glass/src/lib/native/cpp/other/Field2D.cpp | 51 ++-- .../src/lib/native/cpp/other/Mechanism2D.cpp | 19 +- glass/src/lib/native/cpp/other/Plot.cpp | 17 +- .../native/cpp/support/ExpressionParser.cpp | 7 +- .../lib/native/cpp/support/NameSetting.cpp | 24 +- .../native/include/wpi/glass/DataSource.hpp | 3 +- .../lib/native/include/wpi/glass/Storage.hpp | 6 +- .../src/lib/native/include/wpi/glass/View.hpp | 3 +- .../include/wpi/glass/WindowManager.hpp | 3 +- .../wpi/glass/hardware/AnalogInput.hpp | 3 +- .../include/wpi/glass/hardware/LEDDisplay.hpp | 8 +- .../native/include/wpi/glass/other/FMS.hpp | 2 +- .../include/wpi/glass/other/Field2D.hpp | 3 +- .../wpi/glass/support/ExpressionParser.hpp | 9 +- .../libnt/native/cpp/NTCommandScheduler.cpp | 7 +- .../libnt/native/cpp/NTCommandSelector.cpp | 7 +- .../libnt/native/cpp/NTDifferentialDrive.cpp | 3 +- glass/src/libnt/native/cpp/NTFMS.cpp | 3 +- glass/src/libnt/native/cpp/NTField2D.cpp | 12 +- glass/src/libnt/native/cpp/NTGyro.cpp | 3 +- glass/src/libnt/native/cpp/NTMechanism2D.cpp | 12 +- .../libnt/native/cpp/NTMotorController.cpp | 7 +- .../src/libnt/native/cpp/NTStringChooser.cpp | 6 +- glass/src/libnt/native/cpp/NetworkTables.cpp | 98 ++++---- .../native/cpp/NetworkTablesProvider.cpp | 12 +- .../native/cpp/NetworkTablesSettings.cpp | 2 +- .../native/cpp/StandardNetworkTables.cpp | 3 +- .../networktables/NTCommandScheduler.hpp | 3 +- .../glass/networktables/NTCommandSelector.hpp | 3 +- .../glass/networktables/NTDigitalInput.hpp | 3 +- .../glass/networktables/NTDigitalOutput.hpp | 3 +- .../wpi/glass/networktables/NTField2D.hpp | 6 +- .../glass/networktables/NTMecanumDrive.hpp | 3 +- .../wpi/glass/networktables/NTMechanism2D.hpp | 8 +- .../glass/networktables/NTMotorController.hpp | 3 +- .../glass/networktables/NTPIDController.hpp | 3 +- .../glass/networktables/NTStringChooser.hpp | 3 +- .../wpi/glass/networktables/NetworkTables.hpp | 4 +- .../networktables/NetworkTablesProvider.hpp | 3 +- .../networktables/NetworkTablesSettings.hpp | 2 +- hal/src/main/native/cpp/ErrorHandling.cpp | 10 +- .../jni/simulation/BufferCallbackStore.cpp | 11 +- .../cpp/jni/simulation/CallbackStore.cpp | 8 +- .../simulation/ConstBufferCallbackStore.cpp | 11 +- .../jni/simulation/DriverStationDataJNI.cpp | 5 +- .../cpp/jni/simulation/SimDeviceDataJNI.cpp | 20 +- .../native/cpp/proto/ControlDataProto.cpp | 6 +- .../main/native/cpp/proto/ErrorInfoProto.cpp | 2 +- .../main/native/cpp/proto/MatchInfoProto.cpp | 2 +- hal/src/main/native/cpp/proto/OpModeProto.cpp | 2 +- .../handles/IndexedClassedHandleResource.h | 3 +- .../wpi/hal/simulation/SimCallbackRegistry.h | 3 +- hal/src/main/native/sim/AddressableLED.cpp | 11 +- hal/src/main/native/sim/AnalogInput.cpp | 13 +- hal/src/main/native/sim/AnalogInternal.cpp | 5 +- hal/src/main/native/sim/CTREPCM.cpp | 7 +- hal/src/main/native/sim/DIO.cpp | 6 +- hal/src/main/native/sim/DutyCycle.cpp | 6 +- hal/src/main/native/sim/Extensions.cpp | 7 +- hal/src/main/native/sim/Notifier.cpp | 4 +- hal/src/main/native/sim/PWM.cpp | 6 +- hal/src/main/native/sim/PowerDistribution.cpp | 9 +- hal/src/main/native/sim/REVPH.cpp | 8 +- .../native/sim/mockdata/DriverStationData.cpp | 3 +- .../sim/mockdata/SimDeviceDataInternal.h | 3 +- .../main/native/systemcore/AddressableLED.cpp | 6 +- .../main/native/systemcore/AnalogInput.cpp | 8 +- hal/src/main/native/systemcore/CAN.cpp | 27 ++- hal/src/main/native/systemcore/CTREPCM.cpp | 7 +- hal/src/main/native/systemcore/CTREPDP.cpp | 14 +- hal/src/main/native/systemcore/Counter.cpp | 10 +- hal/src/main/native/systemcore/DIO.cpp | 6 +- hal/src/main/native/systemcore/DutyCycle.cpp | 10 +- hal/src/main/native/systemcore/I2C.cpp | 26 ++- hal/src/main/native/systemcore/PWM.cpp | 6 +- hal/src/main/native/systemcore/REVPDH.cpp | 10 +- hal/src/main/native/systemcore/REVPH.cpp | 12 +- .../main/native/systemcore/UsageReporting.cpp | 3 +- .../test/native/cpp/handles/HandleTest.cpp | 2 +- .../cpp/mockdata/DriverStationDataTest.cpp | 8 +- ntcore/src/dev/native/cpp/main.cpp | 50 ++-- ntcore/src/main/native/cpp/LocalStorage.hpp | 15 +- ntcore/src/main/native/cpp/LoggerImpl.cpp | 27 ++- ntcore/src/main/native/cpp/NetworkClient.hpp | 2 +- ntcore/src/main/native/cpp/NetworkServer.cpp | 5 +- ntcore/src/main/native/cpp/NetworkServer.hpp | 2 +- ntcore/src/main/native/cpp/Value.cpp | 11 +- .../main/native/cpp/jni/NetworkTablesJNI.cpp | 45 ++-- .../main/native/cpp/local/LocalDataLogger.cpp | 7 +- .../native/cpp/local/LocalStorageImpl.cpp | 15 +- .../native/cpp/local/LocalStorageImpl.hpp | 11 +- .../src/main/native/cpp/local/LocalTopic.cpp | 2 +- .../src/main/native/cpp/local/LocalTopic.hpp | 3 +- ntcore/src/main/native/cpp/net/ClientImpl.cpp | 9 +- ntcore/src/main/native/cpp/net/ClientImpl.hpp | 12 +- .../native/cpp/net/ClientMessageQueue.hpp | 8 +- .../main/native/cpp/net/MessageHandler.hpp | 3 +- .../native/cpp/net/WebSocketConnection.cpp | 9 +- .../native/cpp/net/WebSocketConnection.hpp | 17 +- .../main/native/cpp/net/WireConnection.hpp | 2 +- .../src/main/native/cpp/net/WireDecoder.cpp | 46 ++-- .../src/main/native/cpp/net/WireDecoder.hpp | 2 +- .../src/main/native/cpp/net/WireEncoder.cpp | 62 ++--- .../src/main/native/cpp/net/WireEncoder.hpp | 15 +- .../native/cpp/networktables/NetworkTable.cpp | 9 +- .../networktables/NetworkTableInstance.cpp | 16 +- .../main/native/cpp/networktables/Topic.cpp | 6 +- ntcore/src/main/native/cpp/ntcore_c.cpp | 47 ++-- ntcore/src/main/native/cpp/ntcore_meta.cpp | 12 +- ntcore/src/main/native/cpp/ntcore_test.cpp | 4 +- .../native/cpp/server/MessagePackWriter.hpp | 8 +- .../main/native/cpp/server/ServerClient.hpp | 5 +- .../main/native/cpp/server/ServerClient4.cpp | 3 +- .../native/cpp/server/ServerClient4Base.hpp | 3 +- .../src/main/native/cpp/server/ServerImpl.hpp | 2 +- .../main/native/cpp/server/ServerStorage.cpp | 4 +- .../main/native/cpp/server/ServerStorage.hpp | 5 +- .../main/native/cpp/server/ServerTopic.hpp | 2 +- .../native/include/wpi/nt/MultiSubscriber.hpp | 4 +- .../include/wpi/nt/NetworkTableInstance.hpp | 6 +- .../include/wpi/nt/NetworkTableListener.hpp | 24 +- .../native/include/wpi/nt/ProtobufTopic.hpp | 17 +- .../native/include/wpi/nt/StructTopic.hpp | 33 +-- .../main/native/include/wpi/nt/UnitTopic.hpp | 18 +- .../main/native/include/wpi/nt/ntcore_cpp.hpp | 2 +- .../native/cpp/ConnectionListenerTest.cpp | 20 +- .../src/test/native/cpp/LocalStorageTest.cpp | 100 ++++---- ntcore/src/test/native/cpp/LoggerTest.cpp | 13 +- .../src/test/native/cpp/NetworkTableTest.cpp | 12 +- ntcore/src/test/native/cpp/StructTest.cpp | 13 +- .../src/test/native/cpp/TableListenerTest.cpp | 13 +- .../src/test/native/cpp/TopicListenerTest.cpp | 64 ++--- .../src/test/native/cpp/ValueListenerTest.cpp | 58 +++-- ntcore/src/test/native/cpp/main.cpp | 13 +- .../native/cpp/net/MockMessageHandler.hpp | 6 +- .../native/cpp/net/MockWireConnection.hpp | 14 +- .../test/native/cpp/net/WireDecoderTest.cpp | 14 +- .../test/native/cpp/net/WireEncoderTest.cpp | 33 +-- .../test/native/cpp/server/ServerImplTest.cpp | 61 ++--- .../src/main/native/cpp/DataLogManager.cpp | 27 +-- .../src/main/native/cpp/main.cpp | 4 +- .../src/main/native/cpp/AddressableLEDGui.cpp | 13 +- .../src/main/native/cpp/AnalogInputSimGui.cpp | 13 +- .../src/main/native/cpp/DIOSimGui.cpp | 8 +- .../src/main/native/cpp/DriverStationGui.cpp | 32 ++- .../src/main/native/cpp/EncoderSimGui.cpp | 11 +- .../src/main/native/cpp/EncoderSimGui.hpp | 2 +- .../src/main/native/cpp/HALProvider.cpp | 6 +- .../main/native/cpp/NetworkTablesSimGui.cpp | 12 +- .../src/main/native/cpp/PCMSimGui.cpp | 16 +- .../src/main/native/cpp/PHSimGui.cpp | 13 +- .../src/main/native/cpp/PWMSimGui.cpp | 8 +- .../native/cpp/PowerDistributionSimGui.cpp | 6 +- .../src/main/native/cpp/RoboRioSimGui.cpp | 8 +- .../src/main/native/cpp/SimDeviceGui.cpp | 24 +- .../halsim_gui/src/main/native/cpp/main.cpp | 6 +- .../include/wpi/halsim/gui/HALDataSource.hpp | 12 +- .../include/wpi/halsim/gui/HALSimGuiExt.hpp | 2 +- .../include/wpi/halsim/gui/SimDeviceGui.hpp | 2 +- .../src/main/native/cpp/HALSimWS.cpp | 10 +- .../native/cpp/HALSimWSClientConnection.cpp | 6 +- .../ws_client/HALSimWSClientConnection.hpp | 5 +- .../native/cpp/WSProvider_DriverStation.cpp | 3 +- .../main/native/cpp/WSProvider_Joystick.cpp | 4 +- .../main/native/cpp/WSProvider_SimDevice.cpp | 3 +- .../main/native/cpp/HALSimHttpConnection.cpp | 21 +- .../src/main/native/cpp/HALSimWeb.cpp | 8 +- .../halsim/ws_server/HALSimHttpConnection.hpp | 3 +- .../test/native/cpp/WebServerClientTest.cpp | 15 +- .../src/test/native/cpp/main.cpp | 6 +- .../src/main/native/cpp/HALSimXRP.cpp | 9 +- .../halsim_xrp/src/main/native/cpp/XRP.cpp | 14 +- tools/datalogtool/src/main/native/cpp/App.cpp | 7 +- .../src/main/native/cpp/Downloader.cpp | 3 +- .../src/main/native/cpp/Downloader.hpp | 2 +- .../src/main/native/cpp/Exporter.cpp | 12 +- .../src/main/native/cpp/Exporter.hpp | 2 +- .../src/main/native/cpp/main.cpp | 5 +- tools/sysid/src/main/native/cpp/App.cpp | 2 +- .../native/cpp/analysis/AnalysisManager.cpp | 6 +- .../src/main/native/cpp/analysis/ArmSim.cpp | 9 +- .../main/native/cpp/analysis/ElevatorSim.cpp | 5 +- .../native/cpp/analysis/FeedbackAnalysis.cpp | 20 +- .../native/cpp/analysis/FilteringUtils.cpp | 17 +- .../native/cpp/analysis/SimpleMotorSim.cpp | 3 +- .../src/main/native/cpp/view/AnalyzerPlot.cpp | 20 +- .../src/main/native/cpp/view/DataSelector.cpp | 3 +- .../src/main/native/cpp/view/LogLoader.cpp | 5 +- .../wpi/sysid/analysis/FilteringUtils.hpp | 6 +- .../include/wpi/sysid/view/Analyzer.hpp | 2 +- .../include/wpi/sysid/view/DataSelector.hpp | 4 +- .../include/wpi/sysid/view/LogLoader.hpp | 4 +- .../test/native/cpp/analysis/FilterTest.cpp | 4 +- .../src/main/native/cpp/fieldcalibration.cpp | 3 +- upstream_utils/llvm.py | 18 +- wpilibc/src/main/native/cpp/ExpansionHub.cpp | 2 +- .../src/main/native/cpp/ExpansionHubMotor.cpp | 7 +- .../src/main/native/cpp/ExpansionHubServo.cpp | 9 +- .../main/native/cpp/counter/Tachometer.cpp | 3 +- .../main/native/cpp/drive/MecanumDrive.cpp | 17 +- .../cpp/driverstation/DriverStation.cpp | 36 +-- .../native/cpp/driverstation/GenericHID.cpp | 3 +- .../src/main/native/cpp/event/EventLoop.cpp | 4 +- .../hardware/accelerometer/ADXL345_I2C.cpp | 6 +- .../accelerometer/AnalogAccelerometer.cpp | 2 +- .../src/main/native/cpp/hardware/bus/CAN.cpp | 2 +- .../native/cpp/hardware/bus/SerialPort.cpp | 15 +- .../main/native/cpp/hardware/discrete/PWM.cpp | 6 +- .../native/cpp/hardware/led/LEDPattern.cpp | 9 +- .../native/cpp/hardware/motor/MotorSafety.cpp | 14 +- .../cpp/hardware/pneumatic/Compressor.cpp | 10 +- .../cpp/hardware/pneumatic/DoubleSolenoid.cpp | 17 +- .../cpp/hardware/pneumatic/PneumaticHub.cpp | 47 ++-- .../cpp/hardware/pneumatic/PneumaticsBase.cpp | 4 +- .../pneumatic/PneumaticsControlModule.cpp | 13 +- .../cpp/hardware/pneumatic/Solenoid.cpp | 10 +- .../cpp/hardware/power/PowerDistribution.cpp | 4 +- .../cpp/hardware/rotation/AnalogEncoder.cpp | 5 +- .../hardware/rotation/AnalogPotentiometer.cpp | 8 +- .../hardware/rotation/DutyCycleEncoder.cpp | 8 +- .../native/cpp/opmode/IterativeRobotBase.cpp | 3 +- .../src/main/native/cpp/opmode/TimedRobot.cpp | 9 +- .../main/native/cpp/opmode/TimesliceRobot.cpp | 6 +- .../main/native/cpp/simulation/DCMotorSim.cpp | 6 +- .../simulation/DifferentialDrivetrainSim.cpp | 39 ++-- .../native/cpp/simulation/ElevatorSim.cpp | 31 +-- .../native/cpp/simulation/FlywheelSim.cpp | 3 +- .../cpp/simulation/PneumaticsBaseSim.cpp | 2 +- .../cpp/simulation/SingleJointedArmSim.cpp | 34 +-- .../cpp/smartdashboard/FieldObject2d.cpp | 6 +- .../smartdashboard/MechanismLigament2d.cpp | 5 +- .../cpp/smartdashboard/MechanismRoot2d.cpp | 7 +- .../smartdashboard/SendableBuilderImpl.cpp | 25 +- .../main/native/cpp/system/DataLogManager.cpp | 10 +- .../src/main/native/cpp/system/Watchdog.cpp | 4 +- wpilibc/src/main/native/cpp/util/Alert.cpp | 2 +- .../src/main/native/cpp/util/Preferences.cpp | 11 +- wpilibc/src/main/native/cppcs/RobotBase.cpp | 3 +- .../native/include/wpi/ExpansionHubServo.hpp | 6 +- .../native/include/wpi/drive/MecanumDrive.hpp | 3 +- .../wpi/driverstation/DriverStation.hpp | 3 +- .../include/wpi/event/NetworkBooleanEvent.hpp | 5 +- .../accelerometer/AnalogAccelerometer.hpp | 5 +- .../include/wpi/hardware/led/LEDPattern.hpp | 3 +- .../wpi/hardware/motor/PWMMotorController.hpp | 9 +- .../wpi/hardware/pneumatic/PneumaticsBase.hpp | 3 +- .../wpi/hardware/pneumatic/Solenoid.hpp | 3 +- .../wpi/hardware/power/PowerDistribution.hpp | 3 +- .../include/wpi/hardware/range/SharpIR.hpp | 3 +- .../hardware/rotation/AnalogPotentiometer.hpp | 5 +- .../wpi/hardware/rotation/DutyCycle.hpp | 3 +- .../native/include/wpi/opmode/TimedRobot.hpp | 3 +- .../include/wpi/simulation/BatterySim.hpp | 9 +- .../include/wpi/simulation/DCMotorSim.hpp | 7 +- .../simulation/DifferentialDrivetrainSim.hpp | 50 ++-- .../include/wpi/simulation/ElevatorSim.hpp | 29 ++- .../include/wpi/simulation/FlywheelSim.hpp | 3 +- .../wpi/simulation/LinearSystemSim.hpp | 6 +- .../wpi/simulation/SingleJointedArmSim.hpp | 24 +- .../include/wpi/smartdashboard/Field2d.hpp | 6 +- .../wpi/smartdashboard/FieldObject2d.hpp | 6 +- .../smartdashboard/SendableBuilderImpl.hpp | 16 +- .../smartdashboard/SendableChooserBase.hpp | 5 +- .../wpi/smartdashboard/SmartDashboard.hpp | 2 +- .../include/wpi/sysid/SysIdRoutineLog.hpp | 6 +- .../include/wpi/system/DataLogManager.hpp | 6 +- .../main/native/include/wpi/system/Errors.hpp | 10 +- .../include/wpi/system/ScopedTracer.hpp | 2 +- .../main/native/include/wpi/system/Tracer.hpp | 5 +- .../native/include/wpi/system/Watchdog.hpp | 3 +- .../main/native/include/wpi/util/Color.hpp | 13 +- .../native/include/wpi/util/Color8Bit.hpp | 18 +- wpilibc/src/test/native/cpp/AlertTest.cpp | 3 +- .../src/test/native/cpp/LEDPatternTest.cpp | 3 +- .../test/native/cpp/UnitNetworkTablesTest.cpp | 13 +- .../native/cpp/simulation/DCMotorSimTest.cpp | 6 +- .../DifferentialDrivetrainSimTest.cpp | 3 +- .../native/cpp/simulation/ElevatorSimTest.cpp | 37 +-- .../simulation/SingleJointedArmSimTest.cpp | 10 +- .../cpp/simulation/StateSpaceSimTest.cpp | 4 +- .../cpp/smartdashboard/Mechanism2dTest.cpp | 3 +- .../ReplaceMeInstantCommand2.hpp | 2 +- .../ReplaceMeParallelCommandGroup.hpp | 2 +- .../ReplaceMeParallelDeadlineGroup.hpp | 2 +- .../ReplaceMeParallelRaceGroup.hpp | 2 +- .../ReplaceMeSequentialCommandGroup.hpp | 2 +- .../examples/AprilTagsVision/cpp/Robot.cpp | 9 +- .../ArmSimulation/cpp/subsystems/Arm.cpp | 4 +- .../DifferentialDriveBot/cpp/Drivetrain.cpp | 3 +- .../include/Drivetrain.hpp | 3 +- .../cpp/Drivetrain.cpp | 18 +- .../include/Drivetrain.hpp | 21 +- .../ExampleGlobalMeasurementSensor.hpp | 9 +- .../DriveDistanceOffboard/cpp/Robot.cpp | 3 +- .../include/subsystems/DriveSubsystem.hpp | 12 +- .../examples/DutyCycleEncoder/cpp/Robot.cpp | 2 +- .../ElevatorExponentialProfile/cpp/Robot.cpp | 10 +- .../cpp/subsystems/Elevator.cpp | 4 +- .../include/subsystems/Elevator.hpp | 12 +- .../ElevatorProfiledPID/cpp/Robot.cpp | 8 +- .../include/subsystems/Elevator.hpp | 4 +- .../ElevatorTrapezoidProfile/cpp/Robot.cpp | 3 +- .../main/cpp/examples/EventLoop/cpp/Robot.cpp | 5 +- .../FlywheelBangBangController/cpp/Robot.cpp | 20 +- .../HatchbotInlined/cpp/RobotContainer.cpp | 3 +- .../HatchbotInlined/cpp/commands/Autos.cpp | 2 +- .../cpp/RobotContainer.cpp | 2 +- .../include/commands/ComplexAuto.hpp | 3 +- .../include/commands/DefaultDrive.hpp | 3 +- .../include/commands/DriveDistance.hpp | 3 +- .../include/commands/ReleaseHatch.hpp | 3 +- .../cpp/examples/HttpCamera/cpp/Robot.cpp | 3 +- .../examples/MecanumBot/cpp/Drivetrain.cpp | 6 +- .../MecanumBot/include/Drivetrain.hpp | 12 +- .../cpp/Drivetrain.cpp | 3 +- .../include/Drivetrain.hpp | 10 +- .../ExampleGlobalMeasurementSensor.hpp | 9 +- .../RapidReactCommandBot/cpp/Robot.cpp | 3 +- .../cpp/subsystems/Drive.cpp | 9 +- .../cpp/subsystems/Shooter.cpp | 3 +- .../include/subsystems/Drive.hpp | 5 +- .../RomiReference/include/RobotContainer.hpp | 2 +- .../include/commands/AutonomousDistance.hpp | 2 +- .../include/commands/AutonomousTime.hpp | 3 +- .../include/commands/DriveDistance.hpp | 3 +- .../include/commands/TurnDegrees.hpp | 3 +- .../SelectCommand/include/RobotContainer.hpp | 14 +- .../cpp/Drivetrain.cpp | 9 +- .../cpp/Robot.cpp | 3 +- .../include/Drivetrain.hpp | 3 +- .../cpp/examples/StateSpaceArm/cpp/Robot.cpp | 22 +- .../examples/StateSpaceElevator/cpp/Robot.cpp | 22 +- .../examples/StateSpaceFlywheel/cpp/Robot.cpp | 11 +- .../StateSpaceFlywheelSysId/cpp/Robot.cpp | 6 +- .../main/cpp/examples/SwerveBot/cpp/Robot.cpp | 12 +- .../examples/SwerveBot/cpp/SwerveModule.cpp | 6 +- .../examples/SwerveBot/include/Drivetrain.hpp | 5 +- .../SwerveBot/include/SwerveModule.hpp | 4 +- .../cpp/SwerveModule.cpp | 6 +- .../include/Drivetrain.hpp | 5 +- .../ExampleGlobalMeasurementSensor.hpp | 9 +- .../include/SwerveModule.hpp | 4 +- .../cpp/examples/SysIdRoutine/cpp/Robot.cpp | 3 +- .../SysIdRoutine/cpp/SysIdRoutineBot.cpp | 12 +- .../SysIdRoutine/cpp/subsystems/Drive.cpp | 9 +- .../SysIdRoutine/cpp/subsystems/Shooter.cpp | 6 +- .../SysIdRoutine/include/Constants.hpp | 12 +- .../SysIdRoutine/include/subsystems/Drive.hpp | 11 +- .../include/subsystems/Shooter.hpp | 3 +- .../include/commands/AutonomousDistance.hpp | 2 +- .../include/commands/AutonomousTime.hpp | 3 +- .../include/commands/DriveDistance.hpp | 3 +- .../include/commands/TurnDegrees.hpp | 3 +- .../AccelerometerFilter/cpp/Robot.cpp | 8 +- .../ProfiledPIDFeedforward/cpp/Robot.cpp | 8 +- .../cpp/templates/commandbased/cpp/Robot.cpp | 3 +- .../commandbased/cpp/commands/Autos.cpp | 2 +- .../commandbasedskeleton/cpp/Robot.cpp | 3 +- .../native/cpp/controller/ArmFeedforward.cpp | 8 +- .../DifferentialDriveAccelerationLimiter.cpp | 4 +- .../DifferentialDriveFeedforward.cpp | 3 +- .../LTVDifferentialDriveController.cpp | 6 +- .../cpp/controller/LTVUnicycleController.cpp | 6 +- .../controller/proto/ArmFeedforwardProto.cpp | 4 +- .../DifferentialDriveFeedforwardProto.cpp | 7 +- .../DifferentialDriveWheelVoltagesProto.cpp | 3 +- .../proto/ElevatorFeedforwardProto.cpp | 4 +- .../DifferentialDriveFeedforwardStruct.cpp | 21 +- .../struct/ElevatorFeedforwardStruct.cpp | 3 +- .../main/native/cpp/geometry/Ellipse2d.cpp | 2 +- .../src/main/native/cpp/geometry/Pose2d.cpp | 2 +- .../src/main/native/cpp/geometry/Pose3d.cpp | 2 +- .../main/native/cpp/geometry/Quaternion.cpp | 6 +- .../native/cpp/geometry/Translation2d.cpp | 10 +- .../native/cpp/geometry/Translation3d.cpp | 10 +- .../cpp/geometry/proto/Ellipse2dProto.cpp | 8 +- .../native/cpp/geometry/proto/Pose2dProto.cpp | 4 +- .../native/cpp/geometry/proto/Pose3dProto.cpp | 4 +- .../cpp/geometry/proto/QuaternionProto.cpp | 8 +- .../cpp/geometry/proto/Rectangle2dProto.cpp | 8 +- .../cpp/geometry/proto/Rotation2dProto.cpp | 8 +- .../cpp/geometry/proto/Rotation3dProto.cpp | 8 +- .../cpp/geometry/proto/Transform2dProto.cpp | 8 +- .../cpp/geometry/proto/Transform3dProto.cpp | 8 +- .../cpp/geometry/proto/Translation2dProto.cpp | 8 +- .../cpp/geometry/proto/Translation3dProto.cpp | 8 +- .../cpp/geometry/proto/Twist2dProto.cpp | 8 +- .../cpp/geometry/proto/Twist3dProto.cpp | 13 +- .../cpp/geometry/struct/Ellipse2dStruct.cpp | 6 +- .../cpp/geometry/struct/QuaternionStruct.cpp | 3 +- .../cpp/geometry/struct/Rectangle2dStruct.cpp | 6 +- .../cpp/geometry/struct/Rotation2dStruct.cpp | 3 +- .../cpp/geometry/struct/Rotation3dStruct.cpp | 3 +- .../cpp/geometry/struct/Transform2dStruct.cpp | 3 +- .../cpp/geometry/struct/Transform3dStruct.cpp | 3 +- .../cpp/geometry/struct/Twist2dStruct.cpp | 3 +- .../cpp/geometry/struct/Twist3dStruct.cpp | 3 +- .../main/native/cpp/jni/ArmFeedforwardJNI.cpp | 9 +- wpimath/src/main/native/cpp/jni/DAREJNI.cpp | 18 +- .../src/main/native/cpp/jni/Ellipse2dJNI.cpp | 5 +- .../main/native/cpp/jni/Transform3dJNI.cpp | 3 +- .../src/main/native/cpp/jni/Twist3dJNI.cpp | 7 +- .../cpp/kinematics/MecanumDriveKinematics.cpp | 6 +- .../kinematics/proto/ChassisSpeedsProto.cpp | 8 +- .../DifferentialDriveKinematicsProto.cpp | 4 +- .../DifferentialDriveWheelPositionsProto.cpp | 3 +- .../DifferentialDriveWheelSpeedsProto.cpp | 7 +- .../proto/MecanumDriveKinematicsProto.cpp | 4 +- .../proto/MecanumDriveWheelPositionsProto.cpp | 4 +- .../proto/MecanumDriveWheelSpeedsProto.cpp | 4 +- .../proto/SwerveModulePositionProto.cpp | 4 +- .../kinematics/struct/ChassisSpeedsStruct.cpp | 9 +- .../DifferentialDriveKinematicsStruct.cpp | 3 +- .../DifferentialDriveWheelPositionsStruct.cpp | 3 +- .../DifferentialDriveWheelSpeedsStruct.cpp | 6 +- .../struct/MecanumDriveKinematicsStruct.cpp | 3 +- .../MecanumDriveWheelPositionsStruct.cpp | 3 +- .../struct/MecanumDriveWheelSpeedsStruct.cpp | 6 +- .../struct/SwerveModulePositionStruct.cpp | 3 +- .../struct/SwerveModuleStateStruct.cpp | 3 +- .../spline/proto/CubicHermiteSplineProto.cpp | 4 +- .../proto/QuinticHermiteSplineProto.cpp | 4 +- .../struct/CubicHermiteSplineStruct.cpp | 18 +- .../struct/QuinticHermiteSplineStruct.cpp | 18 +- .../cpp/system/plant/proto/DCMotorProto.cpp | 8 +- .../cpp/system/plant/struct/DCMotorStruct.cpp | 15 +- .../main/native/cpp/trajectory/Trajectory.cpp | 15 +- .../trajectory/TrajectoryParameterizer.cpp | 8 +- .../cpp/trajectory/proto/TrajectoryProto.cpp | 11 +- .../wpi/math/controller/ArmFeedforward.hpp | 27 +-- .../DifferentialDriveAccelerationLimiter.hpp | 4 +- .../DifferentialDriveFeedforward.hpp | 3 +- .../math/controller/ElevatorFeedforward.hpp | 32 ++- .../math/controller/LTVUnicycleController.hpp | 3 +- .../LinearPlantInversionFeedforward.hpp | 3 +- .../controller/LinearQuadraticRegulator.hpp | 3 +- .../math/controller/ProfiledPIDController.hpp | 9 +- .../controller/SimpleMotorFeedforward.hpp | 22 +- .../controller/proto/ArmFeedforwardProto.hpp | 3 +- .../DifferentialDriveFeedforwardProto.hpp | 6 +- .../DifferentialDriveWheelVoltagesProto.hpp | 3 +- .../proto/ElevatorFeedforwardProto.hpp | 12 +- .../proto/SimpleMotorFeedforwardProto.hpp | 16 +- .../struct/ArmFeedforwardStruct.hpp | 3 +- .../DifferentialDriveFeedforwardStruct.hpp | 6 +- .../DifferentialDriveWheelVoltagesStruct.hpp | 6 +- .../struct/SimpleMotorFeedforwardStruct.hpp | 44 ++-- .../DifferentialDrivePoseEstimator.hpp | 6 +- .../DifferentialDrivePoseEstimator3d.hpp | 6 +- .../KalmanFilterLatencyCompensator.hpp | 14 +- .../estimator/MecanumDrivePoseEstimator.hpp | 3 +- .../estimator/MecanumDrivePoseEstimator3d.hpp | 3 +- .../wpi/math/estimator/PoseEstimator3d.hpp | 14 +- .../estimator/SwerveDrivePoseEstimator.hpp | 3 +- .../estimator/SwerveDrivePoseEstimator3d.hpp | 8 +- .../include/wpi/math/filter/Debouncer.hpp | 4 +- .../include/wpi/math/filter/LinearFilter.hpp | 3 +- .../wpi/math/filter/SlewRateLimiter.hpp | 10 +- .../include/wpi/math/geometry/Pose2d.hpp | 6 +- .../include/wpi/math/geometry/Pose3d.hpp | 4 +- .../include/wpi/math/geometry/Rectangle2d.hpp | 6 +- .../include/wpi/math/geometry/Rotation2d.hpp | 3 +- .../include/wpi/math/geometry/Rotation3d.hpp | 16 +- .../include/wpi/math/geometry/Transform2d.hpp | 6 +- .../include/wpi/math/geometry/Transform3d.hpp | 4 +- .../wpi/math/geometry/Translation2d.hpp | 7 +- .../wpi/math/geometry/Translation3d.hpp | 13 +- .../geometry/struct/Rectangle2dStruct.hpp | 3 +- .../geometry/struct/Transform2dStruct.hpp | 3 +- .../geometry/struct/Transform3dStruct.hpp | 3 +- .../geometry/struct/Translation2dStruct.hpp | 3 +- .../geometry/struct/Translation3dStruct.hpp | 3 +- .../TimeInterpolatableBuffer.hpp | 6 +- .../wpi/math/kinematics/ChassisSpeeds.hpp | 12 +- .../kinematics/DifferentialDriveOdometry.hpp | 6 +- .../DifferentialDriveOdometry3d.hpp | 6 +- .../DifferentialDriveWheelSpeeds.hpp | 7 +- .../kinematics/MecanumDriveWheelSpeeds.hpp | 15 +- .../math/kinematics/SwerveDriveKinematics.hpp | 66 +++--- .../DifferentialDriveKinematicsProto.hpp | 9 +- .../DifferentialDriveWheelPositionsProto.hpp | 3 +- .../DifferentialDriveWheelSpeedsProto.hpp | 6 +- .../proto/MecanumDriveKinematicsProto.hpp | 9 +- .../proto/MecanumDriveWheelPositionsProto.hpp | 9 +- .../proto/MecanumDriveWheelSpeedsProto.hpp | 9 +- .../proto/SwerveDriveKinematicsProto.hpp | 10 +- .../proto/SwerveModulePositionProto.hpp | 9 +- .../proto/SwerveModuleStateProto.hpp | 9 +- .../kinematics/struct/ChassisSpeedsStruct.hpp | 3 +- .../DifferentialDriveKinematicsStruct.hpp | 9 +- .../DifferentialDriveWheelPositionsStruct.hpp | 6 +- .../DifferentialDriveWheelSpeedsStruct.hpp | 6 +- .../struct/MecanumDriveKinematicsStruct.hpp | 3 +- .../MecanumDriveWheelPositionsStruct.hpp | 9 +- .../struct/MecanumDriveWheelSpeedsStruct.hpp | 6 +- .../struct/SwerveDriveKinematicsStruct.hpp | 20 +- .../wpi/math/linalg/proto/MatrixProto.hpp | 12 +- .../wpi/math/linalg/proto/VectorProto.hpp | 15 +- .../wpi/math/linalg/struct/StructProto.hpp | 9 +- .../wpi/math/linalg/struct/VectorStruct.hpp | 8 +- .../wpi/math/path/TravelingSalesman.hpp | 4 +- .../wpi/math/spline/CubicHermiteSpline.hpp | 3 +- .../wpi/math/spline/QuinticHermiteSpline.hpp | 3 +- .../native/include/wpi/math/spline/Spline.hpp | 3 +- .../include/wpi/math/spline/SplineHelper.hpp | 10 +- .../spline/proto/CubicHermiteSplineProto.hpp | 12 +- .../proto/QuinticHermiteSplineProto.hpp | 9 +- .../wpi/math/system/LinearSystemLoop.hpp | 15 +- .../include/wpi/math/system/plant/DCMotor.hpp | 35 +-- .../wpi/math/system/plant/LinearSystemId.hpp | 38 +-- .../math/system/proto/LinearSystemProto.hpp | 13 +- .../math/system/struct/LinearSystemStruct.hpp | 37 +-- .../math/trajectory/ExponentialProfile.hpp | 30 ++- .../wpi/math/trajectory/Trajectory.hpp | 11 +- .../wpi/math/trajectory/TrajectoryConfig.hpp | 4 +- .../wpi/math/trajectory/TrapezoidProfile.hpp | 28 ++- .../CentripetalAccelerationConstraint.hpp | 2 +- .../DifferentialDriveVoltageConstraint.hpp | 9 +- .../MecanumDriveKinematicsConstraint.hpp | 5 +- .../SwerveDriveKinematicsConstraint.hpp | 5 +- .../trajectory/proto/TrajectoryStateProto.hpp | 9 +- .../wpi/math/util/ComputerVisionUtil.hpp | 10 +- .../native/include/wpi/math/util/MathUtil.hpp | 26 +-- .../include/wpi/math/util/StateSpaceUtil.hpp | 5 +- .../main/native/include/wpi/units/angle.hpp | 5 +- .../native/include/wpi/units/angular_jerk.hpp | 3 +- .../main/native/include/wpi/units/charge.hpp | 5 +- .../native/include/wpi/units/constants.hpp | 3 +- .../native/include/wpi/units/curvature.hpp | 4 +- .../main/native/include/wpi/units/energy.hpp | 5 +- .../main/native/include/wpi/units/force.hpp | 5 +- .../native/include/wpi/units/formatter.hpp | 93 ++++---- .../main/native/include/wpi/units/length.hpp | 5 +- .../main/native/include/wpi/units/mass.hpp | 3 +- .../main/native/include/wpi/units/math.hpp | 60 ++--- .../main/native/include/wpi/units/power.hpp | 5 +- .../main/native/include/wpi/units/time.hpp | 5 +- .../main/native/include/wpi/units/voltage.hpp | 3 +- .../native/cpp/ComputerVisionUtilTest.cpp | 17 +- wpimath/src/test/native/cpp/DARETest.cpp | 94 +++++--- .../src/test/native/cpp/DARETest_Inst_2x1.cpp | 16 +- .../src/test/native/cpp/DARETest_Inst_2x2.cpp | 16 +- .../src/test/native/cpp/DARETest_Inst_2x3.cpp | 16 +- .../src/test/native/cpp/DARETest_Inst_4x1.cpp | 16 +- wpimath/src/test/native/cpp/EigenTest.cpp | 2 +- wpimath/src/test/native/cpp/MathUtilTest.cpp | 221 ++++++++++-------- .../test/native/cpp/StateSpaceUtilTest.cpp | 44 ++-- .../cpp/controller/ArmFeedforwardTest.cpp | 14 +- ...rolAffinePlantInversionFeedforwardTest.cpp | 2 +- ...fferentialDriveAccelerationLimiterTest.cpp | 72 +++--- .../DifferentialDriveFeedforwardTest.cpp | 2 +- .../LTVDifferentialDriveControllerTest.cpp | 19 +- .../controller/LTVUnicycleControllerTest.cpp | 10 +- .../LinearQuadraticRegulatorTest.cpp | 4 +- .../controller/ProfiledPIDInputOutputTest.cpp | 24 +- .../controller/SimpleMotorFeedforwardTest.cpp | 3 +- ...ifferentialDriveWheelVoltagesProtoTest.cpp | 3 +- .../proto/SimpleMotorFeedforwardProtoTest.cpp | 3 +- .../SimpleMotorFeedforwardStructTest.cpp | 3 +- .../cpp/estimator/AngleStatisticsTest.cpp | 17 +- .../DifferentialDrivePoseEstimator3dTest.cpp | 200 +++++++++------- .../DifferentialDrivePoseEstimatorTest.cpp | 145 +++++++----- .../estimator/ExtendedKalmanFilterTest.cpp | 41 ++-- .../native/cpp/estimator/KalmanFilterTest.cpp | 3 +- .../MecanumDrivePoseEstimator3dTest.cpp | 199 ++++++++++------ .../MecanumDrivePoseEstimatorTest.cpp | 199 +++++++++------- .../estimator/MerweScaledSigmaPointsTest.cpp | 10 +- .../native/cpp/estimator/MerweUKFTest.cpp | 99 ++++---- .../cpp/estimator/S3SigmaPointsTest.cpp | 13 +- .../test/native/cpp/estimator/S3UKFTest.cpp | 99 ++++---- .../SwerveDrivePoseEstimator3dTest.cpp | 207 +++++++++------- .../SwerveDrivePoseEstimatorTest.cpp | 205 +++++++++------- .../test/native/cpp/filter/DebouncerTest.cpp | 12 +- .../cpp/filter/LinearFilterOutputTest.cpp | 18 +- .../native/cpp/filter/SlewRateLimiterTest.cpp | 3 +- .../test/native/cpp/geometry/Pose3dTest.cpp | 4 +- .../native/cpp/geometry/Rotation3dTest.cpp | 21 +- .../test/native/cpp/geometry/Twist3dTest.cpp | 14 +- .../cpp/kinematics/ChassisSpeedsTest.cpp | 6 +- .../DifferentialDriveOdometry3dTest.cpp | 12 +- .../kinematics/MecanumDriveOdometry3dTest.cpp | 53 +++-- .../kinematics/MecanumDriveOdometryTest.cpp | 49 ++-- .../MecanumDriveWheelSpeedsTest.cpp | 21 +- .../kinematics/SwerveDriveOdometry3dTest.cpp | 8 +- .../kinematics/SwerveDriveOdometryTest.cpp | 11 +- .../proto/SwerveDriveKinematicsProtoTest.cpp | 7 +- ...ferentialDriveWheelPositionsStructTest.cpp | 3 +- .../SwerveDriveKinematicsStructTest.cpp | 7 +- .../native/cpp/path/TravelingSalesmanTest.cpp | 26 ++- .../proto/CubicHermiteSplineProtoTest.cpp | 7 +- .../proto/QuinticHermiteSplineProtoTest.cpp | 9 +- .../struct/CubicHermiteSplineStructTest.cpp | 7 +- .../struct/QuinticHermiteSplineStructTest.cpp | 9 +- .../native/cpp/system/DiscretizationTest.cpp | 41 ++-- .../native/cpp/system/LinearSystemIDTest.cpp | 45 ++-- .../cpp/system/NumericalIntegrationTest.cpp | 14 +- .../cpp/system/NumericalJacobianTest.cpp | 15 +- .../DifferentialDriveVoltageTest.cpp | 4 +- .../EllipticalRegionConstraintTest.cpp | 6 +- .../cpp/trajectory/ExponentialProfileTest.cpp | 180 +++++++++----- .../RectangularRegionConstraintTest.cpp | 6 +- .../trajectory/TrajectoryTransformTest.cpp | 8 +- .../cpp/trajectory/TrapezoidProfileTest.cpp | 71 +++--- .../trajectory/proto/TrajectoryProtoTest.cpp | 24 +- wpinet/examples/webserver/webserver.cpp | 2 +- .../main/native/cpp/HttpServerConnection.cpp | 2 +- wpinet/src/main/native/cpp/HttpUtil.cpp | 16 +- .../native/cpp/MulticastHandleManager.hpp | 6 +- .../native/cpp/MulticastServiceResolver.cpp | 6 +- .../main/native/cpp/ParallelTcpConnector.cpp | 5 +- wpinet/src/main/native/cpp/PortForwarder.cpp | 3 +- wpinet/src/main/native/cpp/WebServer.cpp | 45 ++-- wpinet/src/main/native/cpp/WebSocket.cpp | 17 +- wpinet/src/main/native/cpp/jni/WPINetJNI.cpp | 12 +- .../main/native/include/wpi/net/DsClient.hpp | 3 +- .../include/wpi/net/HttpServerConnection.hpp | 3 +- .../main/native/include/wpi/net/HttpUtil.hpp | 23 +- .../wpi/net/HttpWebSocketServerConnection.hpp | 2 +- .../include/wpi/net/ParallelTcpConnector.hpp | 6 +- .../main/native/include/wpi/net/UDPClient.hpp | 3 +- .../main/native/include/wpi/net/UrlParser.hpp | 12 +- .../native/include/wpi/net/raw_uv_ostream.hpp | 6 +- .../include/wpi/net/uv/AsyncFunction.hpp | 6 +- .../main/native/include/wpi/net/uv/Handle.hpp | 2 +- .../native/linux/MulticastServiceResolver.cpp | 4 +- .../windows/MulticastServiceResolver.cpp | 5 +- .../src/netconsoleServer/native/cpp/main.cpp | 14 +- wpinet/src/netconsoleTee/native/cpp/main.cpp | 15 +- wpinet/src/test/native/cpp/MulticastTest.cpp | 3 +- .../test/native/cpp/WebSocketClientTest.cpp | 3 +- .../native/cpp/WebSocketSerializerTest.cpp | 34 +-- wpinet/src/test/native/cpp/WebSocketTest.cpp | 3 +- .../src/main/native/cpp/Synchronization.cpp | 28 +-- .../src/main/native/cpp/jni/WPIUtilJNI.cpp | 9 +- .../main/native/include/wpi/util/RawFrame.h | 4 +- .../main/native/include/wpi/util/array.hpp | 3 +- .../main/native/include/wpi/util/jni_util.hpp | 6 +- .../include/wpi/util/protobuf/Protobuf.hpp | 13 +- .../wpi/util/protobuf/ProtobufCallbacks.hpp | 3 +- .../wpi/util/sendable/SendableBuilder.hpp | 16 +- .../wpi/util/static_circular_buffer.hpp | 6 +- .../native/include/wpi/util/struct/Struct.hpp | 10 +- wpiutil/src/test/native/cpp/ArrayTest.cpp | 7 +- .../test/native/cpp/SynchronizationTest.cpp | 3 +- .../src/test/native/cpp/ct_string_test.cpp | 6 +- .../test/native/cpp/expected/ExpectedTest.cpp | 3 +- .../src/test/native/cpp/proto/TestProto.cpp | 5 +- .../native/cpp/proto/TestProtoRepeated.cpp | 14 +- .../src/test/native/cpp/rotated_span_test.cpp | 6 +- .../src/test/native/cpp/spinlock_bench.cpp | 38 +-- .../src/main/native/cpp/xrp/XRPMotor.cpp | 4 +- .../src/main/native/cpp/xrp/XRPServo.cpp | 4 +- 749 files changed, 5504 insertions(+), 3936 deletions(-) diff --git a/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp b/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp index 6ab3362d27..255321198a 100644 --- a/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp +++ b/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp @@ -22,13 +22,16 @@ AprilTagFieldLayout::AprilTagFieldLayout(std::string_view path) { throw std::runtime_error(fmt::format("Cannot open file: {}", path)); } - wpi::util::json json = wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()); + wpi::util::json json = + wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()); for (const auto& tag : json.at("tags").get>()) { m_apriltags[tag.ID] = tag; } - m_fieldWidth = wpi::units::meter_t{json.at("field").at("width").get()}; - m_fieldLength = wpi::units::meter_t{json.at("field").at("length").get()}; + m_fieldWidth = + wpi::units::meter_t{json.at("field").at("width").get()}; + m_fieldLength = + wpi::units::meter_t{json.at("field").at("length").get()}; } AprilTagFieldLayout::AprilTagFieldLayout(std::vector apriltags, @@ -64,8 +67,9 @@ void AprilTagFieldLayout::SetOrigin(OriginPosition origin) { SetOrigin(wpi::math::Pose3d{}); break; case OriginPosition::kRedAllianceWallRightSide: - SetOrigin(wpi::math::Pose3d{wpi::math::Translation3d{m_fieldLength, m_fieldWidth, 0_m}, - wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}}); + SetOrigin(wpi::math::Pose3d{ + wpi::math::Translation3d{m_fieldLength, m_fieldWidth, 0_m}, + wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}}); break; default: throw std::invalid_argument("Invalid origin"); @@ -101,7 +105,8 @@ void AprilTagFieldLayout::Serialize(std::string_view path) { output.flush(); } -void wpi::apriltag::to_json(wpi::util::json& json, const AprilTagFieldLayout& layout) { +void wpi::apriltag::to_json(wpi::util::json& json, + const AprilTagFieldLayout& layout) { std::vector tagVector; tagVector.reserve(layout.m_apriltags.size()); for (const auto& pair : layout.m_apriltags) { @@ -109,12 +114,13 @@ void wpi::apriltag::to_json(wpi::util::json& json, const AprilTagFieldLayout& la } json = wpi::util::json{{"field", - {{"length", layout.m_fieldLength.value()}, - {"width", layout.m_fieldWidth.value()}}}, - {"tags", tagVector}}; + {{"length", layout.m_fieldLength.value()}, + {"width", layout.m_fieldWidth.value()}}}, + {"tags", tagVector}}; } -void wpi::apriltag::from_json(const wpi::util::json& json, AprilTagFieldLayout& layout) { +void wpi::apriltag::from_json(const wpi::util::json& json, + AprilTagFieldLayout& layout) { layout.m_apriltags.clear(); for (const auto& tag : json.at("tags").get>()) { layout.m_apriltags[tag.ID] = tag; @@ -164,6 +170,7 @@ AprilTagFieldLayout AprilTagFieldLayout::LoadField(AprilTagField field) { return json.get(); } -AprilTagFieldLayout wpi::apriltag::LoadAprilTagLayoutField(AprilTagField field) { +AprilTagFieldLayout wpi::apriltag::LoadAprilTagLayoutField( + AprilTagField field) { return AprilTagFieldLayout::LoadField(field); } diff --git a/apriltag/src/main/native/cpp/AprilTagPoseEstimator.cpp b/apriltag/src/main/native/cpp/AprilTagPoseEstimator.cpp index 56d6915052..ec92e4bdb0 100644 --- a/apriltag/src/main/native/cpp/AprilTagPoseEstimator.cpp +++ b/apriltag/src/main/native/cpp/AprilTagPoseEstimator.cpp @@ -47,8 +47,8 @@ static wpi::math::Transform3d MakePose(const apriltag_pose_t& pose) { return {}; } return {wpi::math::Translation3d{wpi::units::meter_t{pose.t->data[0]}, - wpi::units::meter_t{pose.t->data[1]}, - wpi::units::meter_t{pose.t->data[2]}}, + wpi::units::meter_t{pose.t->data[1]}, + wpi::units::meter_t{pose.t->data[2]}}, wpi::math::Rotation3d{OrthogonalizeRotationMatrix( Eigen::Map>{ pose.R->data})}}; @@ -130,8 +130,9 @@ AprilTagPoseEstimate AprilTagPoseEstimator::EstimateOrthogonalIteration( return rv; } -static wpi::math::Transform3d DoEstimate(const apriltag_detection_t* detection, - const AprilTagPoseEstimator::Config& config) { +static wpi::math::Transform3d DoEstimate( + const apriltag_detection_t* detection, + const AprilTagPoseEstimator::Config& config) { auto info = MakeDetectionInfo(detection, config); apriltag_pose_t pose; estimate_tag_pose(&info, &pose); diff --git a/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp b/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp index af8b7f2cf4..b47c9ef5d6 100644 --- a/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp +++ b/apriltag/src/main/native/cpp/jni/AprilTagJNI.cpp @@ -517,7 +517,8 @@ Java_org_wpilib_vision_apriltag_jni_AprilTagJNI_estimatePoseHomography return nullptr; } - AprilTagPoseEstimator estimator({wpi::units::meter_t{tagSize}, fx, fy, cx, cy}); + AprilTagPoseEstimator estimator( + {wpi::units::meter_t{tagSize}, fx, fy, cx, cy}); return MakeJObject(env, estimator.EstimateHomography(harr)); } @@ -553,7 +554,8 @@ Java_org_wpilib_vision_apriltag_jni_AprilTagJNI_estimatePoseOrthogonalIteration return nullptr; } - AprilTagPoseEstimator estimator({wpi::units::meter_t{tagSize}, fx, fy, cx, cy}); + AprilTagPoseEstimator estimator( + {wpi::units::meter_t{tagSize}, fx, fy, cx, cy}); return MakeJObject(env, estimator.EstimateOrthogonalIteration(harr, carr, nIters)); } @@ -590,7 +592,8 @@ Java_org_wpilib_vision_apriltag_jni_AprilTagJNI_estimatePose return nullptr; } - AprilTagPoseEstimator estimator({wpi::units::meter_t{tagSize}, fx, fy, cx, cy}); + AprilTagPoseEstimator estimator( + {wpi::units::meter_t{tagSize}, fx, fy, cx, cy}); return MakeJObject(env, estimator.Estimate(harr, carr)); } diff --git a/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp b/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp index 4626ec86e5..a761d3782b 100644 --- a/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp +++ b/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp @@ -23,10 +23,10 @@ namespace wpi::apriltag { * * The JSON format contains two top-level objects, "tags" and "field". * The "tags" object is a list of all AprilTags contained within a layout. Each - * AprilTag serializes to a JSON object containing an ID and a wpi::math::Pose3d. The - * "field" object is a descriptor of the size of the field in meters with - * "width" and "length" values. This is to account for arbitrary field sizes - * when transforming the poses. + * AprilTag serializes to a JSON object containing an ID and a + * wpi::math::Pose3d. The "field" object is a descriptor of the size of the + * field in meters with "width" and "length" values. This is to account for + * arbitrary field sizes when transforming the poses. * * Pose3ds in the JSON are measured using the normal FRC coordinate system, NWU * with the origin at the bottom-right corner of the blue alliance wall. @@ -73,7 +73,8 @@ class WPILIB_DLLEXPORT AprilTagFieldLayout { * @param fieldWidth Width of field the layout is representing. */ AprilTagFieldLayout(std::vector apriltags, - wpi::units::meter_t fieldLength, wpi::units::meter_t fieldWidth); + wpi::units::meter_t fieldLength, + wpi::units::meter_t fieldWidth); /** * Returns the length of the field the layout is representing. diff --git a/apriltag/src/main/native/include/wpi/apriltag/AprilTagPoseEstimator.hpp b/apriltag/src/main/native/include/wpi/apriltag/AprilTagPoseEstimator.hpp index 61317e56d6..7f4063e932 100644 --- a/apriltag/src/main/native/include/wpi/apriltag/AprilTagPoseEstimator.hpp +++ b/apriltag/src/main/native/include/wpi/apriltag/AprilTagPoseEstimator.hpp @@ -65,7 +65,8 @@ class WPILIB_DLLEXPORT AprilTagPoseEstimator { * @param detection Tag detection * @return Pose estimate */ - wpi::math::Transform3d EstimateHomography(const AprilTagDetection& detection) const; + wpi::math::Transform3d EstimateHomography( + const AprilTagDetection& detection) const; /** * Estimates the pose of the tag using the homography method described in [1]. @@ -73,7 +74,8 @@ class WPILIB_DLLEXPORT AprilTagPoseEstimator { * @param homography Homography 3x3 matrix data * @return Pose estimate */ - wpi::math::Transform3d EstimateHomography(std::span homography) const; + wpi::math::Transform3d EstimateHomography( + std::span homography) const; /** * Estimates the pose of the tag. This returns one or two possible poses for @@ -135,7 +137,7 @@ class WPILIB_DLLEXPORT AprilTagPoseEstimator { * @return Pose estimate */ wpi::math::Transform3d Estimate(std::span homography, - std::span corners) const; + std::span corners) const; private: Config m_config; diff --git a/apriltag/src/test/native/cpp/AprilTagJsonTest.cpp b/apriltag/src/test/native/cpp/AprilTagJsonTest.cpp index d980d09864..9f787b605b 100644 --- a/apriltag/src/test/native/cpp/AprilTagJsonTest.cpp +++ b/apriltag/src/test/native/cpp/AprilTagJsonTest.cpp @@ -15,9 +15,10 @@ using namespace wpi::apriltag; TEST(AprilTagJsonTest, DeserializeMatches) { auto layout = AprilTagFieldLayout{ - std::vector{ - AprilTag{1, wpi::math::Pose3d{}}, - AprilTag{3, wpi::math::Pose3d{0_m, 1_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}}}, + std::vector{AprilTag{1, wpi::math::Pose3d{}}, + AprilTag{3, wpi::math::Pose3d{0_m, 1_m, 0_m, + wpi::math::Rotation3d{ + 0_deg, 0_deg, 0_deg}}}}, 54_ft, 27_ft}; AprilTagFieldLayout deserialized; diff --git a/apriltag/src/test/native/cpp/AprilTagPoseSetOriginTest.cpp b/apriltag/src/test/native/cpp/AprilTagPoseSetOriginTest.cpp index 4adb7fc911..c61cc1588d 100644 --- a/apriltag/src/test/native/cpp/AprilTagPoseSetOriginTest.cpp +++ b/apriltag/src/test/native/cpp/AprilTagPoseSetOriginTest.cpp @@ -16,18 +16,21 @@ using namespace wpi::apriltag; TEST(AprilTagPoseSetOriginTest, TransformationMatches) { auto layout = AprilTagFieldLayout{ std::vector{ - AprilTag{1, - wpi::math::Pose3d{0_ft, 0_ft, 0_ft, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}}, AprilTag{ - 2, wpi::math::Pose3d{4_ft, 4_ft, 4_ft, wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}}}}, + 1, wpi::math::Pose3d{0_ft, 0_ft, 0_ft, + wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}}, + AprilTag{2, wpi::math::Pose3d{4_ft, 4_ft, 4_ft, + wpi::math::Rotation3d{0_deg, 0_deg, + 180_deg}}}}, 54_ft, 27_ft}; layout.SetOrigin( AprilTagFieldLayout::OriginPosition::kRedAllianceWallRightSide); - auto mirrorPose = - wpi::math::Pose3d{54_ft, 27_ft, 0_ft, wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}}; + auto mirrorPose = wpi::math::Pose3d{ + 54_ft, 27_ft, 0_ft, wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}}; EXPECT_EQ(mirrorPose, *layout.GetTagPose(1)); - mirrorPose = wpi::math::Pose3d{50_ft, 23_ft, 4_ft, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}; + mirrorPose = wpi::math::Pose3d{50_ft, 23_ft, 4_ft, + wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}; EXPECT_EQ(mirrorPose, *layout.GetTagPose(2)); } diff --git a/apriltag/src/test/native/cpp/LoadConfigTest.cpp b/apriltag/src/test/native/cpp/LoadConfigTest.cpp index a2b54ea818..c9243f60c4 100644 --- a/apriltag/src/test/native/cpp/LoadConfigTest.cpp +++ b/apriltag/src/test/native/cpp/LoadConfigTest.cpp @@ -27,20 +27,23 @@ TEST(AprilTagFieldsTest, TestLoad2022RapidReact) { // Blue Hangar Truss - Hub auto expectedPose = - wpi::math::Pose3d{127.272_in, 216.01_in, 67.932_in, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}; + wpi::math::Pose3d{127.272_in, 216.01_in, 67.932_in, + wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}; auto maybePose = layout.GetTagPose(1); EXPECT_TRUE(maybePose); EXPECT_EQ(expectedPose, *maybePose); // Blue Terminal Near Station - expectedPose = wpi::math::Pose3d{4.768_in, 67.631_in, 35.063_in, + expectedPose = + wpi::math::Pose3d{4.768_in, 67.631_in, 35.063_in, wpi::math::Rotation3d{0_deg, 0_deg, 46.25_deg}}; maybePose = layout.GetTagPose(5); EXPECT_TRUE(maybePose); EXPECT_EQ(expectedPose, *maybePose); // Upper Hub Blue-Near - expectedPose = wpi::math::Pose3d{332.321_in, 183.676_in, 95.186_in, + expectedPose = + wpi::math::Pose3d{332.321_in, 183.676_in, 95.186_in, wpi::math::Rotation3d{0_deg, 26.75_deg, 69_deg}}; maybePose = layout.GetTagPose(53); EXPECT_TRUE(maybePose); diff --git a/cameraserver/multiCameraServer/src/main/native/cpp/main.cpp b/cameraserver/multiCameraServer/src/main/native/cpp/main.cpp index 0682108ce7..a28a5ff219 100644 --- a/cameraserver/multiCameraServer/src/main/native/cpp/main.cpp +++ b/cameraserver/multiCameraServer/src/main/native/cpp/main.cpp @@ -71,8 +71,9 @@ bool ReadCameraConfig(const wpi::util::json& config) { try { c.name = config.at("name").get(); } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "config error in '{}': could not read camera name: {}\n", - configFile, e.what()); + wpi::util::print(stderr, + "config error in '{}': could not read camera name: {}\n", + configFile, e.what()); return false; } @@ -80,9 +81,9 @@ bool ReadCameraConfig(const wpi::util::json& config) { try { c.path = config.at("path").get(); } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, - "config error in '{}': camera '{}': could not read path: {}\n", - configFile, c.name, e.what()); + wpi::util::print( + stderr, "config error in '{}': camera '{}': could not read path: {}\n", + configFile, c.name, e.what()); return false; } @@ -97,7 +98,7 @@ bool ReadConfig() { auto fileBuffer = wpi::util::MemoryBuffer::GetFile(configFile); if (!fileBuffer) { wpi::util::print(stderr, "could not open '{}': {}\n", configFile, - fileBuffer.error().message()); + fileBuffer.error().message()); return false; } @@ -107,14 +108,14 @@ bool ReadConfig() { j = wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()); } catch (const wpi::util::json::parse_error& e) { wpi::util::print(stderr, "config error in '{}': byte {}: {}\n", configFile, - e.byte, e.what()); + e.byte, e.what()); return false; } // top level must be an object if (!j.is_object()) { wpi::util::print(stderr, "config error in '{}': must be JSON object\n", - configFile); + configFile); return false; } @@ -122,8 +123,9 @@ bool ReadConfig() { try { team = j.at("team").get(); } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "config error in '{}': could not read team number: {}\n", - configFile, e.what()); + wpi::util::print(stderr, + "config error in '{}': could not read team number: {}\n", + configFile, e.what()); return false; } @@ -142,8 +144,9 @@ bool ReadConfig() { configFile, str); } } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "config error in '{}': could not read ntmode: {}\n", - configFile, e.what()); + wpi::util::print(stderr, + "config error in '{}': could not read ntmode: {}\n", + configFile, e.what()); } } @@ -155,8 +158,9 @@ bool ReadConfig() { } } } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "config error in '{}': could not read cameras: {}\n", - configFile, e.what()); + wpi::util::print(stderr, + "config error in '{}': could not read cameras: {}\n", + configFile, e.what()); return false; } diff --git a/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp b/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp index f45e1c60c2..0d24e58948 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp @@ -37,9 +37,9 @@ CommandPtr::CommandPtr(CommandPtr&& rhs) { void CommandPtr::AssertValid() const { if (!m_ptr) { - throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Moved-from CommandPtr object used!\nMoved out at:\n{}", - m_moveOutSite); + throw WPILIB_MakeError( + wpi::err::CommandIllegalUse, + "Moved-from CommandPtr object used!\nMoved out at:\n{}", m_moveOutSite); } } diff --git a/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp b/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp index aecb9d395c..7c8ddb7981 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/CommandScheduler.cpp @@ -285,7 +285,7 @@ void CommandScheduler::SetDefaultCommand(Subsystem* subsystem, CommandPtr&& defaultCommand) { if (!defaultCommand.get()->HasRequirement(subsystem)) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, "{}", - "Default commands must require their subsystem!"); + "Default commands must require their subsystem!"); } RequireUngrouped(defaultCommand.get()); @@ -430,11 +430,12 @@ void CommandScheduler::OnCommandFinish(Action action) { void CommandScheduler::RequireUngrouped(const Command* command) { auto stacktrace = command->GetPreviousCompositionSite(); if (stacktrace.has_value()) { - throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Commands that have been composed may not be added to " - "another composition or scheduled individually!" - "\nOriginally composed at:\n{}", - stacktrace.value()); + throw WPILIB_MakeError( + wpi::err::CommandIllegalUse, + "Commands that have been composed may not be added to " + "another composition or scheduled individually!" + "\nOriginally composed at:\n{}", + stacktrace.value()); } } @@ -455,8 +456,8 @@ void CommandScheduler::RequireUngrouped( void CommandScheduler::RequireUngroupedAndUnscheduled(const Command* command) { if (IsScheduled(command)) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Commands that have been scheduled individually may " - "not be added to another composition!"); + "Commands that have been scheduled individually may " + "not be added to another composition!"); } RequireUngrouped(command); } diff --git a/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp b/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp index f6262bbad3..a43da053d8 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp @@ -83,7 +83,8 @@ CommandPtr cmd::DeferredProxy(wpi::util::unique_function supplier) { {}); } -CommandPtr cmd::DeferredProxy(wpi::util::unique_function supplier) { +CommandPtr cmd::DeferredProxy( + wpi::util::unique_function supplier) { return Defer([supplier = std::move( supplier)]() mutable { return supplier().AsProxy(); }, {}); diff --git a/commandsv2/src/main/native/cpp/frc2/command/DeferredCommand.cpp b/commandsv2/src/main/native/cpp/frc2/command/DeferredCommand.cpp index c2f21e9bdf..d8b1ded2c8 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/DeferredCommand.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/DeferredCommand.cpp @@ -11,8 +11,9 @@ using namespace wpi::cmd; -DeferredCommand::DeferredCommand(wpi::util::unique_function supplier, - Requirements requirements) +DeferredCommand::DeferredCommand( + wpi::util::unique_function supplier, + Requirements requirements) : m_supplier{std::move(supplier)} { AddRequirements(requirements); } diff --git a/commandsv2/src/main/native/cpp/frc2/command/ParallelCommandGroup.cpp b/commandsv2/src/main/native/cpp/frc2/command/ParallelCommandGroup.cpp index a4a822acc8..68a9e0bf2b 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/ParallelCommandGroup.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/ParallelCommandGroup.cpp @@ -70,8 +70,8 @@ void ParallelCommandGroup::AddCommands( if (isRunning) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Commands cannot be added to a CommandGroup " - "while the group is running"); + "Commands cannot be added to a CommandGroup " + "while the group is running"); } for (auto&& command : commands) { @@ -86,8 +86,8 @@ void ParallelCommandGroup::AddCommands( m_commands.emplace_back(std::move(command), false); } else { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Multiple commands in a parallel group cannot " - "require the same subsystems"); + "Multiple commands in a parallel group cannot " + "require the same subsystems"); } } } diff --git a/commandsv2/src/main/native/cpp/frc2/command/ParallelDeadlineGroup.cpp b/commandsv2/src/main/native/cpp/frc2/command/ParallelDeadlineGroup.cpp index 07804e9ff9..8da11181c6 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/ParallelDeadlineGroup.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/ParallelDeadlineGroup.cpp @@ -70,8 +70,8 @@ void ParallelDeadlineGroup::AddCommands( if (!m_finished) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Commands cannot be added to a CommandGroup " - "while the group is running"); + "Commands cannot be added to a CommandGroup " + "while the group is running"); } for (auto&& command : commands) { @@ -86,8 +86,8 @@ void ParallelDeadlineGroup::AddCommands( m_commands.emplace_back(std::move(command), false); } else { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Multiple commands in a parallel group cannot " - "require the same subsystems"); + "Multiple commands in a parallel group cannot " + "require the same subsystems"); } } } diff --git a/commandsv2/src/main/native/cpp/frc2/command/ParallelRaceGroup.cpp b/commandsv2/src/main/native/cpp/frc2/command/ParallelRaceGroup.cpp index ad1228eec7..654a5c9d5c 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/ParallelRaceGroup.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/ParallelRaceGroup.cpp @@ -57,8 +57,8 @@ void ParallelRaceGroup::AddCommands( if (isRunning) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Commands cannot be added to a CommandGroup " - "while the group is running"); + "Commands cannot be added to a CommandGroup " + "while the group is running"); } for (auto&& command : commands) { @@ -73,8 +73,8 @@ void ParallelRaceGroup::AddCommands( m_commands.emplace_back(std::move(command)); } else { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Multiple commands in a parallel group cannot " - "require the same subsystems"); + "Multiple commands in a parallel group cannot " + "require the same subsystems"); } } } diff --git a/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp b/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp index 222f38aefc..070711f87d 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/PrintCommand.cpp @@ -11,8 +11,9 @@ using namespace wpi::cmd; PrintCommand::PrintCommand(std::string_view message) - : CommandHelper{[str = std::string(message)] { wpi::util::print("{}\n", str); }, - {}} {} + : CommandHelper{ + [str = std::string(message)] { wpi::util::print("{}\n", str); }, + {}} {} bool PrintCommand::RunsWhenDisabled() const { return true; diff --git a/commandsv2/src/main/native/cpp/frc2/command/SequentialCommandGroup.cpp b/commandsv2/src/main/native/cpp/frc2/command/SequentialCommandGroup.cpp index 295d8a8fe0..7b98b5216a 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/SequentialCommandGroup.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/SequentialCommandGroup.cpp @@ -69,8 +69,8 @@ void SequentialCommandGroup::AddCommands( if (m_currentCommandIndex != invalid_index) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Commands cannot be added to a CommandGroup " - "while the group is running"); + "Commands cannot be added to a CommandGroup " + "while the group is running"); } for (auto&& command : commands) { diff --git a/commandsv2/src/main/native/cpp/frc2/command/button/NetworkButton.cpp b/commandsv2/src/main/native/cpp/frc2/command/button/NetworkButton.cpp index dbcb9943c9..aa2778347a 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/button/NetworkButton.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/button/NetworkButton.cpp @@ -13,16 +13,18 @@ NetworkButton::NetworkButton(wpi::nt::BooleanTopic topic) : NetworkButton(topic.Subscribe(false)) {} NetworkButton::NetworkButton(wpi::nt::BooleanSubscriber sub) - : Trigger([sub = std::make_shared(std::move(sub))] { - return sub->GetTopic().GetInstance().IsConnected() && sub->Get(); - }) {} + : Trigger( + [sub = std::make_shared(std::move(sub))] { + return sub->GetTopic().GetInstance().IsConnected() && sub->Get(); + }) {} NetworkButton::NetworkButton(std::shared_ptr table, std::string_view field) : NetworkButton(table->GetBooleanTopic(field)) {} NetworkButton::NetworkButton(std::string_view table, std::string_view field) - : NetworkButton(wpi::nt::NetworkTableInstance::GetDefault(), table, field) {} + : NetworkButton(wpi::nt::NetworkTableInstance::GetDefault(), table, field) { +} NetworkButton::NetworkButton(wpi::nt::NetworkTableInstance inst, std::string_view table, std::string_view field) diff --git a/commandsv2/src/main/native/include/wpi/commands2/Command.hpp b/commandsv2/src/main/native/include/wpi/commands2/Command.hpp index 4de6c62052..68e9fe2da6 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/Command.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/Command.hpp @@ -37,7 +37,8 @@ namespace wpi::cmd { * @see CommandScheduler * @see CommandHelper */ -class Command : public wpi::util::Sendable, public wpi::util::SendableHelper { +class Command : public wpi::util::Sendable, + public wpi::util::SendableHelper { public: ~Command() override; diff --git a/commandsv2/src/main/native/include/wpi/commands2/CommandScheduler.hpp b/commandsv2/src/main/native/include/wpi/commands2/CommandScheduler.hpp index 95a06a0807..9c9c626af6 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/CommandScheduler.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/CommandScheduler.hpp @@ -34,8 +34,9 @@ class Subsystem; * * This class is provided by the NewCommands VendorDep */ -class CommandScheduler final : public wpi::util::Sendable, - public wpi::util::SendableHelper { +class CommandScheduler final + : public wpi::util::Sendable, + public wpi::util::SendableHelper { public: /** * Returns the Scheduler instance. @@ -213,7 +214,7 @@ class CommandScheduler final : public wpi::util::Sendable, void SetDefaultCommand(Subsystem* subsystem, T&& defaultCommand) { if (!defaultCommand.HasRequirement(subsystem)) { throw WPILIB_MakeError(wpi::err::CommandIllegalUse, - "Default commands must require their subsystem!"); + "Default commands must require their subsystem!"); } SetDefaultCommandImpl(subsystem, std::make_unique>( std::forward(defaultCommand))); diff --git a/commandsv2/src/main/native/include/wpi/commands2/sysid/SysIdRoutine.hpp b/commandsv2/src/main/native/include/wpi/commands2/sysid/SysIdRoutine.hpp index c555199338..9b78ee611f 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/sysid/SysIdRoutine.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/sysid/SysIdRoutine.hpp @@ -16,8 +16,8 @@ namespace wpi::cmd::sysid { -using ramp_rate_t = wpi::units::unit_t< - wpi::units::compound_unit>>; +using ramp_rate_t = wpi::units::unit_t>>; /** Hardware-independent configuration for a SysId test routine. */ class Config { diff --git a/commandsv2/src/test/native/cpp/wpi/command/AddRequirementsTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/AddRequirementsTest.cpp index e1fd07592d..e87fdca969 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/AddRequirementsTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/AddRequirementsTest.cpp @@ -15,7 +15,8 @@ using namespace wpi::cmd; class MockAddRequirements { public: MOCK_METHOD(void, AddRequirements, (Requirements), ()); - MOCK_METHOD(void, AddRequirements, ((wpi::util::SmallSet)), ()); + MOCK_METHOD(void, AddRequirements, ((wpi::util::SmallSet)), + ()); MOCK_METHOD(void, AddRequirements, (Subsystem*), ()); }; @@ -44,8 +45,9 @@ TEST(AddRequirementsTest, SmallSetOverloadResolution) { MockAddRequirements overloadResolver; - EXPECT_CALL(overloadResolver, - AddRequirements(testing::An>())); + EXPECT_CALL( + overloadResolver, + AddRequirements(testing::An>())); overloadResolver.AddRequirements(requirementsSet); } @@ -85,7 +87,7 @@ TEST(AddRequirementsTest, SpanSemantics) { TestSubsystem requirement2; wpi::util::array requirementsArray(&requirement1, - &requirement2); + &requirement2); RunCommand command([] {}); command.AddRequirements(std::span{requirementsArray}); @@ -97,7 +99,8 @@ TEST(AddRequirementsTest, SpanSemantics) { TEST(AddRequirementsTest, SpanDuplicatesSemantics) { TestSubsystem requirement; - wpi::util::array requirementsArray(&requirement, &requirement); + wpi::util::array requirementsArray(&requirement, + &requirement); RunCommand command([] {}); command.AddRequirements(std::span{requirementsArray}); diff --git a/commandsv2/src/test/native/cpp/wpi/command/SchedulerTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/SchedulerTest.cpp index 0082578dbb..cfdf03b828 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/SchedulerTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/SchedulerTest.cpp @@ -202,8 +202,9 @@ TEST_F(SchedulerTest, ScheduleCommandPtr) { { auto commandPtr = TrackDestroyCommand([&destructionCounter] { destructionCounter++; }) - .AlongWith( - wpi::cmd::InstantCommand([&runCounter] { runCounter++; }).ToPtr()) + .AlongWith(wpi::cmd::InstantCommand([&runCounter] { + runCounter++; + }).ToPtr()) .Until([&finish] { return finish; }); EXPECT_EQ(destructionCounter, 0) << "Composition should not delete command"; diff --git a/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp index e76e5ca57b..b925e44100 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/button/NetworkButtonTest.cpp @@ -20,7 +20,9 @@ class NetworkButtonTest : public CommandTestBase { inst.StartLocal(); } - ~NetworkButtonTest() override { wpi::nt::NetworkTableInstance::Destroy(inst); } + ~NetworkButtonTest() override { + wpi::nt::NetworkTableInstance::Destroy(inst); + } wpi::nt::NetworkTableInstance inst; }; diff --git a/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp b/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp index f88893870f..6e9c79b463 100644 --- a/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp +++ b/commandsv2/src/test/native/cpp/wpi/command/sysid/SysIdRoutineTest.cpp @@ -75,9 +75,10 @@ class SysIdRoutineTest : public ::testing::Test { m_sysidRoutine.Dynamic(wpi::cmd::sysid::Direction::kReverse)}; wpi::cmd::sysid::SysIdRoutine m_emptySysidRoutine{ - wpi::cmd::sysid::Config{std::nullopt, std::nullopt, std::nullopt, nullptr}, - wpi::cmd::sysid::Mechanism{[](wpi::units::volt_t driveVoltage) {}, nullptr, - &m_subsystem}}; + wpi::cmd::sysid::Config{std::nullopt, std::nullopt, std::nullopt, + nullptr}, + wpi::cmd::sysid::Mechanism{[](wpi::units::volt_t driveVoltage) {}, + nullptr, &m_subsystem}}; wpi::cmd::CommandPtr m_emptyRoutineForward{ m_emptySysidRoutine.Quasistatic(wpi::cmd::sysid::Direction::kForward)}; diff --git a/cscore/examples/enum_usb/enum_usb.cpp b/cscore/examples/enum_usb/enum_usb.cpp index 7c4cee7236..837e87d45c 100644 --- a/cscore/examples/enum_usb/enum_usb.cpp +++ b/cscore/examples/enum_usb/enum_usb.cpp @@ -27,12 +27,12 @@ int main() { switch (prop.GetKind()) { case wpi::cs::VideoProperty::kBoolean: wpi::util::print(" (bool): value={} default={}", prop.Get(), - prop.GetDefault()); + prop.GetDefault()); break; case wpi::cs::VideoProperty::kInteger: wpi::util::print(" (int): value={} min={} max={} step={} default={}", - prop.Get(), prop.GetMin(), prop.GetMax(), prop.GetStep(), - prop.GetDefault()); + prop.Get(), prop.GetMin(), prop.GetMax(), + prop.GetStep(), prop.GetDefault()); break; case wpi::cs::VideoProperty::kString: wpi::util::print(" (string): {}", prop.GetString()); @@ -70,8 +70,8 @@ int main() { pixelFormat = "Unknown"; break; } - wpi::util::print(" PixelFormat:{} Width:{} Height:{} FPS:{}\n", pixelFormat, - mode.width, mode.height, mode.fps); + wpi::util::print(" PixelFormat:{} Width:{} Height:{} FPS:{}\n", + pixelFormat, mode.width, mode.height, mode.fps); } } } diff --git a/cscore/examples/httpcvstream/httpcvstream.cpp b/cscore/examples/httpcvstream/httpcvstream.cpp index 508fecf445..2008bac3e1 100644 --- a/cscore/examples/httpcvstream/httpcvstream.cpp +++ b/cscore/examples/httpcvstream/httpcvstream.cpp @@ -15,7 +15,8 @@ int main() { camera.SetVideoMode(wpi::cs::VideoMode::kMJPEG, 320, 240, 30); wpi::cs::CvSink cvsink{"cvsink"}; cvsink.SetSource(camera); - wpi::cs::CvSource cvsource{"cvsource", wpi::cs::VideoMode::kMJPEG, 320, 240, 30}; + wpi::cs::CvSource cvsource{"cvsource", wpi::cs::VideoMode::kMJPEG, 320, 240, + 30}; wpi::cs::MjpegServer cvMjpegServer{"cvhttpserver", 8083}; cvMjpegServer.SetSource(cvsource); @@ -27,8 +28,8 @@ int main() { wpi::util::print("error: {}\n", cvsink.GetError()); continue; } - wpi::util::print("got frame at time {} size ({}, {})\n", time, test.size().width, - test.size().height); + wpi::util::print("got frame at time {} size ({}, {})\n", time, + test.size().width, test.size().height); cv::flip(test, flip, 0); cvsource.PutFrame(flip); } diff --git a/cscore/examples/settings/settings.cpp b/cscore/examples/settings/settings.cpp index 2e1ac6b6ab..77a89da6e7 100644 --- a/cscore/examples/settings/settings.cpp +++ b/cscore/examples/settings/settings.cpp @@ -76,12 +76,12 @@ int main(int argc, char** argv) { switch (prop.GetKind()) { case wpi::cs::VideoProperty::kBoolean: wpi::util::print(" (bool): value={} default={}", prop.Get(), - prop.GetDefault()); + prop.GetDefault()); break; case wpi::cs::VideoProperty::kInteger: wpi::util::print(" (int): value={} min={} max={} step={} default={}", - prop.Get(), prop.GetMin(), prop.GetMax(), prop.GetStep(), - prop.GetDefault()); + prop.Get(), prop.GetMin(), prop.GetMax(), + prop.GetStep(), prop.GetDefault()); break; case wpi::cs::VideoProperty::kString: wpi::util::print(" (string): {}", prop.GetString()); diff --git a/cscore/examples/usbcvstream/usbcvstream.cpp b/cscore/examples/usbcvstream/usbcvstream.cpp index 34f6ac04eb..945ea25315 100644 --- a/cscore/examples/usbcvstream/usbcvstream.cpp +++ b/cscore/examples/usbcvstream/usbcvstream.cpp @@ -14,7 +14,8 @@ int main() { mjpegServer.SetSource(camera); wpi::cs::CvSink cvsink{"cvsink"}; cvsink.SetSource(camera); - wpi::cs::CvSource cvsource{"cvsource", wpi::cs::VideoMode::kMJPEG, 320, 240, 30}; + wpi::cs::CvSource cvsource{"cvsource", wpi::cs::VideoMode::kMJPEG, 320, 240, + 30}; wpi::cs::MjpegServer cvMjpegServer{"cvhttpserver", 8082}; cvMjpegServer.SetSource(cvsource); @@ -26,8 +27,8 @@ int main() { wpi::util::print("error: {}\n", cvsink.GetError()); continue; } - wpi::util::print("got frame at time {} size ({}, {})\n", time, test.size().width, - test.size().height); + wpi::util::print("got frame at time {} size ({}, {})\n", time, + test.size().width, test.size().height); cv::flip(test, flip, 0); cvsource.PutFrame(flip); } diff --git a/cscore/examples/usbstream/usbstream.cpp b/cscore/examples/usbstream/usbstream.cpp index eea7bd3b38..72f543e0cc 100644 --- a/cscore/examples/usbstream/usbstream.cpp +++ b/cscore/examples/usbstream/usbstream.cpp @@ -22,7 +22,7 @@ int main() { wpi::cs::AddListener( [&](const wpi::cs::RawEvent& event) { wpi::util::print("FPS={} MBPS={}\n", camera.GetActualFPS(), - (camera.GetActualDataRate() / 1000000.0)); + (camera.GetActualDataRate() / 1000000.0)); }, wpi::cs::RawEvent::kTelemetryUpdated, false, &status); wpi::cs::SetTelemetryPeriod(1.0); diff --git a/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp b/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp index 1f65955d7a..2290f94a37 100644 --- a/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp +++ b/cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp @@ -200,7 +200,8 @@ void SetSourceEnumPropertyChoices(CS_Source source, CS_Property property, extern "C" { void CS_NotifySourceError(CS_Source source, const struct WPI_String* msg, CS_Status* status) { - return wpi::cs::NotifySourceError(source, wpi::util::to_string_view(msg), status); + return wpi::cs::NotifySourceError(source, wpi::util::to_string_view(msg), + status); } void CS_SetSourceConnected(CS_Source source, CS_Bool connected, @@ -211,8 +212,8 @@ void CS_SetSourceConnected(CS_Source source, CS_Bool connected, void CS_SetSourceDescription(CS_Source source, const struct WPI_String* description, CS_Status* status) { - return wpi::cs::SetSourceDescription(source, wpi::util::to_string_view(description), - status); + return wpi::cs::SetSourceDescription( + source, wpi::util::to_string_view(description), status); } CS_Property CS_CreateSourceProperty(CS_Source source, @@ -220,9 +221,9 @@ CS_Property CS_CreateSourceProperty(CS_Source source, enum CS_PropertyKind kind, int minimum, int maximum, int step, int defaultValue, int value, CS_Status* status) { - return wpi::cs::CreateSourceProperty(source, wpi::util::to_string_view(name), kind, - minimum, maximum, step, defaultValue, value, - status); + return wpi::cs::CreateSourceProperty(source, wpi::util::to_string_view(name), + kind, minimum, maximum, step, + defaultValue, value, status); } CS_Property CS_CreateSourcePropertyCallback( diff --git a/cscore/src/main/native/cpp/Frame.cpp b/cscore/src/main/native/cpp/Frame.cpp index 6d21969550..61e2c42f59 100644 --- a/cscore/src/main/native/cpp/Frame.cpp +++ b/cscore/src/main/native/cpp/Frame.cpp @@ -803,9 +803,9 @@ void Frame::ReleaseFrame() { } namespace wpi::cs { -std::unique_ptr CreateImageFromBGRA(wpi::cs::SourceImpl* source, size_t width, - size_t height, size_t stride, - const uint8_t* data) { +std::unique_ptr CreateImageFromBGRA(wpi::cs::SourceImpl* source, + size_t width, size_t height, + size_t stride, const uint8_t* data) { cv::Mat finalImage{static_cast(height), static_cast(width), CV_8UC4, const_cast(data), stride}; std::unique_ptr dest = source->AllocImage( diff --git a/cscore/src/main/native/cpp/Frame.hpp b/cscore/src/main/native/cpp/Frame.hpp index 5552a2fce9..51971027a6 100644 --- a/cscore/src/main/native/cpp/Frame.hpp +++ b/cscore/src/main/native/cpp/Frame.hpp @@ -21,9 +21,9 @@ namespace wpi::cs { class SourceImpl; -std::unique_ptr CreateImageFromBGRA(wpi::cs::SourceImpl* source, size_t width, - size_t height, size_t stride, - const uint8_t* data); +std::unique_ptr CreateImageFromBGRA(wpi::cs::SourceImpl* source, + size_t width, size_t height, + size_t stride, const uint8_t* data); class Frame { friend class SourceImpl; diff --git a/cscore/src/main/native/cpp/HttpCameraImpl.cpp b/cscore/src/main/native/cpp/HttpCameraImpl.cpp index 342c981f49..ca0264665f 100644 --- a/cscore/src/main/native/cpp/HttpCameraImpl.cpp +++ b/cscore/src/main/native/cpp/HttpCameraImpl.cpp @@ -164,7 +164,8 @@ wpi::net::HttpConnection* HttpCameraImpl::DeviceStreamConnect( if (m_nextLocation >= m_locations.size()) { m_nextLocation = 0; } - req = wpi::net::HttpRequest{m_locations[m_nextLocation++], m_streamSettings}; + req = + wpi::net::HttpRequest{m_locations[m_nextLocation++], m_streamSettings}; m_streamSettingsUpdated = false; } @@ -176,7 +177,8 @@ wpi::net::HttpConnection* HttpCameraImpl::DeviceStreamConnect( return nullptr; } - auto connPtr = std::make_unique(std::move(stream), 1); + auto connPtr = + std::make_unique(std::move(stream), 1); wpi::net::HttpConnection* conn = connPtr.get(); // update m_streamConn @@ -195,7 +197,8 @@ wpi::net::HttpConnection* HttpCameraImpl::DeviceStreamConnect( } // Parse Content-Type header to get the boundary - auto [mediaType, contentType] = wpi::util::split(conn->contentType.str(), ';'); + auto [mediaType, contentType] = + wpi::util::split(conn->contentType.str(), ';'); mediaType = wpi::util::trim(mediaType); if (mediaType != "multipart/x-mixed-replace") { SWARNING("\"{}\": unrecognized Content-Type \"{}\"", req.host.str(), @@ -213,7 +216,8 @@ wpi::net::HttpConnection* HttpCameraImpl::DeviceStreamConnect( contentType = wpi::util::ltrim(contentType); auto [key, value] = wpi::util::split(keyvalue, '='); if (wpi::util::trim(key) == "boundary") { - value = wpi::util::trim(wpi::util::trim(value), '"'); // value may be quoted + value = + wpi::util::trim(wpi::util::trim(value), '"'); // value may be quoted if (wpi::util::starts_with(value, "--")) { value = wpi::util::substr(value, 2); } @@ -369,7 +373,8 @@ void HttpCameraImpl::DeviceSendSettings(wpi::net::HttpRequest& req) { return; } - auto connPtr = std::make_unique(std::move(stream), 1); + auto connPtr = + std::make_unique(std::move(stream), 1); wpi::net::HttpConnection* conn = connPtr.get(); // update m_settingsConn @@ -653,7 +658,8 @@ CS_Source CS_CreateHttpCamera(const struct WPI_String* name, const struct WPI_String* url, CS_HttpCameraKind kind, CS_Status* status) { return wpi::cs::CreateHttpCamera(wpi::util::to_string_view(name), - wpi::util::to_string_view(url), kind, status); + wpi::util::to_string_view(url), kind, + status); } CS_Source CS_CreateHttpCameraMulti(const struct WPI_String* name, @@ -664,7 +670,8 @@ CS_Source CS_CreateHttpCameraMulti(const struct WPI_String* name, for (int i = 0; i < count; ++i) { vec.emplace_back(wpi::util::to_string_view(&urls[i])); } - return wpi::cs::CreateHttpCamera(wpi::util::to_string_view(name), vec, kind, status); + return wpi::cs::CreateHttpCamera(wpi::util::to_string_view(name), vec, kind, + status); } CS_HttpCameraKind CS_GetHttpCameraKind(CS_Source source, CS_Status* status) { diff --git a/cscore/src/main/native/cpp/HttpCameraImpl.hpp b/cscore/src/main/native/cpp/HttpCameraImpl.hpp index 0a5e1e6080..18659701a6 100644 --- a/cscore/src/main/native/cpp/HttpCameraImpl.hpp +++ b/cscore/src/main/native/cpp/HttpCameraImpl.hpp @@ -28,7 +28,8 @@ namespace wpi::cs { class HttpCameraImpl : public SourceImpl { public: HttpCameraImpl(std::string_view name, CS_HttpCameraKind kind, - wpi::util::Logger& logger, Notifier& notifier, Telemetry& telemetry); + wpi::util::Logger& logger, Notifier& notifier, + Telemetry& telemetry); ~HttpCameraImpl() override; void Start() override; @@ -146,8 +147,8 @@ class HttpCameraImpl : public SourceImpl { class AxisCameraImpl : public HttpCameraImpl { public: - AxisCameraImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry) + AxisCameraImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry) : HttpCameraImpl{name, CS_HTTP_AXIS, logger, notifier, telemetry} {} #if 0 void SetProperty(int property, int value, CS_Status* status) override; diff --git a/cscore/src/main/native/cpp/Instance.cpp b/cscore/src/main/native/cpp/Instance.cpp index e4baccbddb..1a69753a25 100644 --- a/cscore/src/main/native/cpp/Instance.cpp +++ b/cscore/src/main/native/cpp/Instance.cpp @@ -33,8 +33,8 @@ static void def_log_func(unsigned int level, const char* file, return; } wpi::util::print(stderr, "CS: {}: {} ({}:{})\n", levelmsg, msg, - // NOLINTNEXTLINE(build/include_what_you_use) - fs::path{file}.filename().string(), line); + // NOLINTNEXTLINE(build/include_what_you_use) + fs::path{file}.filename().string(), line); } Instance::Instance() diff --git a/cscore/src/main/native/cpp/Instance.hpp b/cscore/src/main/native/cpp/Instance.hpp index 93224e56bf..4e3e52a0a0 100644 --- a/cscore/src/main/native/cpp/Instance.hpp +++ b/cscore/src/main/native/cpp/Instance.hpp @@ -91,12 +91,13 @@ class Instance { return m_sources.GetAll(vec); } - std::span EnumerateSinkHandles(wpi::util::SmallVectorImpl& vec) { + std::span EnumerateSinkHandles( + wpi::util::SmallVectorImpl& vec) { return m_sinks.GetAll(vec); } - std::span EnumerateSourceSinks(CS_Source source, - wpi::util::SmallVectorImpl& vec) { + std::span EnumerateSourceSinks( + CS_Source source, wpi::util::SmallVectorImpl& vec) { vec.clear(); m_sinks.ForEach([&](CS_Sink sinkHandle, const SinkData& data) { if (source == data.sourceHandle.load()) { diff --git a/cscore/src/main/native/cpp/JpegUtil.cpp b/cscore/src/main/native/cpp/JpegUtil.cpp index 90e6c6c446..cf0c7d9016 100644 --- a/cscore/src/main/native/cpp/JpegUtil.cpp +++ b/cscore/src/main/native/cpp/JpegUtil.cpp @@ -146,7 +146,8 @@ static inline void ReadInto(wpi::util::raw_istream& is, std::string& buf, is.read(&(*buf.begin()) + oldSize, len); } -bool ReadJpeg(wpi::util::raw_istream& is, std::string& buf, int* width, int* height) { +bool ReadJpeg(wpi::util::raw_istream& is, std::string& buf, int* width, + int* height) { // in case we don't get a SOF *width = 0; *height = 0; diff --git a/cscore/src/main/native/cpp/JpegUtil.hpp b/cscore/src/main/native/cpp/JpegUtil.hpp index 16bf34d683..43560b6b24 100644 --- a/cscore/src/main/native/cpp/JpegUtil.hpp +++ b/cscore/src/main/native/cpp/JpegUtil.hpp @@ -10,7 +10,7 @@ namespace wpi::util { class raw_istream; -} // namespace wpi +} // namespace wpi::util namespace wpi::cs { @@ -22,7 +22,8 @@ bool JpegNeedsDHT(const char* data, size_t* size, size_t* locSOF); std::string_view JpegGetDHT(); -bool ReadJpeg(wpi::util::raw_istream& is, std::string& buf, int* width, int* height); +bool ReadJpeg(wpi::util::raw_istream& is, std::string& buf, int* width, + int* height); } // namespace wpi::cs diff --git a/cscore/src/main/native/cpp/Log.cpp b/cscore/src/main/native/cpp/Log.cpp index 4bde2d2ee2..5c0293f51f 100644 --- a/cscore/src/main/native/cpp/Log.cpp +++ b/cscore/src/main/native/cpp/Log.cpp @@ -4,9 +4,10 @@ #include "Log.hpp" -void wpi::cs::NamedLogV(wpi::util::Logger& logger, unsigned int level, const char* file, - unsigned int line, std::string_view name, - fmt::string_view format, fmt::format_args args) { +void wpi::cs::NamedLogV(wpi::util::Logger& logger, unsigned int level, + const char* file, unsigned int line, + std::string_view name, fmt::string_view format, + fmt::format_args args) { fmt::memory_buffer out; fmt::format_to(fmt::appender{out}, "{}: ", name); fmt::vformat_to(fmt::appender{out}, format, args); diff --git a/cscore/src/main/native/cpp/Log.hpp b/cscore/src/main/native/cpp/Log.hpp index cff3606199..b0dd9fc034 100644 --- a/cscore/src/main/native/cpp/Log.hpp +++ b/cscore/src/main/native/cpp/Log.hpp @@ -16,9 +16,9 @@ void NamedLogV(wpi::util::Logger& logger, unsigned int level, const char* file, fmt::string_view format, fmt::format_args args); template -inline void NamedLog(wpi::util::Logger& logger, unsigned int level, const char* file, - unsigned int line, std::string_view name, const S& format, - Args&&... args) { +inline void NamedLog(wpi::util::Logger& logger, unsigned int level, + const char* file, unsigned int line, std::string_view name, + const S& format, Args&&... args) { if (logger.HasLogger() && level >= logger.min_level()) { NamedLogV(logger, level, file, line, name, format, fmt::make_format_args(args...)); diff --git a/cscore/src/main/native/cpp/MjpegServerImpl.cpp b/cscore/src/main/native/cpp/MjpegServerImpl.cpp index c3f0292586..3ea6b1afd9 100644 --- a/cscore/src/main/native/cpp/MjpegServerImpl.cpp +++ b/cscore/src/main/native/cpp/MjpegServerImpl.cpp @@ -362,9 +362,9 @@ void MjpegServerImpl::ConnThread::SendHTML(wpi::util::raw_ostream& os, switch (kind) { case CS_PROP_BOOLEAN: wpi::util::print(os, - "\n"; } else { @@ -377,12 +377,12 @@ void MjpegServerImpl::ConnThread::SendHTML(wpi::util::raw_ostream& os, auto max = source.GetPropertyMax(prop, &status); auto step = source.GetPropertyStep(prop, &status); wpi::util::print(os, - "\n", - name, min, max, valI, step); - wpi::util::print(os, "{1}\n", name, - valI); + "\n", + name, min, max, valI, step); + wpi::util::print(os, "{1}\n", + name, valI); break; } case CS_PROP_ENUM: { @@ -400,27 +400,28 @@ void MjpegServerImpl::ConnThread::SendHTML(wpi::util::raw_ostream& os, ch_name.push_back(wpi::util::isPrint(ch) ? ch : ' '); } wpi::util::print(os, - "\n", name, j, - ch_name.str()); + ch_name.str()); } break; } case CS_PROP_STRING: { wpi::util::SmallString<128> strval_buf; wpi::util::print(os, - "\n", - name, source.GetStringProperty(prop, strval_buf, &status)); + "\n", + name, + source.GetStringProperty(prop, strval_buf, &status)); wpi::util::print(os, - "\n", - name); + "\n", + name); break; } default: @@ -473,8 +474,8 @@ void MjpegServerImpl::ConnThread::SendHTML(wpi::util::raw_ostream& os, os << "unknown"; break; } - wpi::util::print(os, "{}{}{}", mode.width, - mode.height, mode.fps); + wpi::util::print(os, "{}{}{}", + mode.width, mode.height, mode.fps); } os << "\n"; os << endRootPage << "\r\n"; @@ -505,12 +506,14 @@ void MjpegServerImpl::ConnThread::SendJSON(wpi::util::raw_ostream& os, wpi::util::print(os, "\n\"name\": \"{}\"", name); wpi::util::print(os, ",\n\"id\": \"{}\"", prop); wpi::util::print(os, ",\n\"type\": \"{}\"", static_cast(kind)); - wpi::util::print(os, ",\n\"min\": \"{}\"", source.GetPropertyMin(prop, &status)); - wpi::util::print(os, ",\n\"max\": \"{}\"", source.GetPropertyMax(prop, &status)); + wpi::util::print(os, ",\n\"min\": \"{}\"", + source.GetPropertyMin(prop, &status)); + wpi::util::print(os, ",\n\"max\": \"{}\"", + source.GetPropertyMax(prop, &status)); wpi::util::print(os, ",\n\"step\": \"{}\"", - source.GetPropertyStep(prop, &status)); + source.GetPropertyStep(prop, &status)); wpi::util::print(os, ",\n\"default\": \"{}\"", - source.GetPropertyDefault(prop, &status)); + source.GetPropertyDefault(prop, &status)); os << ",\n\"value\": \""; switch (kind) { case CS_PROP_BOOLEAN: @@ -597,10 +600,10 @@ void MjpegServerImpl::ConnThread::SendJSON(wpi::util::raw_ostream& os, os.flush(); } -MjpegServerImpl::MjpegServerImpl(std::string_view name, wpi::util::Logger& logger, - Notifier& notifier, Telemetry& telemetry, - std::string_view listenAddress, int port, - std::unique_ptr acceptor) +MjpegServerImpl::MjpegServerImpl( + std::string_view name, wpi::util::Logger& logger, Notifier& notifier, + Telemetry& telemetry, std::string_view listenAddress, int port, + std::unique_ptr acceptor) : SinkImpl{name, logger, notifier, telemetry}, m_listenAddress(listenAddress), m_port(port), @@ -813,14 +816,17 @@ void MjpegServerImpl::ConnThread::ProcessRequest() { // compatibility, others are for Axis camera compatibility. if ((pos = req.find("POST /stream")) != std::string_view::npos) { kind = kStream; - parameters = wpi::util::substr(wpi::util::substr(req, req.find('?', pos + 12)), 1); + parameters = + wpi::util::substr(wpi::util::substr(req, req.find('?', pos + 12)), 1); } else if ((pos = req.find("GET /?action=stream")) != std::string_view::npos) { kind = kStream; - parameters = wpi::util::substr(wpi::util::substr(req, req.find('&', pos + 19)), 1); + parameters = + wpi::util::substr(wpi::util::substr(req, req.find('&', pos + 19)), 1); } else if ((pos = req.find("GET /stream.mjpg")) != std::string_view::npos) { kind = kStream; - parameters = wpi::util::substr(wpi::util::substr(req, req.find('?', pos + 16)), 1); + parameters = + wpi::util::substr(wpi::util::substr(req, req.find('?', pos + 16)), 1); } else if (req.find("GET /settings") != std::string_view::npos && req.find(".json") != std::string_view::npos) { kind = kGetSettings; @@ -836,7 +842,8 @@ void MjpegServerImpl::ConnThread::ProcessRequest() { } else if ((pos = req.find("GET /?action=command")) != std::string_view::npos) { kind = kCommand; - parameters = wpi::util::substr(wpi::util::substr(req, req.find('&', pos + 20)), 1); + parameters = + wpi::util::substr(wpi::util::substr(req, req.find('&', pos + 20)), 1); } else if (req.find("GET / ") != std::string_view::npos || req == "GET /\n") { kind = kRootPage; } else { @@ -959,11 +966,12 @@ void MjpegServerImpl::ServerThreadMain() { std::scoped_lock lock(m_mutex); // Find unoccupied worker thread, or create one if necessary - auto it = std::find_if(m_connThreads.begin(), m_connThreads.end(), - [](const wpi::util::SafeThreadOwner& owner) { - auto thr = owner.GetThread(); - return !thr || !thr->m_stream; - }); + auto it = + std::find_if(m_connThreads.begin(), m_connThreads.end(), + [](const wpi::util::SafeThreadOwner& owner) { + auto thr = owner.GetThread(); + return !thr || !thr->m_stream; + }); if (it == m_connThreads.end()) { m_connThreads.emplace_back(); it = std::prev(m_connThreads.end()); @@ -1052,13 +1060,14 @@ CS_Sink CS_CreateMjpegServer(const struct WPI_String* name, const struct WPI_String* listenAddress, int port, CS_Status* status) { return wpi::cs::CreateMjpegServer(wpi::util::to_string_view(name), - wpi::util::to_string_view(listenAddress), port, - status); + wpi::util::to_string_view(listenAddress), + port, status); } void CS_GetMjpegServerListenAddress(CS_Sink sink, WPI_String* listenAddress, CS_Status* status) { - wpi::cs::ConvertToC(listenAddress, wpi::cs::GetMjpegServerListenAddress(sink, status)); + wpi::cs::ConvertToC(listenAddress, + wpi::cs::GetMjpegServerListenAddress(sink, status)); } int CS_GetMjpegServerPort(CS_Sink sink, CS_Status* status) { diff --git a/cscore/src/main/native/cpp/Notifier.hpp b/cscore/src/main/native/cpp/Notifier.hpp index 580c5ca623..2ee7b605a6 100644 --- a/cscore/src/main/native/cpp/Notifier.hpp +++ b/cscore/src/main/native/cpp/Notifier.hpp @@ -53,7 +53,8 @@ class NotifierThread } // namespace impl -class Notifier : public wpi::util::CallbackManager { +class Notifier + : public wpi::util::CallbackManager { friend class NotifierTest; public: diff --git a/cscore/src/main/native/cpp/PropertyContainer.cpp b/cscore/src/main/native/cpp/PropertyContainer.cpp index 0a2d2d8cb3..d57471b8ed 100644 --- a/cscore/src/main/native/cpp/PropertyContainer.cpp +++ b/cscore/src/main/native/cpp/PropertyContainer.cpp @@ -59,7 +59,8 @@ CS_PropertyKind PropertyContainer::GetPropertyKind(int property) const { } std::string_view PropertyContainer::GetPropertyName( - int property, wpi::util::SmallVectorImpl& buf, CS_Status* status) const { + int property, wpi::util::SmallVectorImpl& buf, + CS_Status* status) const { if (!m_properties_cached && !CacheProperties(status)) { return {}; } @@ -168,7 +169,8 @@ int PropertyContainer::GetPropertyDefault(int property, } std::string_view PropertyContainer::GetStringProperty( - int property, wpi::util::SmallVectorImpl& buf, CS_Status* status) const { + int property, wpi::util::SmallVectorImpl& buf, + CS_Status* status) const { if (!m_properties_cached && !CacheProperties(status)) { return {}; } diff --git a/cscore/src/main/native/cpp/PropertyContainer.hpp b/cscore/src/main/native/cpp/PropertyContainer.hpp index 4cf95ea321..71ef872631 100644 --- a/cscore/src/main/native/cpp/PropertyContainer.hpp +++ b/cscore/src/main/native/cpp/PropertyContainer.hpp @@ -23,7 +23,7 @@ namespace wpi::util { class Logger; template class SmallVectorImpl; -} // namespace wpi +} // namespace wpi::util namespace wpi::cs { @@ -52,8 +52,9 @@ class PropertyContainer { std::vector GetEnumPropertyChoices(int property, CS_Status* status) const; - bool SetPropertiesJson(const wpi::util::json& config, wpi::util::Logger& logger, - std::string_view logName, CS_Status* status); + bool SetPropertiesJson(const wpi::util::json& config, + wpi::util::Logger& logger, std::string_view logName, + CS_Status* status); wpi::util::json GetPropertiesJsonObject(CS_Status* status); protected: diff --git a/cscore/src/main/native/cpp/RawSinkImpl.cpp b/cscore/src/main/native/cpp/RawSinkImpl.cpp index b6fa170c78..eaf205aa4e 100644 --- a/cscore/src/main/native/cpp/RawSinkImpl.cpp +++ b/cscore/src/main/native/cpp/RawSinkImpl.cpp @@ -233,8 +233,8 @@ uint64_t CS_GrabRawSinkFrameTimeoutWithFrameTime(CS_Sink sink, double timeout, uint64_t lastFrameTime, CS_Status* status) { - return wpi::cs::GrabSinkFrameTimeoutLastTime(sink, *image, timeout, lastFrameTime, - status); + return wpi::cs::GrabSinkFrameTimeoutLastTime(sink, *image, timeout, + lastFrameTime, status); } } // extern "C" diff --git a/cscore/src/main/native/cpp/RawSinkImpl.hpp b/cscore/src/main/native/cpp/RawSinkImpl.hpp index 3e923181d2..8ffc75b197 100644 --- a/cscore/src/main/native/cpp/RawSinkImpl.hpp +++ b/cscore/src/main/native/cpp/RawSinkImpl.hpp @@ -22,10 +22,10 @@ class SourceImpl; class RawSinkImpl : public SinkImpl { public: - RawSinkImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry); - RawSinkImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry, + RawSinkImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry); + RawSinkImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry, std::function processFrame); ~RawSinkImpl() override; diff --git a/cscore/src/main/native/cpp/RawSourceImpl.cpp b/cscore/src/main/native/cpp/RawSourceImpl.cpp index edf4d7e961..b401c43f63 100644 --- a/cscore/src/main/native/cpp/RawSourceImpl.cpp +++ b/cscore/src/main/native/cpp/RawSourceImpl.cpp @@ -55,7 +55,8 @@ extern "C" { CS_Source CS_CreateRawSource(const struct WPI_String* name, CS_Bool isCv, const CS_VideoMode* mode, CS_Status* status) { return wpi::cs::CreateRawSource(wpi::util::to_string_view(name), isCv, - static_cast(*mode), status); + static_cast(*mode), + status); } void CS_PutRawSourceFrame(CS_Source source, const struct WPI_RawFrame* image, diff --git a/cscore/src/main/native/cpp/RawSourceImpl.hpp b/cscore/src/main/native/cpp/RawSourceImpl.hpp index 37aec634d2..e5ad762a6a 100644 --- a/cscore/src/main/native/cpp/RawSourceImpl.hpp +++ b/cscore/src/main/native/cpp/RawSourceImpl.hpp @@ -20,8 +20,9 @@ namespace wpi::cs { class RawSourceImpl : public ConfigurableSourceImpl { public: - RawSourceImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry, const VideoMode& mode); + RawSourceImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry, + const VideoMode& mode); ~RawSourceImpl() override; // Raw-specific functions diff --git a/cscore/src/main/native/cpp/SinkImpl.cpp b/cscore/src/main/native/cpp/SinkImpl.cpp index 847cbcffae..132769c477 100644 --- a/cscore/src/main/native/cpp/SinkImpl.cpp +++ b/cscore/src/main/native/cpp/SinkImpl.cpp @@ -113,7 +113,8 @@ std::string SinkImpl::GetError() const { return std::string{m_source->GetCurFrame().GetError()}; } -std::string_view SinkImpl::GetError(wpi::util::SmallVectorImpl& buf) const { +std::string_view SinkImpl::GetError( + wpi::util::SmallVectorImpl& buf) const { std::scoped_lock lock(m_mutex); if (!m_source) { return "no source connected"; @@ -221,7 +222,8 @@ std::string GetSinkError(CS_Sink sink, CS_Status* status) { return data->sink->GetError(); } -std::string_view GetSinkError(CS_Sink sink, wpi::util::SmallVectorImpl& buf, +std::string_view GetSinkError(CS_Sink sink, + wpi::util::SmallVectorImpl& buf, CS_Status* status) { auto data = Instance::GetInstance().GetSink(sink); if (!data || (data->kind & SinkMask) == 0) { @@ -245,7 +247,8 @@ void SetSinkEnabled(CS_Sink sink, bool enabled, CS_Status* status) { extern "C" { void CS_SetSinkDescription(CS_Sink sink, const struct WPI_String* description, CS_Status* status) { - return wpi::cs::SetSinkDescription(sink, wpi::util::to_string_view(description), status); + return wpi::cs::SetSinkDescription( + sink, wpi::util::to_string_view(description), status); } void CS_GetSinkError(CS_Sink sink, struct WPI_String* error, diff --git a/cscore/src/main/native/cpp/SourceImpl.cpp b/cscore/src/main/native/cpp/SourceImpl.cpp index 4e06ab53b6..467204df9e 100644 --- a/cscore/src/main/native/cpp/SourceImpl.cpp +++ b/cscore/src/main/native/cpp/SourceImpl.cpp @@ -190,7 +190,8 @@ bool SourceImpl::SetConfigJson(std::string_view config, CS_Status* status) { return SetConfigJson(j, status); } -bool SourceImpl::SetConfigJson(const wpi::util::json& config, CS_Status* status) { +bool SourceImpl::SetConfigJson(const wpi::util::json& config, + CS_Status* status) { VideoMode mode; // pixel format @@ -260,8 +261,9 @@ bool SourceImpl::SetConfigJson(const wpi::util::json& config, CS_Status* status) } else { if (mode.pixelFormat != wpi::cs::VideoMode::kUnknown) { SINFO("SetConfigJson: setting pixelFormat {}", mode.pixelFormat); - SetPixelFormat(static_cast(mode.pixelFormat), - status); + SetPixelFormat( + static_cast(mode.pixelFormat), + status); } if (mode.width != 0 && mode.height != 0) { SINFO("SetConfigJson: setting width {}, height {}", mode.width, diff --git a/cscore/src/main/native/cpp/SourceImpl.hpp b/cscore/src/main/native/cpp/SourceImpl.hpp index 33842748bb..fa4ac0b718 100644 --- a/cscore/src/main/native/cpp/SourceImpl.hpp +++ b/cscore/src/main/native/cpp/SourceImpl.hpp @@ -32,8 +32,8 @@ class SourceImpl : public PropertyContainer { friend class Frame; public: - SourceImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry); + SourceImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry); ~SourceImpl() override; SourceImpl(const SourceImpl& oth) = delete; SourceImpl& operator=(const SourceImpl& oth) = delete; diff --git a/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp b/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp index e6466a8f62..9d4b8cdafc 100644 --- a/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp +++ b/cscore/src/main/native/cpp/UsbCameraImplCommon.cpp @@ -35,14 +35,15 @@ extern "C" { CS_Source CS_CreateUsbCameraDev(const struct WPI_String* name, int dev, CS_Status* status) { - return wpi::cs::CreateUsbCameraDev(wpi::util::to_string_view(name), dev, status); + return wpi::cs::CreateUsbCameraDev(wpi::util::to_string_view(name), dev, + status); } CS_Source CS_CreateUsbCameraPath(const struct WPI_String* name, const struct WPI_String* path, CS_Status* status) { return wpi::cs::CreateUsbCameraPath(wpi::util::to_string_view(name), - wpi::util::to_string_view(path), status); + wpi::util::to_string_view(path), status); } void CS_SetUsbCameraPath(CS_Source source, const struct WPI_String* path, diff --git a/cscore/src/main/native/cpp/cscore_c.cpp b/cscore/src/main/native/cpp/cscore_c.cpp index 083686c417..814d01d159 100644 --- a/cscore/src/main/native/cpp/cscore_c.cpp +++ b/cscore/src/main/native/cpp/cscore_c.cpp @@ -34,7 +34,8 @@ template static O* ConvertToC(std::vector&& in, int* count) { using T = std::vector; size_t size = in.size(); - O* out = static_cast(wpi::util::safe_malloc(size * sizeof(O) + sizeof(T))); + O* out = + static_cast(wpi::util::safe_malloc(size * sizeof(O) + sizeof(T))); *count = size; for (size_t i = 0; i < size; ++i) { out[i] = ConvertToC(in[i]); @@ -92,7 +93,8 @@ void CS_GetStringProperty(CS_Property property, WPI_String* value, void CS_SetStringProperty(CS_Property property, const struct WPI_String* value, CS_Status* status) { - return wpi::cs::SetStringProperty(property, wpi::util::to_string_view(value), status); + return wpi::cs::SetStringProperty(property, wpi::util::to_string_view(value), + status); } WPI_String* CS_GetEnumPropertyChoices(CS_Property property, int* count, @@ -118,7 +120,8 @@ void CS_GetSourceName(CS_Source source, WPI_String* name, CS_Status* status) { void CS_GetSourceDescription(CS_Source source, WPI_String* description, CS_Status* status) { wpi::util::SmallString<128> buf; - wpi::cs::ConvertToC(description, wpi::cs::GetSourceDescription(source, buf, status)); + wpi::cs::ConvertToC(description, + wpi::cs::GetSourceDescription(source, buf, status)); } uint64_t CS_GetSourceLastFrameTime(CS_Source source, CS_Status* status) { @@ -142,7 +145,8 @@ CS_Bool CS_IsSourceEnabled(CS_Source source, CS_Status* status) { CS_Property CS_GetSourceProperty(CS_Source source, const struct WPI_String* name, CS_Status* status) { - return wpi::cs::GetSourceProperty(source, wpi::util::to_string_view(name), status); + return wpi::cs::GetSourceProperty(source, wpi::util::to_string_view(name), + status); } CS_Property* CS_EnumerateSourceProperties(CS_Source source, int* count, @@ -174,8 +178,8 @@ CS_Bool CS_SetSourceVideoModeDiscrete(CS_Source source, return wpi::cs::SetSourceVideoMode( source, wpi::cs::VideoMode{static_cast( - static_cast(pixelFormat)), - width, height, fps}, + static_cast(pixelFormat)), + width, height, fps}, status); } @@ -184,7 +188,8 @@ CS_Bool CS_SetSourcePixelFormat(CS_Source source, CS_Status* status) { return wpi::cs::SetSourcePixelFormat( source, - static_cast(static_cast(pixelFormat)), + static_cast( + static_cast(pixelFormat)), status); } @@ -200,7 +205,8 @@ CS_Bool CS_SetSourceFPS(CS_Source source, int fps, CS_Status* status) { CS_Bool CS_SetSourceConfigJson(CS_Source source, const struct WPI_String* config, CS_Status* status) { - return wpi::cs::SetSourceConfigJson(source, wpi::util::to_string_view(config), status); + return wpi::cs::SetSourceConfigJson(source, wpi::util::to_string_view(config), + status); } void CS_GetSourceConfigJson(CS_Source source, WPI_String* config, @@ -222,8 +228,8 @@ CS_Sink* CS_EnumerateSourceSinks(CS_Source source, int* count, CS_Status* status) { wpi::util::SmallVector buf; auto handles = wpi::cs::EnumerateSourceSinks(source, buf, status); - CS_Sink* sinks = - static_cast(wpi::util::safe_malloc(handles.size() * sizeof(CS_Sink))); + CS_Sink* sinks = static_cast( + wpi::util::safe_malloc(handles.size() * sizeof(CS_Sink))); *count = handles.size(); std::copy(handles.begin(), handles.end(), sinks); return sinks; @@ -284,12 +290,14 @@ void CS_GetSinkName(CS_Sink sink, WPI_String* name, CS_Status* status) { void CS_GetSinkDescription(CS_Sink sink, WPI_String* description, CS_Status* status) { wpi::util::SmallString<128> buf; - wpi::cs::ConvertToC(description, wpi::cs::GetSinkDescription(sink, buf, status)); + wpi::cs::ConvertToC(description, + wpi::cs::GetSinkDescription(sink, buf, status)); } CS_Property CS_GetSinkProperty(CS_Sink sink, const struct WPI_String* name, CS_Status* status) { - return wpi::cs::GetSinkProperty(sink, wpi::util::to_string_view(name), status); + return wpi::cs::GetSinkProperty(sink, wpi::util::to_string_view(name), + status); } CS_Property* CS_EnumerateSinkProperties(CS_Sink sink, int* count, @@ -305,7 +313,8 @@ CS_Property* CS_EnumerateSinkProperties(CS_Sink sink, int* count, CS_Bool CS_SetSinkConfigJson(CS_Sink sink, const struct WPI_String* config, CS_Status* status) { - return wpi::cs::SetSinkConfigJson(sink, wpi::util::to_string_view(config), status); + return wpi::cs::SetSinkConfigJson(sink, wpi::util::to_string_view(config), + status); } void CS_GetSinkConfigJson(CS_Sink sink, WPI_String* config, CS_Status* status) { @@ -323,7 +332,8 @@ CS_Source CS_GetSinkSource(CS_Sink sink, CS_Status* status) { CS_Property CS_GetSinkSourceProperty(CS_Sink sink, const struct WPI_String* name, CS_Status* status) { - return wpi::cs::GetSinkSourceProperty(sink, wpi::util::to_string_view(name), status); + return wpi::cs::GetSinkSourceProperty(sink, wpi::util::to_string_view(name), + status); } CS_Sink CS_CopySink(CS_Sink sink, CS_Status* status) { @@ -464,8 +474,8 @@ void CS_ReleaseEnumeratedSources(CS_Source* sources, int count) { CS_Sink* CS_EnumerateSinks(int* count, CS_Status* status) { wpi::util::SmallVector buf; auto handles = wpi::cs::EnumerateSinkHandles(buf, status); - CS_Sink* sinks = - static_cast(wpi::util::safe_malloc(handles.size() * sizeof(CS_Sink))); + CS_Sink* sinks = static_cast( + wpi::util::safe_malloc(handles.size() * sizeof(CS_Sink))); *count = handles.size(); std::copy(handles.begin(), handles.end(), sinks); return sinks; diff --git a/cscore/src/main/native/cpp/cscore_cpp.cpp b/cscore/src/main/native/cpp/cscore_cpp.cpp index b7d17aba0e..b81f265b98 100644 --- a/cscore/src/main/native/cpp/cscore_cpp.cpp +++ b/cscore/src/main/native/cpp/cscore_cpp.cpp @@ -401,9 +401,9 @@ std::vector EnumerateSourceVideoModes(CS_Source source, return data->source->EnumerateVideoModes(status); } -std::span EnumerateSourceSinks(CS_Source source, - wpi::util::SmallVectorImpl& vec, - CS_Status* status) { +std::span EnumerateSourceSinks( + CS_Source source, wpi::util::SmallVectorImpl& vec, + CS_Status* status) { auto& inst = Instance::GetInstance(); auto data = inst.GetSource(source); if (!data) { @@ -540,7 +540,8 @@ std::string GetSinkName(CS_Sink sink, CS_Status* status) { return std::string{data->sink->GetName()}; } -std::string_view GetSinkName(CS_Sink sink, wpi::util::SmallVectorImpl& buf, +std::string_view GetSinkName(CS_Sink sink, + wpi::util::SmallVectorImpl& buf, CS_Status* status) { auto data = Instance::GetInstance().GetSink(sink); if (!data) { @@ -587,7 +588,8 @@ CS_Property GetSinkProperty(CS_Sink sink, std::string_view name, } std::span EnumerateSinkProperties( - CS_Sink sink, wpi::util::SmallVectorImpl& vec, CS_Status* status) { + CS_Sink sink, wpi::util::SmallVectorImpl& vec, + CS_Status* status) { auto data = Instance::GetInstance().GetSink(sink); if (!data) { *status = CS_INVALID_HANDLE; @@ -873,8 +875,8 @@ std::span EnumerateSourceHandles( return Instance::GetInstance().EnumerateSourceHandles(vec); } -std::span EnumerateSinkHandles(wpi::util::SmallVectorImpl& vec, - CS_Status* status) { +std::span EnumerateSinkHandles( + wpi::util::SmallVectorImpl& vec, CS_Status* status) { return Instance::GetInstance().EnumerateSinkHandles(vec); } diff --git a/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp b/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp index 20c92bb1f7..15b6a5114b 100644 --- a/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp +++ b/cscore/src/main/native/cpp/jni/CameraServerJNI.cpp @@ -475,7 +475,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_createUsbCameraDev return 0; } CS_Status status = 0; - auto val = wpi::cs::CreateUsbCameraDev(JStringRef{env, name}.str(), dev, &status); + auto val = + wpi::cs::CreateUsbCameraDev(JStringRef{env, name}.str(), dev, &status); CheckStatus(env, status); return val; } @@ -499,7 +500,7 @@ Java_org_wpilib_vision_camera_CameraServerJNI_createUsbCameraPath } CS_Status status = 0; auto val = wpi::cs::CreateUsbCameraPath(JStringRef{env, name}.str(), - JStringRef{env, path}.str(), &status); + JStringRef{env, path}.str(), &status); CheckStatus(env, status); return val; } @@ -561,7 +562,7 @@ Java_org_wpilib_vision_camera_CameraServerJNI_createHttpCameraMulti CS_Status status = 0; auto val = wpi::cs::CreateHttpCamera(JStringRef{env, name}.str(), vec, - static_cast(kind), &status); + static_cast(kind), &status); CheckStatus(env, status); return val; } @@ -583,9 +584,10 @@ Java_org_wpilib_vision_camera_CameraServerJNI_createRawSource CS_Status status = 0; auto val = wpi::cs::CreateRawSource( JStringRef{env, name}.str(), isCv, - wpi::cs::VideoMode{static_cast(pixelFormat), - static_cast(width), static_cast(height), - static_cast(fps)}, + wpi::cs::VideoMode{ + static_cast(pixelFormat), + static_cast(width), static_cast(height), + static_cast(fps)}, &status); CheckStatus(env, status); return val; @@ -770,8 +772,9 @@ Java_org_wpilib_vision_camera_CameraServerJNI_setSourceVideoMode CS_Status status = 0; auto val = wpi::cs::SetSourceVideoMode( source, - wpi::cs::VideoMode(static_cast(pixelFormat), width, - height, fps), + wpi::cs::VideoMode( + static_cast(pixelFormat), width, + height, fps), &status); CheckStatus(env, status); return val; @@ -788,7 +791,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_setSourcePixelFormat { CS_Status status = 0; auto val = wpi::cs::SetSourcePixelFormat( - source, static_cast(pixelFormat), &status); + source, static_cast(pixelFormat), + &status); CheckStatus(env, status); return val; } @@ -833,7 +837,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_setSourceConfigJson (JNIEnv* env, jclass, jint source, jstring config) { CS_Status status = 0; - auto val = wpi::cs::SetSourceConfigJson(source, JStringRef{env, config}, &status); + auto val = + wpi::cs::SetSourceConfigJson(source, JStringRef{env, config}, &status); CheckStatus(env, status); return val; } @@ -1271,7 +1276,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_setSourceDescription return; } CS_Status status = 0; - wpi::cs::SetSourceDescription(source, JStringRef{env, description}.str(), &status); + wpi::cs::SetSourceDescription(source, JStringRef{env, description}.str(), + &status); CheckStatus(env, status); } @@ -1342,8 +1348,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_createMjpegServer } CS_Status status = 0; auto val = wpi::cs::CreateMjpegServer(JStringRef{env, name}.str(), - JStringRef{env, listenAddress}.str(), port, - &status); + JStringRef{env, listenAddress}.str(), + port, &status); CheckStatus(env, status); return val; } @@ -1432,7 +1438,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_getSinkProperty return 0; } CS_Status status = 0; - auto val = wpi::cs::GetSinkProperty(sink, JStringRef{env, name}.str(), &status); + auto val = + wpi::cs::GetSinkProperty(sink, JStringRef{env, name}.str(), &status); CheckStatus(env, status); return val; } @@ -1465,7 +1472,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_setSinkConfigJson (JNIEnv* env, jclass, jint source, jstring config) { CS_Status status = 0; - auto val = wpi::cs::SetSinkConfigJson(source, JStringRef{env, config}, &status); + auto val = + wpi::cs::SetSinkConfigJson(source, JStringRef{env, config}, &status); CheckStatus(env, status); return val; } @@ -1513,8 +1521,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_getSinkSourceProperty return 0; } CS_Status status = 0; - auto val = - wpi::cs::GetSinkSourceProperty(sink, JStringRef{env, name}.str(), &status); + auto val = wpi::cs::GetSinkSourceProperty(sink, JStringRef{env, name}.str(), + &status); CheckStatus(env, status); return val; } @@ -1609,7 +1617,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_setSinkDescription return; } CS_Status status = 0; - wpi::cs::SetSinkDescription(sink, JStringRef{env, description}.str(), &status); + wpi::cs::SetSinkDescription(sink, JStringRef{env, description}.str(), + &status); CheckStatus(env, status); } @@ -1630,7 +1639,7 @@ Java_org_wpilib_vision_camera_CameraServerJNI_grabRawSinkFrame return 0; } wpi::util::SetFrameData(env, rawFrameCls, frameObj, *frame, - origData != frame->data); + origData != frame->data); return rv; } @@ -1648,12 +1657,12 @@ Java_org_wpilib_vision_camera_CameraServerJNI_grabRawSinkFrameTimeout auto origData = frame->data; CS_Status status = 0; auto rv = wpi::cs::GrabSinkFrameTimeout(static_cast(sink), *frame, - timeout, &status); + timeout, &status); if (!CheckStatus(env, status)) { return 0; } wpi::util::SetFrameData(env, rawFrameCls, frameObj, *frame, - origData != frame->data); + origData != frame->data); return rv; } @@ -1801,7 +1810,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_addPolledListener (JNIEnv* env, jclass, jint poller, jint eventMask, jboolean immediateNotify) { CS_Status status = 0; - auto rv = wpi::cs::AddPolledListener(poller, eventMask, immediateNotify, &status); + auto rv = + wpi::cs::AddPolledListener(poller, eventMask, immediateNotify, &status); CheckStatus(env, status); return rv; } @@ -1887,8 +1897,8 @@ Java_org_wpilib_vision_camera_CameraServerJNI_getTelemetryValue (JNIEnv* env, jclass, jint handle, jint kind) { CS_Status status = 0; - auto val = wpi::cs::GetTelemetryValue(handle, static_cast(kind), - &status); + auto val = wpi::cs::GetTelemetryValue( + handle, static_cast(kind), &status); CheckStatus(env, status); return val; } diff --git a/cscore/src/main/native/include/wpi/cs/cscore_cpp.hpp b/cscore/src/main/native/include/wpi/cs/cscore_cpp.hpp index 66ccfe5654..f2016a53d6 100644 --- a/cscore/src/main/native/include/wpi/cs/cscore_cpp.hpp +++ b/cscore/src/main/native/include/wpi/cs/cscore_cpp.hpp @@ -252,9 +252,9 @@ std::string GetSourceConfigJson(CS_Source source, CS_Status* status); wpi::util::json GetSourceConfigJsonObject(CS_Source source, CS_Status* status); std::vector EnumerateSourceVideoModes(CS_Source source, CS_Status* status); -std::span EnumerateSourceSinks(CS_Source source, - wpi::util::SmallVectorImpl& vec, - CS_Status* status); +std::span EnumerateSourceSinks( + CS_Source source, wpi::util::SmallVectorImpl& vec, + CS_Status* status); CS_Source CopySource(CS_Source source, CS_Status* status); void ReleaseSource(CS_Source source, CS_Status* status); /** @} */ @@ -332,7 +332,8 @@ CS_Sink CreateCvSinkCallback(std::string_view name, */ CS_SinkKind GetSinkKind(CS_Sink sink, CS_Status* status); std::string GetSinkName(CS_Sink sink, CS_Status* status); -std::string_view GetSinkName(CS_Sink sink, wpi::util::SmallVectorImpl& buf, +std::string_view GetSinkName(CS_Sink sink, + wpi::util::SmallVectorImpl& buf, CS_Status* status); std::string GetSinkDescription(CS_Sink sink, CS_Status* status); std::string_view GetSinkDescription(CS_Sink sink, @@ -341,7 +342,8 @@ std::string_view GetSinkDescription(CS_Sink sink, CS_Property GetSinkProperty(CS_Sink sink, std::string_view name, CS_Status* status); std::span EnumerateSinkProperties( - CS_Sink sink, wpi::util::SmallVectorImpl& vec, CS_Status* status); + CS_Sink sink, wpi::util::SmallVectorImpl& vec, + CS_Status* status); void SetSinkSource(CS_Sink sink, CS_Source source, CS_Status* status); CS_Property GetSinkSourceProperty(CS_Sink sink, std::string_view name, CS_Status* status); @@ -371,7 +373,8 @@ int GetMjpegServerPort(CS_Sink sink, CS_Status* status); void SetSinkDescription(CS_Sink sink, std::string_view description, CS_Status* status); std::string GetSinkError(CS_Sink sink, CS_Status* status); -std::string_view GetSinkError(CS_Sink sink, wpi::util::SmallVectorImpl& buf, +std::string_view GetSinkError(CS_Sink sink, + wpi::util::SmallVectorImpl& buf, CS_Status* status); void SetSinkEnabled(CS_Sink sink, bool enabled, CS_Status* status); /** @} */ @@ -437,8 +440,8 @@ std::vector EnumerateUsbCameras(CS_Status* status); std::span EnumerateSourceHandles( wpi::util::SmallVectorImpl& vec, CS_Status* status); -std::span EnumerateSinkHandles(wpi::util::SmallVectorImpl& vec, - CS_Status* status); +std::span EnumerateSinkHandles( + wpi::util::SmallVectorImpl& vec, CS_Status* status); std::string GetHostname(); diff --git a/cscore/src/main/native/include/wpi/cs/cscore_cv.hpp b/cscore/src/main/native/include/wpi/cs/cscore_cv.hpp index c3e79f2b93..591f9dc21e 100644 --- a/cscore/src/main/native/include/wpi/cs/cscore_cv.hpp +++ b/cscore/src/main/native/include/wpi/cs/cscore_cv.hpp @@ -107,8 +107,8 @@ class CvSink : public ImageSink { * with. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrame(cv::Mat& image, double timeout = 0.225); @@ -119,8 +119,8 @@ class CvSink : public ImageSink { * with. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrameNoTimeout(cv::Mat& image); @@ -133,8 +133,8 @@ class CvSink : public ImageSink { * any grabFrame*() call on the sink. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrameDirect(cv::Mat& image, double timeout = 0.225); @@ -146,8 +146,8 @@ class CvSink : public ImageSink { * any grabFrame*() call on the sink. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrameNoTimeoutDirect(cv::Mat& image); @@ -166,8 +166,8 @@ class CvSink : public ImageSink { * a new frame. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrameDirectLastTime(cv::Mat& image, uint64_t lastFrameTime, diff --git a/cscore/src/main/native/include/wpi/cs/cscore_oo.hpp b/cscore/src/main/native/include/wpi/cs/cscore_oo.hpp index 80e038d0ca..065b2f644a 100644 --- a/cscore/src/main/native/include/wpi/cs/cscore_oo.hpp +++ b/cscore/src/main/native/include/wpi/cs/cscore_oo.hpp @@ -546,8 +546,8 @@ class VideoSource { */ double GetActualFPS() const { m_status = 0; - return wpi::cs::GetTelemetryAverageValue(m_handle, CS_SOURCE_FRAMES_RECEIVED, - &m_status); + return wpi::cs::GetTelemetryAverageValue( + m_handle, CS_SOURCE_FRAMES_RECEIVED, &m_status); } /** @@ -560,7 +560,7 @@ class VideoSource { double GetActualDataRate() const { m_status = 0; return wpi::cs::GetTelemetryAverageValue(m_handle, CS_SOURCE_BYTES_RECEIVED, - &m_status); + &m_status); } /** diff --git a/cscore/src/main/native/include/wpi/cs/cscore_raw.h b/cscore/src/main/native/include/wpi/cs/cscore_raw.h index 7b3ff550a2..9b758c15ac 100644 --- a/cscore/src/main/native/include/wpi/cs/cscore_raw.h +++ b/cscore/src/main/native/include/wpi/cs/cscore_raw.h @@ -155,8 +155,8 @@ class RawSink : public ImageSink { * The provided image will have three 8-bit channels stored in BGR order. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrame(wpi::util::RawFrame& image, double timeout = 0.225) const; @@ -166,8 +166,8 @@ class RawSink : public ImageSink { * The provided image will have three 8-bit channels stored in BGR order. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrameNoTimeout(wpi::util::RawFrame& image) const; @@ -183,8 +183,8 @@ class RawSink : public ImageSink { * a new frame. * * @return Frame time, or 0 on error (call GetError() to obtain the error - * message); the frame time is in the same time base as wpi::util::Now(), - * and is in 1 us increments. + * message); the frame time is in the same time base as + * wpi::util::Now(), and is in 1 us increments. */ [[nodiscard]] uint64_t GrabFrameLastTime(wpi::util::RawFrame& image, uint64_t lastFrameTime, @@ -216,7 +216,8 @@ inline RawSink::RawSink(std::string_view name, m_handle = CreateRawSinkCallback(name, false, processFrame, &m_status); } -inline uint64_t RawSink::GrabFrame(wpi::util::RawFrame& image, double timeout) const { +inline uint64_t RawSink::GrabFrame(wpi::util::RawFrame& image, + double timeout) const { m_status = 0; return GrabSinkFrameTimeout(m_handle, image, timeout, &m_status); } diff --git a/cscore/src/main/native/linux/RunLoopHelpers.cpp b/cscore/src/main/native/linux/RunLoopHelpers.cpp index 936312240a..26f07e9661 100644 --- a/cscore/src/main/native/linux/RunLoopHelpers.cpp +++ b/cscore/src/main/native/linux/RunLoopHelpers.cpp @@ -20,7 +20,8 @@ void RunMainRunLoop() { int RunMainRunLoopTimeout(double timeout) { wpi::util::Event& event = GetInstance(); bool timedOut = false; - bool signaled = wpi::util::WaitForObject(event.GetHandle(), timeout, &timedOut); + bool signaled = + wpi::util::WaitForObject(event.GetHandle(), timeout, &timedOut); if (timedOut) { return 3; } diff --git a/cscore/src/main/native/linux/UsbCameraImpl.cpp b/cscore/src/main/native/linux/UsbCameraImpl.cpp index 4e9aa73fa9..657168c3e9 100644 --- a/cscore/src/main/native/linux/UsbCameraImpl.cpp +++ b/cscore/src/main/native/linux/UsbCameraImpl.cpp @@ -207,13 +207,17 @@ static bool GetVendorProduct(int dev, int* vendor, int* product) { } std::string_view readStr{readBuf}; if (auto v = wpi::util::parse_integer( - wpi::util::substr(wpi::util::substr(readStr, readStr.find('v')), 1, 4), 16)) { + wpi::util::substr(wpi::util::substr(readStr, readStr.find('v')), 1, + 4), + 16)) { *vendor = v.value(); } else { return false; } if (auto v = wpi::util::parse_integer( - wpi::util::substr(wpi::util::substr(readStr, readStr.find('p')), 1, 4), 16)) { + wpi::util::substr(wpi::util::substr(readStr, readStr.find('p')), 1, + 4), + 16)) { *product = v.value(); } else { return false; @@ -262,8 +266,10 @@ static bool GetDescriptionIoctl(const char* cpath, std::string* desc) { std::optional vendor; std::optional product; if (wpi::util::starts_with(card, "UVC Camera (") && - (vendor = wpi::util::parse_integer(wpi::util::substr(card, 12, 4), 16)) && - (product = wpi::util::parse_integer(wpi::util::substr(card, 17, 4), 16))) { + (vendor = + wpi::util::parse_integer(wpi::util::substr(card, 12, 4), 16)) && + (product = + wpi::util::parse_integer(wpi::util::substr(card, 17, 4), 16))) { std::string card2 = GetUsbNameFromId(vendor.value(), product.value()); if (!card2.empty()) { *desc = std::move(card2); @@ -566,9 +572,9 @@ void UsbCameraImpl::CameraThreadMain() { } else if (tsFlags == V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC) { SDEBUG4("Got valid monotonic time for frame"); // we can't go directly to frametime, since the rest of cscore - // expects us to use wpi::util::Now, which is in an arbitrary timebase - // (see timestamp.cpp). Best I can do is (approximately) translate - // between timebases + // expects us to use wpi::util::Now, which is in an arbitrary + // timebase (see timestamp.cpp). Best I can do is (approximately) + // translate between timebases // grab current time in the same timebase as buf.timestamp struct timespec ts; @@ -595,7 +601,8 @@ void UsbCameraImpl::CameraThreadMain() { // Can't do anything if we can't access the clock, leave default } } else if (tsFlags == V4L2_BUF_FLAG_TIMESTAMP_COPY) { - SDEBUG4("Got valid copy time for frame - default to wpi::util::Now"); + SDEBUG4( + "Got valid copy time for frame - default to wpi::util::Now"); } PutFrame(static_cast(m_mode.pixelFormat), @@ -1708,8 +1715,8 @@ std::vector EnumerateUsbCameras(CS_Status* status) { } unsigned int dev = 0; - if (auto v = - wpi::util::parse_integer(wpi::util::substr(fname, 5), 10)) { + if (auto v = wpi::util::parse_integer( + wpi::util::substr(fname, 5), 10)) { dev = v.value(); } else { continue; @@ -1760,8 +1767,8 @@ std::vector EnumerateUsbCameras(CS_Status* status) { std::string fname = fs::path{target}.filename(); std::optional dev; if (wpi::util::starts_with(fname, "video") && - (dev = wpi::util::parse_integer(wpi::util::substr(fname, 5), - 10)) && + (dev = wpi::util::parse_integer( + wpi::util::substr(fname, 5), 10)) && dev.value() < retval.size()) { retval[dev.value()].otherPaths.emplace_back(path.str()); } diff --git a/cscore/src/main/native/linux/UsbCameraImpl.hpp b/cscore/src/main/native/linux/UsbCameraImpl.hpp index 4680732416..09b0af673b 100644 --- a/cscore/src/main/native/linux/UsbCameraImpl.hpp +++ b/cscore/src/main/native/linux/UsbCameraImpl.hpp @@ -31,8 +31,9 @@ class Telemetry; class UsbCameraImpl : public SourceImpl { public: - UsbCameraImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry, std::string_view path); + UsbCameraImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry, + std::string_view path); ~UsbCameraImpl() override; void Start() override; diff --git a/cscore/src/main/native/linux/UsbCameraListener.cpp b/cscore/src/main/native/linux/UsbCameraListener.cpp index 5d5d83a510..457954cca3 100644 --- a/cscore/src/main/native/linux/UsbCameraListener.cpp +++ b/cscore/src/main/native/linux/UsbCameraListener.cpp @@ -24,7 +24,8 @@ class UsbCameraListener::Impl { std::unique_ptr m_runner; }; -UsbCameraListener::UsbCameraListener(wpi::util::Logger& logger, Notifier& notifier) +UsbCameraListener::UsbCameraListener(wpi::util::Logger& logger, + Notifier& notifier) : m_impl(std::make_unique(notifier)) {} UsbCameraListener::~UsbCameraListener() = default; @@ -32,22 +33,23 @@ UsbCameraListener::~UsbCameraListener() = default; void UsbCameraListener::Start() { if (!m_impl->m_runner) { m_impl->m_runner = std::make_unique(); - m_impl->m_runner->ExecAsync([impl = m_impl.get()](wpi::net::uv::Loop& loop) { - auto refreshTimer = wpi::net::uv::Timer::Create(loop); - refreshTimer->timeout.connect([notifier = &impl->m_notifier] { - notifier->NotifyUsbCamerasChanged(); - }); - refreshTimer->Unreference(); + m_impl->m_runner->ExecAsync( + [impl = m_impl.get()](wpi::net::uv::Loop& loop) { + auto refreshTimer = wpi::net::uv::Timer::Create(loop); + refreshTimer->timeout.connect([notifier = &impl->m_notifier] { + notifier->NotifyUsbCamerasChanged(); + }); + refreshTimer->Unreference(); - auto devEvents = wpi::net::uv::FsEvent::Create(loop); - devEvents->fsEvent.connect([refreshTimer](const char* fn, int flags) { - if (wpi::util::starts_with(fn, "video")) { - refreshTimer->Start(wpi::net::uv::Timer::Time(200)); - } - }); - devEvents->Start("/dev"); - devEvents->Unreference(); - }); + auto devEvents = wpi::net::uv::FsEvent::Create(loop); + devEvents->fsEvent.connect([refreshTimer](const char* fn, int flags) { + if (wpi::util::starts_with(fn, "video")) { + refreshTimer->Start(wpi::net::uv::Timer::Time(200)); + } + }); + devEvents->Start("/dev"); + devEvents->Unreference(); + }); } } diff --git a/cscore/src/main/native/linux/UsbCameraProperty.cpp b/cscore/src/main/native/linux/UsbCameraProperty.cpp index 9d02f8cbde..cc924b8060 100644 --- a/cscore/src/main/native/linux/UsbCameraProperty.cpp +++ b/cscore/src/main/native/linux/UsbCameraProperty.cpp @@ -267,7 +267,8 @@ std::unique_ptr UsbCameraProperty::DeviceQuery(int fd, return prop; } -bool UsbCameraProperty::DeviceGet(std::unique_lock& lock, int fd) { +bool UsbCameraProperty::DeviceGet(std::unique_lock& lock, + int fd) { if (fd < 0) { return true; } @@ -313,8 +314,8 @@ bool UsbCameraProperty::DeviceSet(std::unique_lock& lock, return DeviceSet(lock, fd, value, valueStrCopy.str()); } -bool UsbCameraProperty::DeviceSet(std::unique_lock& lock, int fd, - int newValue, +bool UsbCameraProperty::DeviceSet(std::unique_lock& lock, + int fd, int newValue, std::string_view newValueStr) const { if (!device || fd < 0) { return true; diff --git a/cscore/src/main/native/osx/NetworkListener.cpp b/cscore/src/main/native/osx/NetworkListener.cpp index 9829e4fa0c..25174783ac 100644 --- a/cscore/src/main/native/osx/NetworkListener.cpp +++ b/cscore/src/main/native/osx/NetworkListener.cpp @@ -8,7 +8,8 @@ using namespace wpi::cs; class NetworkListener::Impl {}; -NetworkListener::NetworkListener(wpi::util::Logger& logger, Notifier& notifier) {} +NetworkListener::NetworkListener(wpi::util::Logger& logger, + Notifier& notifier) {} NetworkListener::~NetworkListener() = default; diff --git a/cscore/src/main/native/windows/COMCreators.cpp b/cscore/src/main/native/windows/COMCreators.cpp index a143e66c8a..eefea1b94b 100644 --- a/cscore/src/main/native/windows/COMCreators.cpp +++ b/cscore/src/main/native/windows/COMCreators.cpp @@ -94,7 +94,8 @@ STDMETHODIMP SourceReaderCB::OnReadSample(HRESULT hrStatus, DWORD dwStreamIndex, // Create a Source Reader COM Smart Object ComPtr CreateSourceReaderCB( - std::weak_ptr source, const wpi::cs::VideoMode& mode) { + std::weak_ptr source, + const wpi::cs::VideoMode& mode) { SourceReaderCB* ptr = new SourceReaderCB(source, mode); ComPtr sourceReaderCB; sourceReaderCB.Attach(ptr); diff --git a/cscore/src/main/native/windows/COMCreators.hpp b/cscore/src/main/native/windows/COMCreators.hpp index 782f8fc850..90e66be4f6 100644 --- a/cscore/src/main/native/windows/COMCreators.hpp +++ b/cscore/src/main/native/windows/COMCreators.hpp @@ -35,7 +35,9 @@ class SourceReaderCB : public IMFSourceReaderCallback { IMFSample* pSample // Can be NULL ); - void InvalidateCapture() { m_source = std::weak_ptr(); } + void InvalidateCapture() { + m_source = std::weak_ptr(); + } private: // Destructor is private. Caller should call Release. @@ -48,7 +50,8 @@ class SourceReaderCB : public IMFSourceReaderCallback { }; ComPtr CreateSourceReaderCB( - std::weak_ptr source, const wpi::cs::VideoMode& mode); + std::weak_ptr source, + const wpi::cs::VideoMode& mode); ComPtr CreateSourceReader(IMFMediaSource* mediaSource, IMFSourceReaderCallback* callback); ComPtr CreateVideoCaptureDevice(LPCWSTR pszSymbolicLink); diff --git a/cscore/src/main/native/windows/RunLoopHelpers.cpp b/cscore/src/main/native/windows/RunLoopHelpers.cpp index 936312240a..26f07e9661 100644 --- a/cscore/src/main/native/windows/RunLoopHelpers.cpp +++ b/cscore/src/main/native/windows/RunLoopHelpers.cpp @@ -20,7 +20,8 @@ void RunMainRunLoop() { int RunMainRunLoopTimeout(double timeout) { wpi::util::Event& event = GetInstance(); bool timedOut = false; - bool signaled = wpi::util::WaitForObject(event.GetHandle(), timeout, &timedOut); + bool signaled = + wpi::util::WaitForObject(event.GetHandle(), timeout, &timedOut); if (timedOut) { return 3; } diff --git a/cscore/src/main/native/windows/UsbCameraImpl.hpp b/cscore/src/main/native/windows/UsbCameraImpl.hpp index a97754fe8f..ff040b7e9f 100644 --- a/cscore/src/main/native/windows/UsbCameraImpl.hpp +++ b/cscore/src/main/native/windows/UsbCameraImpl.hpp @@ -39,10 +39,11 @@ namespace wpi::cs { class UsbCameraImpl : public SourceImpl, public std::enable_shared_from_this { public: - UsbCameraImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry, std::string_view path); - UsbCameraImpl(std::string_view name, wpi::util::Logger& logger, Notifier& notifier, - Telemetry& telemetry, int deviceId); + UsbCameraImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry, + std::string_view path); + UsbCameraImpl(std::string_view name, wpi::util::Logger& logger, + Notifier& notifier, Telemetry& telemetry, int deviceId); ~UsbCameraImpl() override; void Start() override; diff --git a/cscore/src/main/native/windows/UsbCameraListener.cpp b/cscore/src/main/native/windows/UsbCameraListener.cpp index 740b4fd934..fdd2cf42f5 100644 --- a/cscore/src/main/native/windows/UsbCameraListener.cpp +++ b/cscore/src/main/native/windows/UsbCameraListener.cpp @@ -58,7 +58,8 @@ class UsbCameraListener::Impl { std::unique_ptr m_messagePump; }; -UsbCameraListener::UsbCameraListener(wpi::util::Logger& logger, Notifier& notifier) +UsbCameraListener::UsbCameraListener(wpi::util::Logger& logger, + Notifier& notifier) : m_impl{std::make_unique(notifier)} {} UsbCameraListener::~UsbCameraListener() { diff --git a/cscore/src/main/native/windows/UsbCameraProperty.hpp b/cscore/src/main/native/windows/UsbCameraProperty.hpp index 3a81f413b8..f5e1b5227e 100644 --- a/cscore/src/main/native/windows/UsbCameraProperty.hpp +++ b/cscore/src/main/native/windows/UsbCameraProperty.hpp @@ -85,13 +85,14 @@ class UsbCameraProperty : public PropertyImpl { IAMCameraControl* pProcAmp); bool DeviceSet(std::unique_lock& lock, IAMCameraControl* pProcAmp) const; - bool DeviceSet(std::unique_lock& lock, IAMCameraControl* pProcAmp, - int newValue) const; + bool DeviceSet(std::unique_lock& lock, + IAMCameraControl* pProcAmp, int newValue) const; - bool DeviceGet(std::unique_lock& lock, IAMVideoProcAmp* pProcAmp); + bool DeviceGet(std::unique_lock& lock, + IAMVideoProcAmp* pProcAmp); bool DeviceSet(std::unique_lock& lock, IAMVideoProcAmp* pProcAmp) const; - bool DeviceSet(std::unique_lock& lock, IAMVideoProcAmp* pProcAmp, - int newValue) const; + bool DeviceSet(std::unique_lock& lock, + IAMVideoProcAmp* pProcAmp, int newValue) const; }; } // namespace wpi::cs diff --git a/datalog/examples/printlog/printlog.cpp b/datalog/examples/printlog/printlog.cpp index ac9586a1a0..12df2a2cd0 100644 --- a/datalog/examples/printlog/printlog.cpp +++ b/datalog/examples/printlog/printlog.cpp @@ -23,7 +23,7 @@ int main(int argc, const char** argv) { auto fileBuffer = wpi::util::MemoryBuffer::GetFile(argv[1]); if (!fileBuffer) { wpi::util::print(stderr, "could not open file: {}\n", - fileBuffer.error().message()); + fileBuffer.error().message()); return EXIT_FAILURE; } wpi::log::DataLogReader reader{std::move(*fileBuffer)}; @@ -37,9 +37,10 @@ int main(int argc, const char** argv) { if (record.IsStart()) { wpi::log::StartRecordData data; if (record.GetStartData(&data)) { - wpi::util::print("Start({}, name='{}', type='{}', metadata='{}') [{}]\n", - data.entry, data.name, data.type, data.metadata, - record.GetTimestamp() / 1000000.0); + wpi::util::print( + "Start({}, name='{}', type='{}', metadata='{}') [{}]\n", data.entry, + data.name, data.type, data.metadata, + record.GetTimestamp() / 1000000.0); if (entries.find(data.entry) != entries.end()) { wpi::util::print("...DUPLICATE entry ID, overriding\n"); } @@ -51,7 +52,7 @@ int main(int argc, const char** argv) { int entry; if (record.GetFinishEntry(&entry)) { wpi::util::print("Finish({}) [{}]\n", entry, - record.GetTimestamp() / 1000000.0); + record.GetTimestamp() / 1000000.0); auto it = entries.find(entry); if (it == entries.end()) { wpi::util::print("...ID not found\n"); @@ -64,8 +65,8 @@ int main(int argc, const char** argv) { } else if (record.IsSetMetadata()) { wpi::log::MetadataRecordData data; if (record.GetSetMetadataData(&data)) { - wpi::util::print("SetMetadata({}, '{}') [{}]\n", data.entry, data.metadata, - record.GetTimestamp() / 1000000.0); + wpi::util::print("SetMetadata({}, '{}') [{}]\n", data.entry, + data.metadata, record.GetTimestamp() / 1000000.0); auto it = entries.find(data.entry); if (it == entries.end()) { wpi::util::print("...ID not found\n"); @@ -78,14 +79,15 @@ int main(int argc, const char** argv) { } else if (record.IsControl()) { wpi::util::print("Unrecognized control record\n"); } else { - wpi::util::print("Data({}, size={}) ", record.GetEntry(), record.GetSize()); + wpi::util::print("Data({}, size={}) ", record.GetEntry(), + record.GetSize()); auto entry = entries.find(record.GetEntry()); if (entry == entries.end()) { wpi::util::print("\n"); continue; } wpi::util::print(" [{}]\n", entry->second.name, - entry->second.type, record.GetTimestamp() / 1000000.0); + entry->second.type, record.GetTimestamp() / 1000000.0); // handle systemTime specially if (entry->second.name == "systemTime" && entry->second.type == "int64") { @@ -93,7 +95,7 @@ int main(int argc, const char** argv) { if (record.GetInteger(&val)) { std::time_t timeval = val / 1000000; wpi::util::print(" {:%Y-%m-%d %H:%M:%S}.{:06}\n", - *std::localtime(&timeval), val % 1000000); + *std::localtime(&timeval), val % 1000000); } else { wpi::util::print(" invalid\n"); } diff --git a/datalog/examples/writelog/writelog.cpp b/datalog/examples/writelog/writelog.cpp index 6e6d23bd33..a45b152407 100644 --- a/datalog/examples/writelog/writelog.cpp +++ b/datalog/examples/writelog/writelog.cpp @@ -74,8 +74,8 @@ int main(int argc, char** argv) { resVec.push_back(duration_cast(stop - start).count()); } - wpi::util::print("{}us\n", - std::accumulate(resVec.begin(), resVec.end(), 0) / kNumRuns); + wpi::util::print( + "{}us\n", std::accumulate(resVec.begin(), resVec.end(), 0) / kNumRuns); } return EXIT_SUCCESS; diff --git a/datalog/src/main/native/cpp/DataLog.cpp b/datalog/src/main/native/cpp/DataLog.cpp index 50ffa32105..9090beb8f9 100644 --- a/datalog/src/main/native/cpp/DataLog.cpp +++ b/datalog/src/main/native/cpp/DataLog.cpp @@ -509,7 +509,8 @@ void DataLog::AppendFloatArray(int entry, std::span arr, while ((arr.size() * 4) > kBlockSize) { buf = Reserve(kBlockSize); for (auto val : arr.subspan(0, kBlockSize / 4)) { - wpi::util::support::endian::write32le(buf, std::bit_cast(val)); + wpi::util::support::endian::write32le(buf, + std::bit_cast(val)); buf += 4; } arr = arr.subspan(kBlockSize / 4); @@ -541,7 +542,8 @@ void DataLog::AppendDoubleArray(int entry, std::span arr, while ((arr.size() * 8) > kBlockSize) { buf = Reserve(kBlockSize); for (auto val : arr.subspan(0, kBlockSize / 8)) { - wpi::util::support::endian::write64le(buf, std::bit_cast(val)); + wpi::util::support::endian::write64le(buf, + std::bit_cast(val)); buf += 8; } arr = arr.subspan(kBlockSize / 8); diff --git a/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp b/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp index 45e9a1c59f..1ae973e7d5 100644 --- a/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp +++ b/datalog/src/main/native/cpp/DataLogBackgroundWriter.cpp @@ -469,8 +469,8 @@ struct WPI_DataLog* WPI_DataLog_CreateBackgroundWriter( const struct WPI_String* dir, const struct WPI_String* filename, double period, const struct WPI_String* extraHeader) { return reinterpret_cast(new DataLogBackgroundWriter{ - wpi::util::to_string_view(dir), wpi::util::to_string_view(filename), period, - wpi::util::to_string_view(extraHeader)}); + wpi::util::to_string_view(dir), wpi::util::to_string_view(filename), + period, wpi::util::to_string_view(extraHeader)}); } struct WPI_DataLog* WPI_DataLog_CreateBackgroundWriter_Func( diff --git a/datalog/src/main/native/cpp/DataLogReader.cpp b/datalog/src/main/native/cpp/DataLogReader.cpp index 590a0f5976..c2bde2ed3d 100644 --- a/datalog/src/main/native/cpp/DataLogReader.cpp +++ b/datalog/src/main/native/cpp/DataLogReader.cpp @@ -97,7 +97,8 @@ bool DataLogRecord::GetFloat(float* value) const { if (m_data.size() != 4) { return false; } - *value = std::bit_cast(wpi::util::support::endian::read32le(m_data.data())); + *value = + std::bit_cast(wpi::util::support::endian::read32le(m_data.data())); return true; } @@ -105,7 +106,8 @@ bool DataLogRecord::GetDouble(double* value) const { if (m_data.size() != 8) { return false; } - *value = std::bit_cast(wpi::util::support::endian::read64le(m_data.data())); + *value = std::bit_cast( + wpi::util::support::endian::read64le(m_data.data())); return true; } @@ -142,8 +144,8 @@ bool DataLogRecord::GetFloatArray(std::vector* arr) const { } arr->reserve(m_data.size() / 4); for (size_t pos = 0; pos < m_data.size(); pos += 4) { - arr->push_back( - std::bit_cast(wpi::util::support::endian::read32le(&m_data[pos]))); + arr->push_back(std::bit_cast( + wpi::util::support::endian::read32le(&m_data[pos]))); } return true; } @@ -155,8 +157,8 @@ bool DataLogRecord::GetDoubleArray(std::vector* arr) const { } arr->reserve(m_data.size() / 8); for (size_t pos = 0; pos < m_data.size(); pos += 8) { - arr->push_back( - std::bit_cast(wpi::util::support::endian::read64le(&m_data[pos]))); + arr->push_back(std::bit_cast( + wpi::util::support::endian::read64le(&m_data[pos]))); } return true; } diff --git a/datalog/src/main/native/cpp/DataLogReaderThread.cpp b/datalog/src/main/native/cpp/DataLogReaderThread.cpp index e17aa16461..a1234b8cf0 100644 --- a/datalog/src/main/native/cpp/DataLogReaderThread.cpp +++ b/datalog/src/main/native/cpp/DataLogReaderThread.cpp @@ -107,9 +107,10 @@ void DataLogReaderThread::ReadMain() { auto desc = m_structDb.Add(*typeStr, schema, &err); if (!desc) { wpi::util::print("could not decode struct '{}' schema '{}': {}\n", name, - schema, err); + schema, err); } - } else if (auto filename = wpi::util::remove_prefix(name, "/.schema/proto:")) { + } else if (auto filename = + wpi::util::remove_prefix(name, "/.schema/proto:")) { // protobuf descriptor handling upb_Status status; status.ok = true; @@ -120,7 +121,7 @@ void DataLogReaderThread::ReadMain() { &status); if (!status.ok) { wpi::util::print("could not decode protobuf '{}' filename '{}'\n", name, - *filename); + *filename); } } } diff --git a/datalog/src/main/native/cpp/DataLogWriter.cpp b/datalog/src/main/native/cpp/DataLogWriter.cpp index ed688ac189..53d4214e7c 100644 --- a/datalog/src/main/native/cpp/DataLogWriter.cpp +++ b/datalog/src/main/native/cpp/DataLogWriter.cpp @@ -12,8 +12,8 @@ using namespace wpi::log; -static std::unique_ptr CheckOpen(std::string_view filename, - std::error_code& ec) { +static std::unique_ptr CheckOpen( + std::string_view filename, std::error_code& ec) { auto rv = std::make_unique(filename, ec); if (ec) { return nullptr; @@ -25,8 +25,9 @@ DataLogWriter::DataLogWriter(std::string_view filename, std::error_code& ec, std::string_view extraHeader) : DataLogWriter{s_defaultMessageLog, filename, ec, extraHeader} {} -DataLogWriter::DataLogWriter(wpi::util::Logger& msglog, std::string_view filename, - std::error_code& ec, std::string_view extraHeader) +DataLogWriter::DataLogWriter(wpi::util::Logger& msglog, + std::string_view filename, std::error_code& ec, + std::string_view extraHeader) : DataLogWriter{msglog, CheckOpen(filename, ec), extraHeader} { if (ec) { Stop(); @@ -79,8 +80,9 @@ struct WPI_DataLog* WPI_DataLog_CreateWriter( const struct WPI_String* filename, int* errorCode, const struct WPI_String* extraHeader) { std::error_code ec; - auto rv = reinterpret_cast(new DataLogWriter{ - wpi::util::to_string_view(filename), ec, wpi::util::to_string_view(extraHeader)}); + auto rv = reinterpret_cast( + new DataLogWriter{wpi::util::to_string_view(filename), ec, + wpi::util::to_string_view(extraHeader)}); *errorCode = ec.value(); return rv; } diff --git a/datalog/src/main/native/cpp/FileLogger.cpp b/datalog/src/main/native/cpp/FileLogger.cpp index 5f5cf834e3..2d0164d5b4 100644 --- a/datalog/src/main/native/cpp/FileLogger.cpp +++ b/datalog/src/main/native/cpp/FileLogger.cpp @@ -87,8 +87,8 @@ FileLogger::~FileLogger() { std::function FileLogger::Buffer( std::function callback) { - return [callback, - buf = wpi::util::SmallVector{}](std::string_view data) mutable { + return [callback, buf = wpi::util::SmallVector{}]( + std::string_view data) mutable { buf.append(data.begin(), data.end()); if (!wpi::util::contains({data.data(), data.size()}, "\n")) { return; diff --git a/datalog/src/main/native/include/wpi/datalog/DataLog.hpp b/datalog/src/main/native/include/wpi/datalog/DataLog.hpp index e2ad942e02..cf22d88a2b 100644 --- a/datalog/src/main/native/include/wpi/datalog/DataLog.hpp +++ b/datalog/src/main/native/include/wpi/datalog/DataLog.hpp @@ -31,7 +31,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::log { @@ -159,7 +159,8 @@ class DataLog { * @param timestamp Time stamp (0 to indicate now) */ template - void AddProtobufSchema(wpi::util::ProtobufMessage& msg, int64_t timestamp = 0) { + void AddProtobufSchema(wpi::util::ProtobufMessage& msg, + int64_t timestamp = 0) { if (timestamp == 0) { timestamp = wpi::util::Now(); } @@ -1313,8 +1314,8 @@ class StructLogEntry : public DataLogEntry { : m_info{std::move(info)...} { m_log = &log; log.AddStructSchema(info..., timestamp); - m_entry = - log.Start(name, wpi::util::GetStructTypeString(info...), metadata, timestamp); + m_entry = log.Start(name, wpi::util::GetStructTypeString(info...), + metadata, timestamp); } StructLogEntry(StructLogEntry&& rhs) @@ -1443,7 +1444,8 @@ class StructArrayLogEntry : public DataLogEntry { m_log = &log; log.AddStructSchema(info..., timestamp); m_entry = log.Start( - name, wpi::util::MakeStructArrayTypeString(info...), + name, + wpi::util::MakeStructArrayTypeString(info...), metadata, timestamp); } diff --git a/datalog/src/main/native/include/wpi/datalog/DataLogBackgroundWriter.hpp b/datalog/src/main/native/include/wpi/datalog/DataLogBackgroundWriter.hpp index abdac8166f..4a8b7cdbe9 100644 --- a/datalog/src/main/native/include/wpi/datalog/DataLogBackgroundWriter.hpp +++ b/datalog/src/main/native/include/wpi/datalog/DataLogBackgroundWriter.hpp @@ -18,7 +18,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::log { diff --git a/datalog/src/main/native/include/wpi/datalog/DataLogReaderThread.hpp b/datalog/src/main/native/include/wpi/datalog/DataLogReaderThread.hpp index 1651389412..cc08956730 100644 --- a/datalog/src/main/native/include/wpi/datalog/DataLogReaderThread.hpp +++ b/datalog/src/main/native/include/wpi/datalog/DataLogReaderThread.hpp @@ -85,7 +85,9 @@ class DataLogReaderThread { return it->second; } - wpi::util::StructDescriptorDatabase& GetStructDatabase() { return m_structDb; } + wpi::util::StructDescriptorDatabase& GetStructDatabase() { + return m_structDb; + } upb_DefPool* GetProtobufDatabase() { return m_protoPool; } upb_Arena* GetProtobufArena() { return m_arena; } diff --git a/datalog/src/main/native/include/wpi/datalog/DataLogWriter.hpp b/datalog/src/main/native/include/wpi/datalog/DataLogWriter.hpp index fdf4f075ac..15c8d3a931 100644 --- a/datalog/src/main/native/include/wpi/datalog/DataLogWriter.hpp +++ b/datalog/src/main/native/include/wpi/datalog/DataLogWriter.hpp @@ -13,7 +13,7 @@ namespace wpi::util { class raw_ostream; class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::log { @@ -62,7 +62,8 @@ class DataLogWriter final : public DataLog { * @param os output stream * @param extraHeader extra header data */ - DataLogWriter(wpi::util::Logger& msglog, std::unique_ptr os, + DataLogWriter(wpi::util::Logger& msglog, + std::unique_ptr os, std::string_view extraHeader = ""); ~DataLogWriter() final; diff --git a/datalog/src/test/native/cpp/DataLogTest.cpp b/datalog/src/test/native/cpp/DataLogTest.cpp index b02a920be5..620dffe525 100644 --- a/datalog/src/test/native/cpp/DataLogTest.cpp +++ b/datalog/src/test/native/cpp/DataLogTest.cpp @@ -131,8 +131,8 @@ class DataLogTest : public ::testing::Test { public: wpi::util::Logger msglog; std::vector data; - wpi::log::DataLogWriter log{msglog, - std::make_unique(data)}; + wpi::log::DataLogWriter log{ + msglog, std::make_unique(data)}; }; TEST_F(DataLogTest, SimpleInt) { diff --git a/glass/src/app/native/cpp/main.cpp b/glass/src/app/native/cpp/main.cpp index aceaa81b6a..c94a70f018 100644 --- a/glass/src/app/native/cpp/main.cpp +++ b/glass/src/app/native/cpp/main.cpp @@ -41,7 +41,8 @@ static std::unique_ptr gPlotProvider; static std::unique_ptr gNtProvider; static std::unique_ptr gNetworkTablesModel; -static std::unique_ptr gNetworkTablesSettings; +static std::unique_ptr + gNetworkTablesSettings; static wpi::glass::LogData gNetworkTablesLog; static std::unique_ptr gNetworkTablesWindow; static std::unique_ptr gNetworkTablesInfoWindow; @@ -95,7 +96,8 @@ static std::string MakeTitle(NT_Inst inst, wpi::nt::Event event) { static void NtInitialize() { auto inst = wpi::nt::GetDefaultInstance(); auto poller = wpi::nt::CreateListenerPoller(inst); - wpi::nt::AddPolledListener(poller, inst, NT_EVENT_CONNECTION | NT_EVENT_IMMEDIATE); + wpi::nt::AddPolledListener(poller, inst, + NT_EVENT_CONNECTION | NT_EVENT_IMMEDIATE); wpi::nt::AddPolledLogger(poller, NT_LOG_INFO, 100); gui::AddEarlyExecute([inst, poller] { auto win = gui::GetSystemWindow(); @@ -149,9 +151,10 @@ static void NtInitialize() { gui::AddEarlyExecute([] { gNetworkTablesModel->Update(); }); gNetworkTablesWindow = std::make_unique( - wpi::glass::GetStorageRoot().GetChild("NetworkTables View"), "NetworkTables"); - gNetworkTablesWindow->SetView( - std::make_unique(gNetworkTablesModel.get())); + wpi::glass::GetStorageRoot().GetChild("NetworkTables View"), + "NetworkTables"); + gNetworkTablesWindow->SetView(std::make_unique( + gNetworkTablesModel.get())); gNetworkTablesWindow->SetDefaultPos(250, 277); gNetworkTablesWindow->SetDefaultSize(750, 185); gNetworkTablesWindow->DisableRenamePopup(); @@ -161,8 +164,9 @@ static void NtInitialize() { gNetworkTablesInfoWindow = std::make_unique( wpi::glass::GetStorageRoot().GetChild("NetworkTables Info"), "NetworkTables Info"); - gNetworkTablesInfoWindow->SetView(wpi::glass::MakeFunctionView( - [&] { wpi::glass::DisplayNetworkTablesInfo(gNetworkTablesModel.get()); })); + gNetworkTablesInfoWindow->SetView(wpi::glass::MakeFunctionView([&] { + wpi::glass::DisplayNetworkTablesInfo(gNetworkTablesModel.get()); + })); gNetworkTablesInfoWindow->SetDefaultPos(250, 130); gNetworkTablesInfoWindow->SetDefaultSize(750, 145); gNetworkTablesInfoWindow->SetDefaultVisibility(wpi::glass::Window::kHide); @@ -228,7 +232,7 @@ int main(int argc, char** argv) { wpi::glass::SetStorageName("glass"); wpi::glass::SetStorageDir(saveDir.empty() ? gui::GetPlatformSaveFileDir() - : saveDir); + : saveDir); gPlotProvider->GlobalInit(); gui::AddInit([] { wpi::glass::ResetTime(); }); gNtProvider->GlobalInit(); @@ -328,12 +332,13 @@ int main(int argc, char** argv) { char nameBuf[32]; const char* name = glfwGetKeyName(*gEnterKey, 0); if (!name) { - wpi::util::format_to_n_c_str(nameBuf, sizeof(nameBuf), "{}", *gEnterKey); + wpi::util::format_to_n_c_str(nameBuf, sizeof(nameBuf), "{}", + *gEnterKey); name = nameBuf; } wpi::util::format_to_n_c_str(editLabel, sizeof(editLabel), "{}###edit", - gKeyEdit ? "(press key)" : name); + gKeyEdit ? "(press key)" : name); if (ImGui::SmallButton(editLabel)) { gKeyEdit = true; diff --git a/glass/src/lib/native/cpp/Context.cpp b/glass/src/lib/native/cpp/Context.cpp index dcfa9dc345..507f1e95e0 100644 --- a/glass/src/lib/native/cpp/Context.cpp +++ b/glass/src/lib/native/cpp/Context.cpp @@ -136,8 +136,9 @@ static bool LoadWindowStorageImpl(const std::string& filename) { return false; } try { - return JsonToWindow(wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()), - filename.c_str()); + return JsonToWindow( + wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()), + filename.c_str()); } catch (wpi::util::json::parse_error& e) { ImGui::LogText("Error loading %s: %s", filename.c_str(), e.what()); return false; @@ -154,8 +155,9 @@ static bool LoadStorageRootImpl(Context* ctx, const std::string& filename, } auto [it, createdStorage] = ctx->storageRoots.try_emplace(rootName); try { - it->second.FromJson(wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()), - filename.c_str()); + it->second.FromJson( + wpi::util::json::parse(fileBuffer.value()->GetCharBuffer()), + filename.c_str()); } catch (wpi::util::json::parse_error& e) { ImGui::LogText("Error loading %s: %s", filename.c_str(), e.what()); if (createdStorage) { @@ -214,8 +216,10 @@ static wpi::util::json WindowToJson() { if (line[0] == '[') { // new section auto [section, subsection] = wpi::util::split(line, ']'); - section = wpi::util::drop_front(section); // drop '['; ']' was dropped by split - subsection = wpi::util::drop_back(wpi::util::drop_front(subsection)); // drop [] + section = + wpi::util::drop_front(section); // drop '['; ']' was dropped by split + subsection = + wpi::util::drop_back(wpi::util::drop_front(subsection)); // drop [] auto& jsection = out[section]; if (jsection.is_null()) { jsection = wpi::util::json::object(); @@ -472,7 +476,7 @@ void wpi::glass::End() { } bool wpi::glass::BeginChild(const char* str_id, const ImVec2& size, bool border, - ImGuiWindowFlags flags) { + ImGuiWindowFlags flags) { PushStorageStack(str_id); return ImGui::BeginChild(str_id, size, border, flags); } diff --git a/glass/src/lib/native/cpp/DataSource.cpp b/glass/src/lib/native/cpp/DataSource.cpp index 133daa72e6..23d946d9fd 100644 --- a/glass/src/lib/native/cpp/DataSource.cpp +++ b/glass/src/lib/native/cpp/DataSource.cpp @@ -20,7 +20,8 @@ std::string wpi::glass::MakeSourceId(std::string_view id, int index) { return fmt::format("{}[{}]", id, index); } -std::string wpi::glass::MakeSourceId(std::string_view id, int index, int index2) { +std::string wpi::glass::MakeSourceId(std::string_view id, int index, + int index2) { return fmt::format("{}[{},{}]", id, index, index2); } diff --git a/glass/src/lib/native/cpp/Storage.cpp b/glass/src/lib/native/cpp/Storage.cpp index 078db7bddb..a0cb6e8683 100644 --- a/glass/src/lib/native/cpp/Storage.cpp +++ b/glass/src/lib/native/cpp/Storage.cpp @@ -345,7 +345,8 @@ void Storage::EraseChildren() { }); } -static bool JsonArrayToStorage(Storage::Value* valuePtr, const wpi::util::json& jarr, +static bool JsonArrayToStorage(Storage::Value* valuePtr, + const wpi::util::json& jarr, const char* filename) { auto& arr = jarr.get_ref(); if (arr.empty()) { diff --git a/glass/src/lib/native/cpp/hardware/AnalogInput.cpp b/glass/src/lib/native/cpp/hardware/AnalogInput.cpp index 54d2bfd289..a2a35f7f09 100644 --- a/glass/src/lib/native/cpp/hardware/AnalogInput.cpp +++ b/glass/src/lib/native/cpp/hardware/AnalogInput.cpp @@ -25,7 +25,8 @@ void wpi::glass::DisplayAnalogInput(AnalogInputModel* model, int index) { std::string& name = GetStorage().GetString("name"); char label[128]; if (!name.empty()) { - wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{}]###name", name, index); + wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{}]###name", name, + index); } else { wpi::util::format_to_n_c_str(label, sizeof(label), "In[{}]###name", index); } @@ -48,7 +49,7 @@ void wpi::glass::DisplayAnalogInput(AnalogInputModel* model, int index) { } void wpi::glass::DisplayAnalogInputs(AnalogInputsModel* model, - std::string_view noneMsg) { + std::string_view noneMsg) { ImGui::Text("(Use Ctrl+Click to edit value)"); bool hasAny = false; bool first = true; diff --git a/glass/src/lib/native/cpp/hardware/DIO.cpp b/glass/src/lib/native/cpp/hardware/DIO.cpp index bf271fb8c3..c3de87e1ba 100644 --- a/glass/src/lib/native/cpp/hardware/DIO.cpp +++ b/glass/src/lib/native/cpp/hardware/DIO.cpp @@ -106,7 +106,7 @@ void wpi::glass::DisplayDIO(DIOModel* model, int index, bool outputsEnabled) { } void wpi::glass::DisplayDIOs(DIOsModel* model, bool outputsEnabled, - std::string_view noneMsg) { + std::string_view noneMsg) { bool hasAny = false; ImGui::PushItemWidth(ImGui::GetFontSize() * 8); diff --git a/glass/src/lib/native/cpp/hardware/Encoder.cpp b/glass/src/lib/native/cpp/hardware/Encoder.cpp index f5c21f9d14..8ab3b481aa 100644 --- a/glass/src/lib/native/cpp/hardware/Encoder.cpp +++ b/glass/src/lib/native/cpp/hardware/Encoder.cpp @@ -73,11 +73,11 @@ void wpi::glass::DisplayEncoder(EncoderModel* model) { std::string& name = GetStorage().GetString("name"); char label[128]; if (!name.empty()) { - wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{},{}]###header", name, - chA, chB); + wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{},{}]###header", + name, chA, chB); } else { - wpi::util::format_to_n_c_str(label, sizeof(label), "Encoder[{},{}]###header", chA, - chB); + wpi::util::format_to_n_c_str(label, sizeof(label), + "Encoder[{},{}]###header", chA, chB); } // header @@ -159,7 +159,8 @@ void wpi::glass::DisplayEncoder(EncoderModel* model) { ImGui::PopItemWidth(); } -void wpi::glass::DisplayEncoders(EncodersModel* model, std::string_view noneMsg) { +void wpi::glass::DisplayEncoders(EncodersModel* model, + std::string_view noneMsg) { bool hasAny = false; model->ForEachEncoder([&](EncoderModel& encoder, int i) { hasAny = true; diff --git a/glass/src/lib/native/cpp/hardware/PWM.cpp b/glass/src/lib/native/cpp/hardware/PWM.cpp index 09fc4bf3b6..13982e0747 100644 --- a/glass/src/lib/native/cpp/hardware/PWM.cpp +++ b/glass/src/lib/native/cpp/hardware/PWM.cpp @@ -25,7 +25,8 @@ void wpi::glass::DisplayPWM(PWMModel* model, int index, bool outputsEnabled) { std::string& name = GetStorage().GetString("name"); char label[128]; if (!name.empty()) { - wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{}]###name", name, index); + wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{}]###name", name, + index); } else { wpi::util::format_to_n_c_str(label, sizeof(label), "PWM[{}]###name", index); } @@ -39,7 +40,7 @@ void wpi::glass::DisplayPWM(PWMModel* model, int index, bool outputsEnabled) { } void wpi::glass::DisplayPWMs(PWMsModel* model, bool outputsEnabled, - std::string_view noneMsg) { + std::string_view noneMsg) { bool hasAny = false; bool first = true; model->ForEachPWM([&](PWMModel& pwm, int i) { diff --git a/glass/src/lib/native/cpp/hardware/Pneumatic.cpp b/glass/src/lib/native/cpp/hardware/Pneumatic.cpp index 4c5329be72..5276ef9ec0 100644 --- a/glass/src/lib/native/cpp/hardware/Pneumatic.cpp +++ b/glass/src/lib/native/cpp/hardware/Pneumatic.cpp @@ -22,7 +22,8 @@ using namespace wpi::glass; bool wpi::glass::DisplayPneumaticControlSolenoids(PneumaticControlModel* model, - int index, bool outputsEnabled) { + int index, + bool outputsEnabled) { wpi::util::SmallVector channels; model->ForEachSolenoid([&](SolenoidModel& solenoid, int j) { if (auto data = solenoid.GetOutputData()) { @@ -49,10 +50,10 @@ bool wpi::glass::DisplayPneumaticControlSolenoids(PneumaticControlModel* model, char label[128]; if (!name.empty()) { wpi::util::format_to_n_c_str(label, sizeof(label), "{} [{}]###header", name, - index); + index); } else { wpi::util::format_to_n_c_str(label, sizeof(label), "{}[{}]###header", - model->GetName(), index); + model->GetName(), index); } // header @@ -87,9 +88,9 @@ bool wpi::glass::DisplayPneumaticControlSolenoids(PneumaticControlModel* model, return true; } -void wpi::glass::DisplayPneumaticControlsSolenoids(PneumaticControlsModel* model, - bool outputsEnabled, - std::string_view noneMsg) { +void wpi::glass::DisplayPneumaticControlsSolenoids( + PneumaticControlsModel* model, bool outputsEnabled, + std::string_view noneMsg) { bool hasAny = false; model->ForEachPneumaticControl( [&](PneumaticControlModel& pneumaticControl, int i) { @@ -106,7 +107,7 @@ void wpi::glass::DisplayPneumaticControlsSolenoids(PneumaticControlsModel* model } void wpi::glass::DisplayCompressorDevice(CompressorModel* model, int index, - bool outputsEnabled) { + bool outputsEnabled) { if (!model || !model->Exists()) { return; } @@ -155,7 +156,7 @@ void wpi::glass::DisplayCompressorDevice(CompressorModel* model, int index, } void wpi::glass::DisplayCompressorsDevice(PneumaticControlsModel* model, - bool outputsEnabled) { + bool outputsEnabled) { model->ForEachPneumaticControl( [&](PneumaticControlModel& pneumaticControl, int i) { DisplayCompressorDevice(pneumaticControl.GetCompressor(), i, diff --git a/glass/src/lib/native/cpp/hardware/PowerDistribution.cpp b/glass/src/lib/native/cpp/hardware/PowerDistribution.cpp index 8a474e273a..e2f12ae20a 100644 --- a/glass/src/lib/native/cpp/hardware/PowerDistribution.cpp +++ b/glass/src/lib/native/cpp/hardware/PowerDistribution.cpp @@ -34,9 +34,11 @@ static float DisplayChannel(PowerDistributionModel& pdp, int channel) { return width; } -void wpi::glass::DisplayPowerDistribution(PowerDistributionModel* model, int index) { +void wpi::glass::DisplayPowerDistribution(PowerDistributionModel* model, + int index) { char name[128]; - wpi::util::format_to_n_c_str(name, sizeof(name), "PowerDistribution[{}]", index); + wpi::util::format_to_n_c_str(name, sizeof(name), "PowerDistribution[{}]", + index); if (CollapsingHeader(name)) { // temperature @@ -81,7 +83,7 @@ void wpi::glass::DisplayPowerDistribution(PowerDistributionModel* model, int ind } void wpi::glass::DisplayPowerDistributions(PowerDistributionsModel* model, - std::string_view noneMsg) { + std::string_view noneMsg) { bool hasAny = false; model->ForEachPowerDistribution([&](PowerDistributionModel& pdp, int i) { hasAny = true; diff --git a/glass/src/lib/native/cpp/other/DeviceTree.cpp b/glass/src/lib/native/cpp/other/DeviceTree.cpp index 4e57218ca3..47e80af54d 100644 --- a/glass/src/lib/native/cpp/other/DeviceTree.cpp +++ b/glass/src/lib/native/cpp/other/DeviceTree.cpp @@ -151,28 +151,28 @@ static inline bool DeviceValueImpl(const char* name, bool readonly, } bool wpi::glass::DeviceBoolean(const char* name, bool readonly, bool* value, - const DataSource* source) { + const DataSource* source) { return DeviceValueImpl(name, readonly, source, DeviceBooleanImpl, value); } bool wpi::glass::DeviceDouble(const char* name, bool readonly, double* value, - const DataSource* source) { + const DataSource* source) { return DeviceValueImpl(name, readonly, source, DeviceDoubleImpl, value); } bool wpi::glass::DeviceEnum(const char* name, bool readonly, int* value, - const char** options, int32_t numOptions, - const DataSource* source) { + const char** options, int32_t numOptions, + const DataSource* source) { return DeviceValueImpl(name, readonly, source, DeviceEnumImpl, value, options, numOptions); } bool wpi::glass::DeviceInt(const char* name, bool readonly, int32_t* value, - const DataSource* source) { + const DataSource* source) { return DeviceValueImpl(name, readonly, source, DeviceIntImpl, value); } bool wpi::glass::DeviceLong(const char* name, bool readonly, int64_t* value, - const DataSource* source) { + const DataSource* source) { return DeviceValueImpl(name, readonly, source, DeviceLongImpl, value); } diff --git a/glass/src/lib/native/cpp/other/Field2D.cpp b/glass/src/lib/native/cpp/other/Field2D.cpp index 1bcf1b5913..099647102c 100644 --- a/glass/src/lib/native/cpp/other/Field2D.cpp +++ b/glass/src/lib/native/cpp/other/Field2D.cpp @@ -48,9 +48,10 @@ enum DisplayUnits { kDisplayMeters = 0, kDisplayFeet, kDisplayInches }; // Per-frame field data (not persistent) struct FieldFrameData { wpi::math::Translation2d GetPosFromScreen(const ImVec2& cursor) const { - return { - wpi::units::meter_t{(std::clamp(cursor.x, min.x, max.x) - min.x) / scale}, - wpi::units::meter_t{(max.y - std::clamp(cursor.y, min.y, max.y)) / scale}}; + return {wpi::units::meter_t{(std::clamp(cursor.x, min.x, max.x) - min.x) / + scale}, + wpi::units::meter_t{(max.y - std::clamp(cursor.y, min.y, max.y)) / + scale}}; } ImVec2 GetScreenFromPos(const wpi::math::Translation2d& pos) const { return {min.x + scale * pos.X().to(), @@ -94,7 +95,9 @@ class PopupState { SelectedTargetInfo* GetTarget() { return &m_target; } FieldObjectModel* GetInsertModel() { return m_insertModel; } - std::span GetInsertPoses() const { return m_insertPoses; } + std::span GetInsertPoses() const { + return m_insertPoses; + } void Display(Field2DModel* model, const FieldFrameData& ffd); @@ -282,8 +285,9 @@ static double ConvertDisplayAngle(wpi::units::degree_t v) { return v.value(); } -static bool InputLength(const char* label, wpi::units::meter_t* v, double step = 0.0, - double step_fast = 0.0, const char* format = "%.6f", +static bool InputLength(const char* label, wpi::units::meter_t* v, + double step = 0.0, double step_fast = 0.0, + const char* format = "%.6f", ImGuiInputTextFlags flags = 0) { double dv = ConvertDisplayLength(*v); if (ImGui::InputDouble(label, &dv, step, step_fast, format, flags)) { @@ -316,8 +320,9 @@ static bool InputFloatLength(const char* label, float* v, double step = 0.0, return false; } -static bool InputAngle(const char* label, wpi::units::degree_t* v, double step = 0.0, - double step_fast = 0.0, const char* format = "%.6f", +static bool InputAngle(const char* label, wpi::units::degree_t* v, + double step = 0.0, double step_fast = 0.0, + const char* format = "%.6f", ImGuiInputTextFlags flags = 0) { double dv = ConvertDisplayAngle(*v); if (ImGui::InputDouble(label, &dv, step, step_fast, format, flags)) { @@ -465,7 +470,8 @@ bool FieldInfo::LoadJson(std::span is, std::string_view filename) { try { image = j.at("field-image").get(); } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "GUI: JSON: could not read field-image: {}\n", e.what()); + wpi::util::print(stderr, "GUI: JSON: could not read field-image: {}\n", + e.what()); return false; } @@ -478,7 +484,7 @@ bool FieldInfo::LoadJson(std::span is, std::string_view filename) { right = j.at("field-corners").at("bottom-right").at(0).get(); } catch (const wpi::util::json::exception& e) { wpi::util::print(stderr, "GUI: JSON: could not read field-corners: {}\n", - e.what()); + e.what()); return false; } @@ -489,7 +495,8 @@ bool FieldInfo::LoadJson(std::span is, std::string_view filename) { width = j.at("field-size").at(0).get(); height = j.at("field-size").at(1).get(); } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "GUI: JSON: could not read field-size: {}\n", e.what()); + wpi::util::print(stderr, "GUI: JSON: could not read field-size: {}\n", + e.what()); return false; } @@ -498,7 +505,8 @@ bool FieldInfo::LoadJson(std::span is, std::string_view filename) { try { unit = j.at("field-unit").get(); } catch (const wpi::util::json::exception& e) { - wpi::util::print(stderr, "GUI: JSON: could not read field-unit: {}\n", e.what()); + wpi::util::print(stderr, "GUI: JSON: could not read field-unit: {}\n", + e.what()); return false; } @@ -513,9 +521,9 @@ bool FieldInfo::LoadJson(std::span is, std::string_view filename) { int fieldHeight = m_bottom - m_top; if (std::abs((fieldWidth / width) - (fieldHeight / height)) > 0.3) { wpi::util::print(stderr, - "GUI: Field X and Y scaling substantially different: " - "xscale={} yscale={}\n", - (fieldWidth / width), (fieldHeight / height)); + "GUI: Field X and Y scaling substantially different: " + "xscale={} yscale={}\n", + (fieldWidth / width), (fieldHeight / height)); } if (!filename.empty()) { @@ -772,8 +780,9 @@ bool ObjectInfo::LoadImageImpl(const std::string& fn) { return true; } -PoseFrameData::PoseFrameData(const wpi::math::Pose2d& pose, FieldObjectModel& model, - size_t index, const FieldFrameData& ffd, +PoseFrameData::PoseFrameData(const wpi::math::Pose2d& pose, + FieldObjectModel& model, size_t index, + const FieldFrameData& ffd, const DisplayOptions& displayOptions) : m_model{model}, m_index{index}, @@ -1086,7 +1095,7 @@ void FieldDisplay::Display(FieldInfo* field, Field2DModel* model, if (target->corner != 1) { gDragState.initialAngle = wpi::units::radian_t{std::atan2(gDragState.initialOffset.y, - gDragState.initialOffset.x)} + + gDragState.initialOffset.x)} + target->rot; } } @@ -1182,7 +1191,8 @@ void PopupState::Display(Field2DModel* model, const FieldFrameData& ffd) { void PopupState::DisplayTarget(Field2DModel* model, const FieldFrameData& ffd) { ImGui::Text("%s[%d]", m_target.name.c_str(), static_cast(m_target.index)); - wpi::math::Pose2d pose{ffd.GetPosFromScreen(m_target.poseCenter), m_target.rot}; + wpi::math::Pose2d pose{ffd.GetPosFromScreen(m_target.poseCenter), + m_target.rot}; if (InputPose(&pose)) { m_target.poseCenter = ffd.GetScreenFromPos(pose.Translation()); m_target.rot = pose.Rotation().Radians(); @@ -1277,7 +1287,8 @@ void PopupState::DisplayInsert(Field2DModel* model) { } } -void wpi::glass::DisplayField2D(Field2DModel* model, const ImVec2& contentSize) { +void wpi::glass::DisplayField2D(Field2DModel* model, + const ImVec2& contentSize) { auto& storage = GetStorage(); auto field = storage.GetData(); if (!field) { diff --git a/glass/src/lib/native/cpp/other/Mechanism2D.cpp b/glass/src/lib/native/cpp/other/Mechanism2D.cpp index 464b0e3222..ef5a0273ce 100644 --- a/glass/src/lib/native/cpp/other/Mechanism2D.cpp +++ b/glass/src/lib/native/cpp/other/Mechanism2D.cpp @@ -38,9 +38,10 @@ namespace { // Per-frame data (not persistent) struct FrameData { wpi::math::Translation2d GetPosFromScreen(const ImVec2& cursor) const { - return { - wpi::units::meter_t{(std::clamp(cursor.x, min.x, max.x) - min.x) / scale}, - wpi::units::meter_t{(max.y - std::clamp(cursor.y, min.y, max.y)) / scale}}; + return {wpi::units::meter_t{(std::clamp(cursor.x, min.x, max.x) - min.x) / + scale}, + wpi::units::meter_t{(max.y - std::clamp(cursor.y, min.y, max.y)) / + scale}}; } ImVec2 GetScreenFromPos(const wpi::math::Translation2d& pos) const { return {min.x + scale * pos.X().to(), @@ -67,7 +68,8 @@ class BackgroundInfo { void DisplaySettings(); void LoadImage(); - FrameData GetFrameData(ImVec2 min, ImVec2 max, wpi::math::Translation2d dims) const; + FrameData GetFrameData(ImVec2 min, ImVec2 max, + wpi::math::Translation2d dims) const; void Draw(ImDrawList* drawList, const FrameData& frameData, ImU32 bgColor) const; @@ -184,11 +186,12 @@ void FrameData::DrawObject(ImDrawList* drawList, MechanismObjectModel& objModel, const wpi::math::Pose2d& pose) const { const char* type = objModel.GetType(); if (std::string_view{type} == "line") { - auto startPose = - pose + wpi::math::Transform2d{wpi::math::Translation2d{}, objModel.GetAngle()}; + auto startPose = pose + wpi::math::Transform2d{wpi::math::Translation2d{}, + objModel.GetAngle()}; auto endPose = startPose + - wpi::math::Transform2d{wpi::math::Translation2d{objModel.GetLength(), 0_m}, 0_deg}; + wpi::math::Transform2d{ + wpi::math::Translation2d{objModel.GetLength(), 0_m}, 0_deg}; drawList->AddLine(GetScreenFromPos(startPose.Translation()), GetScreenFromPos(endPose.Translation()), objModel.GetColor(), objModel.GetWeight()); @@ -203,7 +206,7 @@ void FrameData::DrawGroup(ImDrawList* drawList, MechanismObjectGroup& group, } void wpi::glass::DisplayMechanism2D(Mechanism2DModel* model, - const ImVec2& contentSize) { + const ImVec2& contentSize) { auto& storage = GetStorage(); auto bg = storage.GetData(); if (!bg) { diff --git a/glass/src/lib/native/cpp/other/Plot.cpp b/glass/src/lib/native/cpp/other/Plot.cpp index 7f9b116f87..ae9ac3b9bd 100644 --- a/glass/src/lib/native/cpp/other/Plot.cpp +++ b/glass/src/lib/native/cpp/other/Plot.cpp @@ -350,8 +350,9 @@ PlotSeries::Action PlotSeries::EmitPlot(PlotView& view, double now, size_t i, CheckSource(); char label[128]; - wpi::util::format_to_n_c_str(label, sizeof(label), "{}###name{}_{}", GetName(), - static_cast(i), static_cast(plotIndex)); + wpi::util::format_to_n_c_str(label, sizeof(label), "{}###name{}_{}", + GetName(), static_cast(i), + static_cast(plotIndex)); int size = m_size; int offset = m_offset; @@ -619,7 +620,7 @@ void Plot::EmitPlot(PlotView& view, double now, bool paused, size_t i) { char label[128]; wpi::util::format_to_n_c_str(label, sizeof(label), "{}###plot{}", m_name, - static_cast(i)); + static_cast(i)); ImPlotFlags plotFlags = (m_legend ? 0 : ImPlotFlags_NoLegend) | (m_crosshairs ? ImPlotFlags_Crosshairs : 0) | @@ -976,15 +977,16 @@ void PlotView::Settings() { char name[64]; if (!plot->GetName().empty()) { - wpi::util::format_to_n_c_str(name, sizeof(name), "{}", plot->GetName().c_str()); + wpi::util::format_to_n_c_str(name, sizeof(name), "{}", + plot->GetName().c_str()); } else { wpi::util::format_to_n_c_str(name, sizeof(name), "Plot {}", - static_cast(i)); + static_cast(i)); } char label[90]; wpi::util::format_to_n_c_str(label, sizeof(label), "{}###header{}", name, - static_cast(i)); + static_cast(i)); bool open = ImGui::CollapsingHeader(label); @@ -1053,7 +1055,8 @@ void PlotProvider::DisplayMenu() { char id[32]; size_t numWindows = m_windows.size(); for (size_t i = 0; i <= numWindows; ++i) { - wpi::util::format_to_n_c_str(id, sizeof(id), "Plot <{}>", static_cast(i)); + wpi::util::format_to_n_c_str(id, sizeof(id), "Plot <{}>", + static_cast(i)); bool match = false; for (size_t j = 0; j < numWindows; ++j) { diff --git a/glass/src/lib/native/cpp/support/ExpressionParser.cpp b/glass/src/lib/native/cpp/support/ExpressionParser.cpp index dd2b0bb723..54c7878407 100644 --- a/glass/src/lib/native/cpp/support/ExpressionParser.cpp +++ b/glass/src/lib/native/cpp/support/ExpressionParser.cpp @@ -220,7 +220,7 @@ std::optional ValueFromString(std::string_view str) { template wpi::util::expected EvalAll(std::stack& operStack, - std::stack& valStack) { + std::stack& valStack) { while (!operStack.empty()) { if (valStack.size() < 2) { return wpi::util::unexpected("Missing operand"); @@ -307,7 +307,8 @@ wpi::util::expected ParseExpr(Lexer& lexer, bool insideParen) { // Acts as if there was open paren at start of expression. EvalAll will // clear both stacks, and leave the result value on top of valStack. // This makes sure everything inside the parentheses is evaluated first - wpi::util::expected result = EvalAll(operStack, valStack); + wpi::util::expected result = + EvalAll(operStack, valStack); if (!result) { return result; } @@ -316,7 +317,7 @@ wpi::util::expected ParseExpr(Lexer& lexer, bool insideParen) { case TokenType::Error: return wpi::util::unexpected(std::string("Unexpected character: ") - .append(token.str, token.strLen)); + .append(token.str, token.strLen)); default: Operator op = GetOperator(token.type); diff --git a/glass/src/lib/native/cpp/support/NameSetting.cpp b/glass/src/lib/native/cpp/support/NameSetting.cpp index 8abfaf0d1d..f2db6f311d 100644 --- a/glass/src/lib/native/cpp/support/NameSetting.cpp +++ b/glass/src/lib/native/cpp/support/NameSetting.cpp @@ -32,9 +32,11 @@ void NameSetting::GetName(char* buf, size_t size, const char* defaultName, void NameSetting::GetName(char* buf, size_t size, const char* defaultName, int index, int index2) const { if (!m_name.empty()) { - wpi::util::format_to_n_c_str(buf, size, "{} [{},{}]", m_name, index, index2); + wpi::util::format_to_n_c_str(buf, size, "{} [{},{}]", m_name, index, + index2); } else { - wpi::util::format_to_n_c_str(buf, size, "{}[{},{}]", defaultName, index, index2); + wpi::util::format_to_n_c_str(buf, size, "{}[{},{}]", defaultName, index, + index2); } } @@ -43,28 +45,30 @@ void NameSetting::GetLabel(char* buf, size_t size, if (!m_name.empty()) { wpi::util::format_to_n_c_str(buf, size, "{}###Name{}", m_name, defaultName); } else { - wpi::util::format_to_n_c_str(buf, size, "{}###Name{}", defaultName, defaultName); + wpi::util::format_to_n_c_str(buf, size, "{}###Name{}", defaultName, + defaultName); } } void NameSetting::GetLabel(char* buf, size_t size, const char* defaultName, int index) const { if (!m_name.empty()) { - wpi::util::format_to_n_c_str(buf, size, "{} [{}]###Name{}", m_name, index, index); + wpi::util::format_to_n_c_str(buf, size, "{} [{}]###Name{}", m_name, index, + index); } else { - wpi::util::format_to_n_c_str(buf, size, "{}[{}]###Name{}", defaultName, index, - index); + wpi::util::format_to_n_c_str(buf, size, "{}[{}]###Name{}", defaultName, + index, index); } } void NameSetting::GetLabel(char* buf, size_t size, const char* defaultName, int index, int index2) const { if (!m_name.empty()) { - wpi::util::format_to_n_c_str(buf, size, "{} [{},{}]###Name{}", m_name, index, - index2, index); + wpi::util::format_to_n_c_str(buf, size, "{} [{},{}]###Name{}", m_name, + index, index2, index); } else { - wpi::util::format_to_n_c_str(buf, size, "{}[{},{}]###Name{}", defaultName, index, - index2, index); + wpi::util::format_to_n_c_str(buf, size, "{}[{},{}]###Name{}", defaultName, + index, index2, index); } } diff --git a/glass/src/lib/native/include/wpi/glass/DataSource.hpp b/glass/src/lib/native/include/wpi/glass/DataSource.hpp index a7f1a16397..99b9ba1b85 100644 --- a/glass/src/lib/native/include/wpi/glass/DataSource.hpp +++ b/glass/src/lib/native/include/wpi/glass/DataSource.hpp @@ -208,7 +208,8 @@ class StringSource : public DataSource { return {buf.begin(), buf.end()}; } - wpi::util::sig::SignalBase valueChanged; + wpi::util::sig::SignalBase + valueChanged; private: std::string m_value; diff --git a/glass/src/lib/native/include/wpi/glass/Storage.hpp b/glass/src/lib/native/include/wpi/glass/Storage.hpp index ea611ffdce..9ac50d5e8a 100644 --- a/glass/src/lib/native/include/wpi/glass/Storage.hpp +++ b/glass/src/lib/native/include/wpi/glass/Storage.hpp @@ -213,7 +213,8 @@ class Storage { * @param toJson replacement for ToJson() */ void SetCustomJson( - std::function fromJson, + std::function + fromJson, std::function toJson) { m_fromJson = std::move(fromJson); m_toJson = std::move(toJson); @@ -230,7 +231,8 @@ class Storage { private: mutable ValueMap m_values; std::shared_ptr m_data; - std::function m_fromJson; + std::function + m_fromJson; std::function m_toJson; std::function m_clear; std::function m_apply; diff --git a/glass/src/lib/native/include/wpi/glass/View.hpp b/glass/src/lib/native/include/wpi/glass/View.hpp index c81c64a360..a7fd007132 100644 --- a/glass/src/lib/native/include/wpi/glass/View.hpp +++ b/glass/src/lib/native/include/wpi/glass/View.hpp @@ -54,6 +54,7 @@ class View { * @param display Display function * @return unique_ptr to View */ -std::unique_ptr MakeFunctionView(wpi::util::unique_function display); +std::unique_ptr MakeFunctionView( + wpi::util::unique_function display); } // namespace wpi::glass diff --git a/glass/src/lib/native/include/wpi/glass/WindowManager.hpp b/glass/src/lib/native/include/wpi/glass/WindowManager.hpp index c7dfdf311c..475f5aeb26 100644 --- a/glass/src/lib/native/include/wpi/glass/WindowManager.hpp +++ b/glass/src/lib/native/include/wpi/glass/WindowManager.hpp @@ -64,7 +64,8 @@ class WindowManager { * @param display window contents display function * @param defaultVisibility default window visibility */ - Window* AddWindow(std::string_view id, wpi::util::unique_function display, + Window* AddWindow(std::string_view id, + wpi::util::unique_function display, Window::Visibility defaultVisibility = Window::kShow); /** diff --git a/glass/src/lib/native/include/wpi/glass/hardware/AnalogInput.hpp b/glass/src/lib/native/include/wpi/glass/hardware/AnalogInput.hpp index b331e91983..d20ca4d364 100644 --- a/glass/src/lib/native/include/wpi/glass/hardware/AnalogInput.hpp +++ b/glass/src/lib/native/include/wpi/glass/hardware/AnalogInput.hpp @@ -25,7 +25,8 @@ class AnalogInputModel : public Model { class AnalogInputsModel : public Model { public: virtual void ForEachAnalogInput( - wpi::util::function_ref func) = 0; + wpi::util::function_ref + func) = 0; }; void DisplayAnalogInput(AnalogInputModel* model, int index); diff --git a/glass/src/lib/native/include/wpi/glass/hardware/LEDDisplay.hpp b/glass/src/lib/native/include/wpi/glass/hardware/LEDDisplay.hpp index d8367b2623..c3edb9acd5 100644 --- a/glass/src/lib/native/include/wpi/glass/hardware/LEDDisplay.hpp +++ b/glass/src/lib/native/include/wpi/glass/hardware/LEDDisplay.hpp @@ -12,7 +12,7 @@ namespace wpi::util { template class SmallVectorImpl; -} // namespace wpi +} // namespace wpi::util namespace wpi::glass { @@ -24,7 +24,8 @@ class LEDDisplayModel : public wpi::glass::Model { uint8_t b; }; - virtual std::span GetData(wpi::util::SmallVectorImpl& buf) = 0; + virtual std::span GetData( + wpi::util::SmallVectorImpl& buf) = 0; }; class LEDDisplaysModel : public wpi::glass::Model { @@ -32,7 +33,8 @@ class LEDDisplaysModel : public wpi::glass::Model { virtual size_t GetNumLEDDisplays() = 0; virtual void ForEachLEDDisplay( - wpi::util::function_ref func) = 0; + wpi::util::function_ref + func) = 0; }; void DisplayLEDDisplay(LEDDisplayModel* model, int index); diff --git a/glass/src/lib/native/include/wpi/glass/other/FMS.hpp b/glass/src/lib/native/include/wpi/glass/other/FMS.hpp index bcdef5c087..3689108560 100644 --- a/glass/src/lib/native/include/wpi/glass/other/FMS.hpp +++ b/glass/src/lib/native/include/wpi/glass/other/FMS.hpp @@ -11,7 +11,7 @@ namespace wpi::util { template class SmallVectorImpl; -} // namespace wpi +} // namespace wpi::util namespace wpi::glass { diff --git a/glass/src/lib/native/include/wpi/glass/other/Field2D.hpp b/glass/src/lib/native/include/wpi/glass/other/Field2D.hpp index 5bcfa70ab4..7889633ad5 100644 --- a/glass/src/lib/native/include/wpi/glass/other/Field2D.hpp +++ b/glass/src/lib/native/include/wpi/glass/other/Field2D.hpp @@ -34,7 +34,8 @@ class Field2DModel : public Model { virtual FieldObjectModel* AddFieldObject(std::string_view name) = 0; virtual void RemoveFieldObject(std::string_view name) = 0; virtual void ForEachFieldObject( - wpi::util::function_ref + wpi::util::function_ref func) = 0; }; diff --git a/glass/src/lib/native/include/wpi/glass/support/ExpressionParser.hpp b/glass/src/lib/native/include/wpi/glass/support/ExpressionParser.hpp index d35a1957cb..7d29343499 100644 --- a/glass/src/lib/native/include/wpi/glass/support/ExpressionParser.hpp +++ b/glass/src/lib/native/include/wpi/glass/support/ExpressionParser.hpp @@ -15,8 +15,11 @@ namespace wpi::glass::expression { template wpi::util::expected TryParseExpr(const char* expr); -extern template wpi::util::expected TryParseExpr(const char*); -extern template wpi::util::expected TryParseExpr(const char*); -extern template wpi::util::expected TryParseExpr(const char*); +extern template wpi::util::expected TryParseExpr( + const char*); +extern template wpi::util::expected TryParseExpr( + const char*); +extern template wpi::util::expected TryParseExpr( + const char*); } // namespace wpi::glass::expression diff --git a/glass/src/libnt/native/cpp/NTCommandScheduler.cpp b/glass/src/libnt/native/cpp/NTCommandScheduler.cpp index d23a1bd088..a659953cb8 100644 --- a/glass/src/libnt/native/cpp/NTCommandScheduler.cpp +++ b/glass/src/libnt/native/cpp/NTCommandScheduler.cpp @@ -13,10 +13,11 @@ using namespace wpi::glass; NTCommandSchedulerModel::NTCommandSchedulerModel(std::string_view path) - : NTCommandSchedulerModel(wpi::nt::NetworkTableInstance::GetDefault(), path) {} + : NTCommandSchedulerModel(wpi::nt::NetworkTableInstance::GetDefault(), + path) {} -NTCommandSchedulerModel::NTCommandSchedulerModel(wpi::nt::NetworkTableInstance inst, - std::string_view path) +NTCommandSchedulerModel::NTCommandSchedulerModel( + wpi::nt::NetworkTableInstance inst, std::string_view path) : m_inst{inst}, m_name{inst.GetStringTopic(fmt::format("{}/.name", path)).Subscribe("")}, m_commands{inst.GetStringArrayTopic(fmt::format("{}/Names", path)) diff --git a/glass/src/libnt/native/cpp/NTCommandSelector.cpp b/glass/src/libnt/native/cpp/NTCommandSelector.cpp index 3084e7265e..3c119253c6 100644 --- a/glass/src/libnt/native/cpp/NTCommandSelector.cpp +++ b/glass/src/libnt/native/cpp/NTCommandSelector.cpp @@ -13,10 +13,11 @@ using namespace wpi::glass; NTCommandSelectorModel::NTCommandSelectorModel(std::string_view path) - : NTCommandSelectorModel(wpi::nt::NetworkTableInstance::GetDefault(), path) {} + : NTCommandSelectorModel(wpi::nt::NetworkTableInstance::GetDefault(), + path) {} -NTCommandSelectorModel::NTCommandSelectorModel(wpi::nt::NetworkTableInstance inst, - std::string_view path) +NTCommandSelectorModel::NTCommandSelectorModel( + wpi::nt::NetworkTableInstance inst, std::string_view path) : m_inst{inst}, m_running{inst.GetBooleanTopic(fmt::format("{}/running", path)) .GetEntry(false)}, diff --git a/glass/src/libnt/native/cpp/NTDifferentialDrive.cpp b/glass/src/libnt/native/cpp/NTDifferentialDrive.cpp index 2ca21c421f..73ec8601ed 100644 --- a/glass/src/libnt/native/cpp/NTDifferentialDrive.cpp +++ b/glass/src/libnt/native/cpp/NTDifferentialDrive.cpp @@ -15,7 +15,8 @@ using namespace wpi::glass; NTDifferentialDriveModel::NTDifferentialDriveModel(std::string_view path) - : NTDifferentialDriveModel(wpi::nt::NetworkTableInstance::GetDefault(), path) {} + : NTDifferentialDriveModel(wpi::nt::NetworkTableInstance::GetDefault(), + path) {} NTDifferentialDriveModel::NTDifferentialDriveModel( wpi::nt::NetworkTableInstance inst, std::string_view path) diff --git a/glass/src/libnt/native/cpp/NTFMS.cpp b/glass/src/libnt/native/cpp/NTFMS.cpp index e6c134b61f..6c0802010e 100644 --- a/glass/src/libnt/native/cpp/NTFMS.cpp +++ b/glass/src/libnt/native/cpp/NTFMS.cpp @@ -18,7 +18,8 @@ using namespace wpi::glass; NTFMSModel::NTFMSModel(std::string_view path) : NTFMSModel{wpi::nt::NetworkTableInstance::GetDefault(), path} {} -NTFMSModel::NTFMSModel(wpi::nt::NetworkTableInstance inst, std::string_view path) +NTFMSModel::NTFMSModel(wpi::nt::NetworkTableInstance inst, + std::string_view path) : m_inst{inst}, m_gameSpecificMessage{ inst.GetStringTopic(fmt::format("{}/GameSpecificMessage", path)) diff --git a/glass/src/libnt/native/cpp/NTField2D.cpp b/glass/src/libnt/native/cpp/NTField2D.cpp index 439fc1db48..1b70551128 100644 --- a/glass/src/libnt/native/cpp/NTField2D.cpp +++ b/glass/src/libnt/native/cpp/NTField2D.cpp @@ -62,7 +62,8 @@ void NTField2DModel::ObjectModel::NTUpdate(const wpi::nt::Value& value) { m_poses.resize(size / 3); for (size_t i = 0; i < size / 3; ++i) { m_poses[i] = wpi::math::Pose2d{ - wpi::units::meter_t{arr[i * 3 + 0]}, wpi::units::meter_t{arr[i * 3 + 1]}, + wpi::units::meter_t{arr[i * 3 + 0]}, + wpi::units::meter_t{arr[i * 3 + 1]}, wpi::math::Rotation2d{wpi::units::degree_t{arr[i * 3 + 2]}}}; } } @@ -82,7 +83,8 @@ void NTField2DModel::ObjectModel::UpdateNT() { m_pub.Set(arr); } -void NTField2DModel::ObjectModel::SetPoses(std::span poses) { +void NTField2DModel::ObjectModel::SetPoses( + std::span poses) { m_poses.assign(poses.begin(), poses.end()); UpdateNT(); } @@ -102,7 +104,8 @@ void NTField2DModel::ObjectModel::SetPosition(size_t i, } } -void NTField2DModel::ObjectModel::SetRotation(size_t i, wpi::math::Rotation2d rot) { +void NTField2DModel::ObjectModel::SetRotation(size_t i, + wpi::math::Rotation2d rot) { if (i < m_poses.size()) { m_poses[i] = wpi::math::Pose2d{m_poses[i].Translation(), rot}; UpdateNT(); @@ -198,7 +201,8 @@ void NTField2DModel::RemoveFieldObject(std::string_view name) { } void NTField2DModel::ForEachFieldObject( - wpi::util::function_ref + wpi::util::function_ref func) { for (auto&& obj : m_objects) { if (obj->Exists()) { diff --git a/glass/src/libnt/native/cpp/NTGyro.cpp b/glass/src/libnt/native/cpp/NTGyro.cpp index c7e07ebfc0..8a0a28d259 100644 --- a/glass/src/libnt/native/cpp/NTGyro.cpp +++ b/glass/src/libnt/native/cpp/NTGyro.cpp @@ -15,7 +15,8 @@ using namespace wpi::glass; NTGyroModel::NTGyroModel(std::string_view path) : NTGyroModel(wpi::nt::NetworkTableInstance::GetDefault(), path) {} -NTGyroModel::NTGyroModel(wpi::nt::NetworkTableInstance inst, std::string_view path) +NTGyroModel::NTGyroModel(wpi::nt::NetworkTableInstance inst, + std::string_view path) : m_inst{inst}, m_angle{inst.GetDoubleTopic(fmt::format("{}/Value", path)).Subscribe(0)}, m_name{inst.GetStringTopic(fmt::format("{}/.name", path)).Subscribe({})}, diff --git a/glass/src/libnt/native/cpp/NTMechanism2D.cpp b/glass/src/libnt/native/cpp/NTMechanism2D.cpp index 012d865c33..f0b11e3804 100644 --- a/glass/src/libnt/native/cpp/NTMechanism2D.cpp +++ b/glass/src/libnt/native/cpp/NTMechanism2D.cpp @@ -37,8 +37,8 @@ void NTMechanism2DModel::NTMechanismGroupImpl::ForEachObject( } } -void NTMechanism2DModel::NTMechanismGroupImpl::NTUpdate(const wpi::nt::Event& event, - std::string_view name) { +void NTMechanism2DModel::NTMechanismGroupImpl::NTUpdate( + const wpi::nt::Event& event, std::string_view name) { if (name.empty()) { return; } @@ -130,8 +130,8 @@ bool NTMechanism2DModel::RootModel::NTUpdate(const wpi::nt::Event& event, } else if (auto valueData = event.GetValueEventData()) { if (valueData->topic == m_xTopic.GetHandle()) { if (valueData->value && valueData->value.IsDouble()) { - m_pos = wpi::math::Translation2d{wpi::units::meter_t{valueData->value.GetDouble()}, - m_pos.Y()}; + m_pos = wpi::math::Translation2d{ + wpi::units::meter_t{valueData->value.GetDouble()}, m_pos.Y()}; } } else if (valueData->topic == m_yTopic.GetHandle()) { if (valueData->value && valueData->value.IsDouble()) { @@ -208,8 +208,8 @@ void NTMechanism2DModel::Update() { if (valueData->value && valueData->value.IsDoubleArray()) { auto arr = valueData->value.GetDoubleArray(); if (arr.size() == 2) { - m_dimensionsValue = wpi::math::Translation2d{wpi::units::meter_t{arr[0]}, - wpi::units::meter_t{arr[1]}}; + m_dimensionsValue = wpi::math::Translation2d{ + wpi::units::meter_t{arr[0]}, wpi::units::meter_t{arr[1]}}; } } } else if (valueData->topic == m_bgColorTopic.GetHandle()) { diff --git a/glass/src/libnt/native/cpp/NTMotorController.cpp b/glass/src/libnt/native/cpp/NTMotorController.cpp index 537e2d7b51..94ac03ef7a 100644 --- a/glass/src/libnt/native/cpp/NTMotorController.cpp +++ b/glass/src/libnt/native/cpp/NTMotorController.cpp @@ -13,10 +13,11 @@ using namespace wpi::glass; NTMotorControllerModel::NTMotorControllerModel(std::string_view path) - : NTMotorControllerModel(wpi::nt::NetworkTableInstance::GetDefault(), path) {} + : NTMotorControllerModel(wpi::nt::NetworkTableInstance::GetDefault(), + path) {} -NTMotorControllerModel::NTMotorControllerModel(wpi::nt::NetworkTableInstance inst, - std::string_view path) +NTMotorControllerModel::NTMotorControllerModel( + wpi::nt::NetworkTableInstance inst, std::string_view path) : m_inst{inst}, m_value{inst.GetDoubleTopic(fmt::format("{}/Value", path)).GetEntry(0)}, m_name{inst.GetStringTopic(fmt::format("{}/.name", path)).Subscribe("")}, diff --git a/glass/src/libnt/native/cpp/NTStringChooser.cpp b/glass/src/libnt/native/cpp/NTStringChooser.cpp index 710a54a769..83f73a4d7f 100644 --- a/glass/src/libnt/native/cpp/NTStringChooser.cpp +++ b/glass/src/libnt/native/cpp/NTStringChooser.cpp @@ -22,9 +22,9 @@ NTStringChooserModel::NTStringChooserModel(wpi::nt::NetworkTableInstance inst, m_inst.GetStringTopic(fmt::format("{}/default", path)).Subscribe("")}, m_selected{m_inst.GetStringTopic(fmt::format("{}/selected", path)) .Subscribe("")}, - m_selectedPub{ - m_inst.GetStringTopic(fmt::format("{}/selected", path)) - .PublishEx(wpi::nt::StringTopic::kTypeString, {{"retained", true}})}, + m_selectedPub{m_inst.GetStringTopic(fmt::format("{}/selected", path)) + .PublishEx(wpi::nt::StringTopic::kTypeString, + {{"retained", true}})}, m_active{ m_inst.GetStringTopic(fmt::format("{}/active", path)).Subscribe("")}, m_options{m_inst.GetStringArrayTopic(fmt::format("{}/options", path)) diff --git a/glass/src/libnt/native/cpp/NetworkTables.cpp b/glass/src/libnt/native/cpp/NetworkTables.cpp index 74c5532f04..854942aacf 100644 --- a/glass/src/libnt/native/cpp/NetworkTables.cpp +++ b/glass/src/libnt/native/cpp/NetworkTables.cpp @@ -133,7 +133,8 @@ static void UpdateMsgpackValueSource(NetworkTablesModel& model, mpack_tag_t tag = mpack_read_tag(&r); switch (mpack_tag_type(&tag)) { case mpack::mpack_type_bool: - out->value = wpi::nt::Value::MakeBoolean(mpack_tag_bool_value(&tag), time); + out->value = + wpi::nt::Value::MakeBoolean(mpack_tag_bool_value(&tag), time); out->UpdateFromValue(model, name, ""); break; case mpack::mpack_type_int: @@ -141,7 +142,8 @@ static void UpdateMsgpackValueSource(NetworkTablesModel& model, out->UpdateFromValue(model, name, ""); break; case mpack::mpack_type_uint: - out->value = wpi::nt::Value::MakeInteger(mpack_tag_uint_value(&tag), time); + out->value = + wpi::nt::Value::MakeInteger(mpack_tag_uint_value(&tag), time); out->UpdateFromValue(model, name, ""); break; case mpack::mpack_type_float: @@ -149,7 +151,8 @@ static void UpdateMsgpackValueSource(NetworkTablesModel& model, out->UpdateFromValue(model, name, ""); break; case mpack::mpack_type_double: - out->value = wpi::nt::Value::MakeDouble(mpack_tag_double_value(&tag), time); + out->value = + wpi::nt::Value::MakeDouble(mpack_tag_double_value(&tag), time); out->UpdateFromValue(model, name, ""); break; case mpack::mpack_type_str: { @@ -275,12 +278,14 @@ static void UpdateStructValueSource(NetworkTablesModel& model, } child.value = wpi::nt::Value::MakeBooleanArray(std::move(v), time); } else { - child.value = wpi::nt::Value::MakeBoolean(s.GetBoolField(&field), time); + child.value = + wpi::nt::Value::MakeBoolean(s.GetBoolField(&field), time); } child.UpdateFromValue(model, child.path, ""); break; case wpi::util::StructFieldType::kChar: - child.value = wpi::nt::Value::MakeString(s.GetStringField(&field), time); + child.value = + wpi::nt::Value::MakeString(s.GetStringField(&field), time); child.UpdateFromValue(model, child.path, ""); break; case wpi::util::StructFieldType::kInt8: @@ -329,9 +334,11 @@ static void UpdateStructValueSource(NetworkTablesModel& model, child.value = wpi::nt::Value::MakeIntegerArray(std::move(v), time); } else { if (isUint) { - child.value = wpi::nt::Value::MakeInteger(s.GetUintField(&field), time); + child.value = + wpi::nt::Value::MakeInteger(s.GetUintField(&field), time); } else { - child.value = wpi::nt::Value::MakeInteger(s.GetIntField(&field), time); + child.value = + wpi::nt::Value::MakeInteger(s.GetIntField(&field), time); } } child.UpdateFromValue(model, child.path, ""); @@ -346,7 +353,8 @@ static void UpdateStructValueSource(NetworkTablesModel& model, } child.value = wpi::nt::Value::MakeFloatArray(std::move(v), time); } else { - child.value = wpi::nt::Value::MakeFloat(s.GetFloatField(&field), time); + child.value = + wpi::nt::Value::MakeFloat(s.GetFloatField(&field), time); } child.UpdateFromValue(model, child.path, ""); break; @@ -359,7 +367,8 @@ static void UpdateStructValueSource(NetworkTablesModel& model, } child.value = wpi::nt::Value::MakeDoubleArray(std::move(v), time); } else { - child.value = wpi::nt::Value::MakeDouble(s.GetDoubleField(&field), time); + child.value = + wpi::nt::Value::MakeDouble(s.GetDoubleField(&field), time); } child.UpdateFromValue(model, child.path, ""); break; @@ -630,8 +639,8 @@ static void UpdateProtobufValueSource(NetworkTablesModel& model, static void UpdateJsonValueSource(NetworkTablesModel& model, NetworkTablesModel::ValueSource* out, - const wpi::util::json& j, std::string_view name, - int64_t time) { + const wpi::util::json& j, + std::string_view name, int64_t time) { switch (j.type()) { case wpi::util::json::value_t::object: { if (!out->valueChildrenMap) { @@ -689,7 +698,8 @@ static void UpdateJsonValueSource(NetworkTablesModel& model, break; } case wpi::util::json::value_t::string: - out->value = wpi::nt::Value::MakeString(j.get_ref(), time); + out->value = + wpi::nt::Value::MakeString(j.get_ref(), time); out->UpdateFromValue(model, name, ""); break; case wpi::util::json::value_t::boolean: @@ -896,7 +906,8 @@ void NetworkTablesModel::ValueSource::UpdateFromValue( mpack_reader_init_data(&r, value.GetRaw()); UpdateMsgpackValueSource(model, this, r, name, value.last_change()); mpack_reader_destroy(&r); - } else if (auto structNameOpt = wpi::util::remove_prefix(typeStr, "struct:")) { + } else if (auto structNameOpt = + wpi::util::remove_prefix(typeStr, "struct:")) { auto structName = *structNameOpt; auto withoutArray = wpi::util::remove_suffix(structName, "[]"); bool isArray = withoutArray.has_value(); @@ -1020,8 +1031,8 @@ void NetworkTablesModel::Update() { if (entry) { entry->value = std::move(valueData->value); entry->UpdateFromValue(*this); - if (wpi::util::starts_with(entry->info.name, '$') && entry->value.IsRaw() && - entry->info.type_str == "msgpack") { + if (wpi::util::starts_with(entry->info.name, '$') && + entry->value.IsRaw() && entry->info.type_str == "msgpack") { // meta topic handling if (entry->info.name == "$clients") { // need to remove deleted entries as UpdateClients() uses GetEntry() @@ -1033,21 +1044,21 @@ void NetworkTablesModel::Update() { m_server.UpdatePublishers(entry->value.GetRaw()); } else if (entry->info.name == "$serversub") { m_server.UpdateSubscribers(entry->value.GetRaw()); - } else if (auto client = - wpi::util::remove_prefix(entry->info.name, "$clientpub$")) { + } else if (auto client = wpi::util::remove_prefix(entry->info.name, + "$clientpub$")) { auto it = m_clients.find(*client); if (it != m_clients.end()) { it->second.UpdatePublishers(entry->value.GetRaw()); } - } else if (auto client = - wpi::util::remove_prefix(entry->info.name, "$clientsub$")) { + } else if (auto client = wpi::util::remove_prefix(entry->info.name, + "$clientsub$")) { auto it = m_clients.find(*client); if (it != m_clients.end()) { it->second.UpdateSubscribers(entry->value.GetRaw()); } } - } else if (auto typeStr = - wpi::util::remove_prefix(entry->info.name, "/.schema/struct:"); + } else if (auto typeStr = wpi::util::remove_prefix(entry->info.name, + "/.schema/struct:"); entry->value.IsRaw() && typeStr && entry->info.type_str == "structschema") { // struct schema handling @@ -1058,24 +1069,25 @@ void NetworkTablesModel::Update() { auto desc = m_structDb.Add(*typeStr, schema, &err); if (!desc) { wpi::util::print("could not decode struct '{}' schema '{}': {}\n", - entry->info.name, schema, err); + entry->info.name, schema, err); } else if (desc->IsValid()) { // loop over all entries with this type and update for (auto&& entryPair : m_entries) { if (!entryPair.second) { continue; } - if (auto ts = wpi::util::remove_prefix(entryPair.second->info.type_str, - "struct:")) { + if (auto ts = wpi::util::remove_prefix( + entryPair.second->info.type_str, "struct:")) { if (*ts == *typeStr || - wpi::util::remove_suffix(*ts, "[]").value_or(*ts) == *typeStr) { + wpi::util::remove_suffix(*ts, "[]").value_or(*ts) == + *typeStr) { entryPair.second->UpdateFromValue(*this); } } } } - } else if (auto filename = - wpi::util::remove_prefix(entry->info.name, "/.schema/proto:"); + } else if (auto filename = wpi::util::remove_prefix(entry->info.name, + "/.schema/proto:"); entry->value.IsRaw() && filename && entry->info.type_str == "proto:FileDescriptorProto") { // protobuf descriptor handling @@ -1090,7 +1102,7 @@ void NetworkTablesModel::Update() { &status); if (!status.ok) { wpi::util::print("could not decode protobuf '{}' filename '{}'\n", - entry->info.name, *filename); + entry->info.name, *filename); } else { // loop over all protobuf entries and update (conservatively) for (auto&& entryPair : m_entries) { @@ -1142,7 +1154,7 @@ void NetworkTablesModel::RebuildTreeImpl(std::vector* tree, } parts.clear(); wpi::util::split(entry->info.name, '/', -1, false, - [&](auto part) { parts.emplace_back(part); }); + [&](auto part) { parts.emplace_back(part); }); // ignore a raw "/" key if (parts.empty()) { @@ -1151,7 +1163,8 @@ void NetworkTablesModel::RebuildTreeImpl(std::vector* tree, // get to leaf auto nodes = tree; - for (auto part : wpi::util::drop_back(std::span{parts.begin(), parts.end()})) { + for (auto part : + wpi::util::drop_back(std::span{parts.begin(), parts.end()})) { auto it = std::find_if(nodes->begin(), nodes->end(), [&](const auto& node) { return node.name == part; }); @@ -1577,7 +1590,8 @@ static void EmitEntryValueEditable(NetworkTablesModel* model, if (InputExpr(typeStr, &v, "%" PRId64, ImGuiInputTextFlags_EnterReturnsTrue)) { if (entry.publisher == 0) { - entry.publisher = wpi::nt::Publish(entry.info.topic, NT_INTEGER, "int"); + entry.publisher = + wpi::nt::Publish(entry.info.topic, NT_INTEGER, "int"); } wpi::nt::SetInteger(entry.publisher, v); } @@ -1588,7 +1602,8 @@ static void EmitEntryValueEditable(NetworkTablesModel* model, if (InputExpr(typeStr, &v, "%.6f", ImGuiInputTextFlags_EnterReturnsTrue)) { if (entry.publisher == 0) { - entry.publisher = wpi::nt::Publish(entry.info.topic, NT_FLOAT, "float"); + entry.publisher = + wpi::nt::Publish(entry.info.topic, NT_FLOAT, "float"); } wpi::nt::SetFloat(entry.publisher, v); } @@ -1606,7 +1621,8 @@ static void EmitEntryValueEditable(NetworkTablesModel* model, fmt::format("%.{}f", precision).c_str(), ImGuiInputTextFlags_EnterReturnsTrue)) { if (entry.publisher == 0) { - entry.publisher = wpi::nt::Publish(entry.info.topic, NT_DOUBLE, "double"); + entry.publisher = + wpi::nt::Publish(entry.info.topic, NT_DOUBLE, "double"); } wpi::nt::SetDouble(entry.publisher, v); } @@ -1627,7 +1643,7 @@ static void EmitEntryValueEditable(NetworkTablesModel* model, } wpi::util::SmallString<128> buf; wpi::nt::SetString(entry.publisher, - wpi::util::UnescapeCString(v + 1, buf).first); + wpi::util::UnescapeCString(v + 1, buf).first); } } break; @@ -1721,8 +1737,8 @@ static void CreateTopicMenuItem(NetworkTablesModel* model, std::string_view path, NT_Type type, const char* typeStr, bool enabled) { if (ImGui::MenuItem(typeStr, nullptr, false, enabled)) { - auto entry = - model->AddEntry(wpi::nt::GetTopic(model->GetInstance().GetHandle(), path)); + auto entry = model->AddEntry( + wpi::nt::GetTopic(model->GetInstance().GetHandle(), path)); if (entry->publisher == 0) { entry->publisher = wpi::nt::Publish(entry->info.topic, type, typeStr); // publish a default value so it's editable @@ -1765,8 +1781,8 @@ static void CreateTopicMenuItem(NetworkTablesModel* model, } void wpi::glass::DisplayNetworkTablesAddMenu(NetworkTablesModel* model, - std::string_view path, - NetworkTablesFlags flags) { + std::string_view path, + NetworkTablesFlags flags) { static char nameBuffer[kTextBufferSize]; if (ImGui::BeginMenu("Add new...")) { @@ -1850,7 +1866,7 @@ static void EmitValueTree( std::string_view ts = child.typeStr; bool havePopup = GetHeadingTypeString(&ts); wpi::util::format_to_n_c_str(label, sizeof(label), "{}##v_{}", ts.data(), - child.name.c_str()); + child.name.c_str()); bool valueChildrenOpen = TreeNodeEx(label, ImGuiTreeNodeFlags_SpanFullWidth); if (havePopup) { @@ -1892,7 +1908,7 @@ static void EmitEntry(NetworkTablesModel* model, std::string_view ts = entry.info.type_str; bool havePopup = GetHeadingTypeString(&ts); wpi::util::format_to_n_c_str(label, sizeof(label), "{}##v_{}", ts.data(), - entry.info.name.c_str()); + entry.info.name.c_str()); valueChildrenOpen = TreeNodeEx(label, ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_AllowItemOverlap); @@ -2194,7 +2210,7 @@ void wpi::glass::DisplayNetworkTablesInfo(NetworkTablesModel* model) { } void wpi::glass::DisplayNetworkTables(NetworkTablesModel* model, - NetworkTablesFlags flags) { + NetworkTablesFlags flags) { gArrayEditorID = ImGui::GetID("Array Editor"); if (ImGui::BeginPopupModal("Array Editor", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { diff --git a/glass/src/libnt/native/cpp/NetworkTablesProvider.cpp b/glass/src/libnt/native/cpp/NetworkTablesProvider.cpp index 51cfb678e5..6b21c6335b 100644 --- a/glass/src/libnt/native/cpp/NetworkTablesProvider.cpp +++ b/glass/src/libnt/native/cpp/NetworkTablesProvider.cpp @@ -19,7 +19,8 @@ using namespace wpi::glass; NetworkTablesProvider::NetworkTablesProvider(Storage& storage) - : NetworkTablesProvider{storage, wpi::nt::NetworkTableInstance::GetDefault()} {} + : NetworkTablesProvider{storage, + wpi::nt::NetworkTableInstance::GetDefault()} {} NetworkTablesProvider::NetworkTablesProvider(Storage& storage, wpi::nt::NetworkTableInstance inst) @@ -69,7 +70,7 @@ void NetworkTablesProvider::DisplayMenu() { for (auto&& entry : m_viewEntries) { path.clear(); wpi::util::split(entry->name, '/', -1, false, - [&](auto name) { path.emplace_back(name); }); + [&](auto name) { path.emplace_back(name); }); bool fullDepth = true; int depth = 0; @@ -119,8 +120,8 @@ void NetworkTablesProvider::Update() { if (auto info = event.GetTopicInfo()) { // add/remove entries from NT changes // look for .type fields - if (!wpi::util::ends_with(info->name, "/.type") || info->type != NT_STRING || - info->type_str != "string") { + if (!wpi::util::ends_with(info->name, "/.type") || + info->type != NT_STRING || info->type_str != "string") { continue; } @@ -142,7 +143,8 @@ void NetworkTablesProvider::Update() { } else if (event.flags & wpi::nt::EventFlags::kPublish) { // subscribe to it; use a subscriber so we only get string values SubListener sublistener; - sublistener.subscriber = wpi::nt::StringTopic{info->topic}.Subscribe(""); + sublistener.subscriber = + wpi::nt::StringTopic{info->topic}.Subscribe(""); sublistener.listener = m_poller.AddListener( sublistener.subscriber, wpi::nt::EventFlags::kValueAll | wpi::nt::EventFlags::kImmediate); diff --git a/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp b/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp index f9ccc4be00..9ac653eae2 100644 --- a/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp +++ b/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp @@ -80,7 +80,7 @@ void NetworkTablesSettings::Thread::Main() { } } else if (m_mode == 3) { wpi::nt::StartServer(m_inst, m_iniName.c_str(), m_listenAddress.c_str(), - m_port); + m_port); } } } diff --git a/glass/src/libnt/native/cpp/StandardNetworkTables.cpp b/glass/src/libnt/native/cpp/StandardNetworkTables.cpp index 1fd1306ed6..8e44646772 100644 --- a/glass/src/libnt/native/cpp/StandardNetworkTables.cpp +++ b/glass/src/libnt/native/cpp/StandardNetworkTables.cpp @@ -24,7 +24,8 @@ using namespace wpi::glass; -void wpi::glass::AddStandardNetworkTablesViews(NetworkTablesProvider& provider) { +void wpi::glass::AddStandardNetworkTablesViews( + NetworkTablesProvider& provider) { provider.Register( NTAlertsModel::kType, [](wpi::nt::NetworkTableInstance inst, const char* path) { diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandScheduler.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandScheduler.hpp index 83a8075c28..3bb5319588 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandScheduler.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandScheduler.hpp @@ -23,7 +23,8 @@ class NTCommandSchedulerModel : public CommandSchedulerModel { static constexpr const char* kType = "Scheduler"; explicit NTCommandSchedulerModel(std::string_view path); - NTCommandSchedulerModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTCommandSchedulerModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } const std::vector& GetCurrentCommands() override { diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandSelector.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandSelector.hpp index 3e4782527f..08952a2b30 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandSelector.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTCommandSelector.hpp @@ -19,7 +19,8 @@ class NTCommandSelectorModel : public CommandSelectorModel { static constexpr const char* kType = "Command"; explicit NTCommandSelectorModel(std::string_view path); - NTCommandSelectorModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTCommandSelectorModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } BooleanSource* GetRunningData() override { return &m_runningData; } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalInput.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalInput.hpp index 4e96e052e8..260f37e150 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalInput.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalInput.hpp @@ -21,7 +21,8 @@ class NTDigitalInputModel : public DIOModel { // path is to the table containing ".type", excluding the trailing / explicit NTDigitalInputModel(std::string_view path); - NTDigitalInputModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTDigitalInputModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalOutput.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalOutput.hpp index 768cdb8978..153038f0ec 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalOutput.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTDigitalOutput.hpp @@ -21,7 +21,8 @@ class NTDigitalOutputModel : public DIOModel { // path is to the table containing ".type", excluding the trailing / explicit NTDigitalOutputModel(std::string_view path); - NTDigitalOutputModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTDigitalOutputModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTField2D.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTField2D.hpp index 006ba5f783..72698170bf 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTField2D.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTField2D.hpp @@ -37,9 +37,9 @@ class NTField2DModel : public Field2DModel { FieldObjectModel* AddFieldObject(std::string_view name) override; void RemoveFieldObject(std::string_view name) override; - void ForEachFieldObject( - wpi::util::function_ref - func) override; + void ForEachFieldObject(wpi::util::function_ref + func) override; private: std::string m_path; diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTMecanumDrive.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTMecanumDrive.hpp index b5d5774e1b..2154d3696b 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTMecanumDrive.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTMecanumDrive.hpp @@ -21,7 +21,8 @@ class NTMecanumDriveModel : public DriveModel { static constexpr const char* kType = "MecanumDrive"; explicit NTMecanumDriveModel(std::string_view path); - NTMecanumDriveModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTMecanumDriveModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } const std::vector& GetWheels() const override { diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTMechanism2D.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTMechanism2D.hpp index ce2cf958d6..9761e4b794 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTMechanism2D.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTMechanism2D.hpp @@ -57,8 +57,8 @@ class NTMechanism2DModel : public Mechanism2DModel { class NTMechanismObjectModel; class NTMechanismGroupImpl final { public: - NTMechanismGroupImpl(wpi::nt::NetworkTableInstance inst, std::string_view path, - std::string_view name) + NTMechanismGroupImpl(wpi::nt::NetworkTableInstance inst, + std::string_view path, std::string_view name) : m_inst{inst}, m_path{path}, m_name{name} {} const char* GetName() const { return m_name.c_str(); } @@ -76,8 +76,8 @@ class NTMechanism2DModel : public Mechanism2DModel { class NTMechanismObjectModel final : public MechanismObjectModel { public: - NTMechanismObjectModel(wpi::nt::NetworkTableInstance inst, std::string_view path, - std::string_view name) + NTMechanismObjectModel(wpi::nt::NetworkTableInstance inst, + std::string_view path, std::string_view name) : m_group{inst, path, name}, m_typeTopic{inst.GetTopic(fmt::format("{}/.type", path))}, m_colorTopic{inst.GetTopic(fmt::format("{}/color", path))}, diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTMotorController.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTMotorController.hpp index e7d7460759..59ca5818d3 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTMotorController.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTMotorController.hpp @@ -20,7 +20,8 @@ class NTMotorControllerModel : public MotorControllerModel { static constexpr const char* kType = "Motor Controller"; explicit NTMotorControllerModel(std::string_view path); - NTMotorControllerModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTMotorControllerModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } const char* GetSimDevice() const override { return nullptr; } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTPIDController.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTPIDController.hpp index c991751e30..18e4e5c752 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTPIDController.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTPIDController.hpp @@ -20,7 +20,8 @@ class NTPIDControllerModel : public PIDControllerModel { static constexpr const char* kType = "PIDController"; explicit NTPIDControllerModel(std::string_view path); - NTPIDControllerModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTPIDControllerModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const char* GetName() const override { return m_nameValue.c_str(); } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NTStringChooser.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NTStringChooser.hpp index 92702c8a2c..8b6455ba20 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NTStringChooser.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NTStringChooser.hpp @@ -20,7 +20,8 @@ class NTStringChooserModel : public StringChooserModel { // path is to the table containing ".type", excluding the trailing / explicit NTStringChooserModel(std::string_view path); - NTStringChooserModel(wpi::nt::NetworkTableInstance inst, std::string_view path); + NTStringChooserModel(wpi::nt::NetworkTableInstance inst, + std::string_view path); const std::string& GetDefault() override { return m_defaultValue; } const std::string& GetSelected() override { return m_selectedValue; } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTables.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTables.hpp index 29d9a3926d..1a552ed2e4 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTables.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTables.hpp @@ -176,7 +176,9 @@ class NetworkTablesModel : public Model { Entry* GetEntry(std::string_view name); Entry* AddEntry(NT_Topic topic); - wpi::util::StructDescriptorDatabase& GetStructDatabase() { return m_structDb; } + wpi::util::StructDescriptorDatabase& GetStructDatabase() { + return m_structDb; + } upb_DefPool* GetProtobufDatabase() { return m_protoPool; } upb_Arena* GetProtobufArena() { return m_arena; } diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesProvider.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesProvider.hpp index 26933c3b43..9242ba96a4 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesProvider.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesProvider.hpp @@ -100,7 +100,8 @@ class NetworkTablesProvider : private Provider { wpi::util::DenseMap m_topicMap; struct Entry : public ModelEntry { - Entry(wpi::nt::Topic typeTopic, std::string_view name, const Builder& builder) + Entry(wpi::nt::Topic typeTopic, std::string_view name, + const Builder& builder) : ModelEntry{name, [](auto, const char*) { return true; }, builder.createModel}, typeTopic{typeTopic} {} diff --git a/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesSettings.hpp b/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesSettings.hpp index 8f434d6326..d7ed22671a 100644 --- a/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesSettings.hpp +++ b/glass/src/libnt/native/include/wpi/glass/networktables/NetworkTablesSettings.hpp @@ -13,7 +13,7 @@ namespace wpi::util { template class SmallVectorImpl; -} // namespace wpi +} // namespace wpi::util namespace wpi::glass { diff --git a/hal/src/main/native/cpp/ErrorHandling.cpp b/hal/src/main/native/cpp/ErrorHandling.cpp index 6a0bfd03b9..8a435ea76f 100644 --- a/hal/src/main/native/cpp/ErrorHandling.cpp +++ b/hal/src/main/native/cpp/ErrorHandling.cpp @@ -40,11 +40,11 @@ void SetLastErrorIndexOutOfRange(int32_t* status, std::string_view message, void SetLastErrorPreviouslyAllocated(int32_t* status, std::string_view message, int32_t channel, std::string_view previousAllocation) { - wpi::hal::SetLastError(status, - fmt::format("{} {} previously allocated.\n" - "Location of the previous allocation:\n{}\n" - "Location of the current allocation:", - message, channel, previousAllocation)); + wpi::hal::SetLastError( + status, fmt::format("{} {} previously allocated.\n" + "Location of the previous allocation:\n{}\n" + "Location of the current allocation:", + message, channel, previousAllocation)); } } // namespace wpi::hal diff --git a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp index 83b7e5bafc..20352d0811 100644 --- a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp @@ -18,14 +18,15 @@ using namespace wpi::hal; using namespace wpi::hal::sim; using namespace wpi::util::java; -static wpi::hal::UnlimitedHandleResource* - callbackHandles; +static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, BufferCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni>* callbackHandles; namespace wpi::hal::sim { void InitializeBufferStore() { - static wpi::hal::UnlimitedHandleResource + static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, BufferCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni> cb; callbackHandles = &cb; } diff --git a/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp index be06d97190..f5bf4c20b8 100644 --- a/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp @@ -19,14 +19,14 @@ using namespace wpi::hal; using namespace wpi::hal::sim; using namespace wpi::util::java; -static wpi::hal::UnlimitedHandleResource* +static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, CallbackStore, wpi::hal::HAL_HandleEnum::SimulationJni>* callbackHandles; namespace wpi::hal::sim { void InitializeStore() { - static wpi::hal::UnlimitedHandleResource + static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, CallbackStore, wpi::hal::HAL_HandleEnum::SimulationJni> cb; callbackHandles = &cb; } diff --git a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp index 1376623091..7c21a51dd1 100644 --- a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp @@ -18,14 +18,15 @@ using namespace wpi::hal; using namespace wpi::hal::sim; using namespace wpi::util::java; -static wpi::hal::UnlimitedHandleResource* - callbackHandles; +static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, ConstBufferCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni>* callbackHandles; namespace wpi::hal::sim { void InitializeConstBufferStore() { - static wpi::hal::UnlimitedHandleResource + static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, ConstBufferCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni> cb; callbackHandles = &cb; } diff --git a/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp index 13708735bc..87794cb1e1 100644 --- a/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/DriverStationDataJNI.cpp @@ -537,8 +537,9 @@ Java_org_wpilib_hardware_hal_simulation_DriverStationDataJNI_setMatchInfo JStringRef gameSpecificMessageRef{env, gameSpecificMessage}; HAL_MatchInfo halMatchInfo; - wpi::util::format_to_n_c_str(halMatchInfo.eventName, sizeof(halMatchInfo.eventName), - "{}", eventNameRef.str()); + wpi::util::format_to_n_c_str(halMatchInfo.eventName, + sizeof(halMatchInfo.eventName), "{}", + eventNameRef.str()); wpi::util::format_to_n_c_str( reinterpret_cast(halMatchInfo.gameSpecificMessage), sizeof(halMatchInfo.gameSpecificMessage), "{}", diff --git a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp index 722ef1abaf..5f968b4daf 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp @@ -193,9 +193,9 @@ void ValueCallbackStore::performCallback(const char* name, } } -static wpi::hal::UnlimitedHandleResource* - deviceCallbackHandles; +static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, DeviceCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni>* deviceCallbackHandles; namespace { using RegisterDeviceCallbackFunc = @@ -250,8 +250,8 @@ static void FreeDeviceCallback(JNIEnv* env, SIM_JniHandle handle, callback->free(env); } -static wpi::hal::UnlimitedHandleResource* +static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, ValueCallbackStore, wpi::hal::HAL_HandleEnum::SimulationJni>* valueCallbackHandles; namespace { @@ -346,13 +346,15 @@ bool InitializeSimDeviceDataJNI(JNIEnv* env) { return false; } - static wpi::hal::UnlimitedHandleResource + static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, DeviceCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni> cbDevice; deviceCallbackHandles = &cbDevice; - static wpi::hal::UnlimitedHandleResource + static wpi::hal::UnlimitedHandleResource< + SIM_JniHandle, ValueCallbackStore, + wpi::hal::HAL_HandleEnum::SimulationJni> cbValue; valueCallbackHandles = &cbValue; diff --git a/hal/src/main/native/cpp/proto/ControlDataProto.cpp b/hal/src/main/native/cpp/proto/ControlDataProto.cpp index e6a245cc8f..f9894321f0 100644 --- a/hal/src/main/native/cpp/proto/ControlDataProto.cpp +++ b/hal/src/main/native/cpp/proto/ControlDataProto.cpp @@ -91,8 +91,8 @@ std::optional wpi::util::Protobuf::Unpack( return ControlData; } -bool wpi::util::Protobuf::Pack(OutputStream& Stream, - const mrc::ControlData& Value) { +bool wpi::util::Protobuf::Pack( + OutputStream& Stream, const mrc::ControlData& Value) { std::span Sticks = Value.Joysticks(); wpi::util::PackCallback Joysticks{Sticks}; @@ -149,7 +149,7 @@ std::optional wpi::util::Protobuf::Unpack( } bool wpi::util::Protobuf::Pack(OutputStream& Stream, - const mrc::Joystick& Value) { + const mrc::Joystick& Value) { wpi::util::PackCallback AxesCb{Value.Axes.Axes()}; uint32_t PovsStore = 0; diff --git a/hal/src/main/native/cpp/proto/ErrorInfoProto.cpp b/hal/src/main/native/cpp/proto/ErrorInfoProto.cpp index 85c55d3769..5643698f69 100644 --- a/hal/src/main/native/cpp/proto/ErrorInfoProto.cpp +++ b/hal/src/main/native/cpp/proto/ErrorInfoProto.cpp @@ -50,7 +50,7 @@ std::optional wpi::util::Protobuf::Unpack( } bool wpi::util::Protobuf::Pack(OutputStream& Stream, - const mrc::ErrorInfo& Value) { + const mrc::ErrorInfo& Value) { std::string_view DetailsView = Value.GetDetails(); std::string_view LocationView = Value.GetLocation(); std::string_view CallStackView = Value.GetCallStack(); diff --git a/hal/src/main/native/cpp/proto/MatchInfoProto.cpp b/hal/src/main/native/cpp/proto/MatchInfoProto.cpp index 27dd5d94ef..67ef0093d1 100644 --- a/hal/src/main/native/cpp/proto/MatchInfoProto.cpp +++ b/hal/src/main/native/cpp/proto/MatchInfoProto.cpp @@ -36,7 +36,7 @@ std::optional wpi::util::Protobuf::Unpack( } bool wpi::util::Protobuf::Pack(OutputStream& Stream, - const mrc::MatchInfo& Value) { + const mrc::MatchInfo& Value) { std::string_view EventNameStr = Value.GetEventName(); wpi::util::PackCallback EventName{&EventNameStr}; diff --git a/hal/src/main/native/cpp/proto/OpModeProto.cpp b/hal/src/main/native/cpp/proto/OpModeProto.cpp index d7bbedb0bf..b76370e1ce 100644 --- a/hal/src/main/native/cpp/proto/OpModeProto.cpp +++ b/hal/src/main/native/cpp/proto/OpModeProto.cpp @@ -35,7 +35,7 @@ std::optional wpi::util::Protobuf::Unpack( } bool wpi::util::Protobuf::Pack(OutputStream& Stream, - const mrc::OpMode& Value) { + const mrc::OpMode& Value) { std::string_view EventNameStr = Value.GetName(); wpi::util::PackCallback EventName{&EventNameStr}; diff --git a/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h b/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h index 588484eca5..76294efe6d 100644 --- a/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h +++ b/hal/src/main/native/include/wpi/hal/handles/IndexedClassedHandleResource.h @@ -72,7 +72,8 @@ IndexedClassedHandleResource::Allocate( return HAL_kInvalidHandle; } m_structures[index] = toSet; - return static_cast(wpi::hal::createHandle(index, enumValue, m_version)); + return static_cast( + wpi::hal::createHandle(index, enumValue, m_version)); } template , 4>; + using CallbackVector = + wpi::util::UidVector, 4>; public: void Cancel(int32_t uid) { diff --git a/hal/src/main/native/sim/AddressableLED.cpp b/hal/src/main/native/sim/AddressableLED.cpp index 9173d7f1bc..a6c561ee19 100644 --- a/hal/src/main/native/sim/AddressableLED.cpp +++ b/hal/src/main/native/sim/AddressableLED.cpp @@ -28,8 +28,9 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED( if (channel < 0 || channel >= kNumAddressableLEDs) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for AddressableLED", - 0, kNumAddressableLEDs, channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, + "Invalid Index for AddressableLED", 0, + kNumAddressableLEDs, channel); return HAL_kInvalidHandle; } @@ -41,11 +42,11 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED( if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "PWM or DIO", channel, - port->previousAllocation); + port->previousAllocation); } else { wpi::hal::SetLastErrorIndexOutOfRange(status, - "Invalid Index for AddressableLED", 0, - kNumAddressableLEDs, channel); + "Invalid Index for AddressableLED", + 0, kNumAddressableLEDs, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/AnalogInput.cpp b/hal/src/main/native/sim/AnalogInput.cpp index bb4e4e14f2..6a727f54b6 100644 --- a/hal/src/main/native/sim/AnalogInput.cpp +++ b/hal/src/main/native/sim/AnalogInput.cpp @@ -23,8 +23,8 @@ HAL_AnalogInputHandle HAL_InitializeAnalogInputPort( wpi::hal::init::CheckInit(); if (channel < 0 || channel >= kNumAnalogInputs) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Analog Input", - 0, kNumAnalogInputs, channel); + wpi::hal::SetLastErrorIndexOutOfRange( + status, "Invalid Index for Analog Input", 0, kNumAnalogInputs, channel); return HAL_kInvalidHandle; } @@ -33,11 +33,12 @@ HAL_AnalogInputHandle HAL_InitializeAnalogInputPort( if (*status != 0) { if (analog_port) { - wpi::hal::SetLastErrorPreviouslyAllocated(status, "Analog Input", channel, - analog_port->previousAllocation); + wpi::hal::SetLastErrorPreviouslyAllocated( + status, "Analog Input", channel, analog_port->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Analog Input", - 0, kNumAnalogInputs, channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, + "Invalid Index for Analog Input", 0, + kNumAnalogInputs, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/AnalogInternal.cpp b/hal/src/main/native/sim/AnalogInternal.cpp index 7b692a9db5..cac52acd65 100644 --- a/hal/src/main/native/sim/AnalogInternal.cpp +++ b/hal/src/main/native/sim/AnalogInternal.cpp @@ -8,8 +8,9 @@ #include "wpi/hal/handles/IndexedHandleResource.h" namespace wpi::hal { -IndexedHandleResource* analogInputHandles; +IndexedHandleResource* + analogInputHandles; } // namespace wpi::hal namespace wpi::hal::init { diff --git a/hal/src/main/native/sim/CTREPCM.cpp b/hal/src/main/native/sim/CTREPCM.cpp index 2e56b0de99..905134d3a2 100644 --- a/hal/src/main/native/sim/CTREPCM.cpp +++ b/hal/src/main/native/sim/CTREPCM.cpp @@ -46,10 +46,11 @@ HAL_CTREPCMHandle HAL_InitializeCTREPCM(int32_t busId, int32_t module, if (*status != 0) { if (pcm) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "CTRE PCM", module, - pcm->previousAllocation); + pcm->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PCM", 0, - kNumCTREPCMModules - 1, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, + "Invalid Index for CTRE PCM", 0, + kNumCTREPCMModules - 1, module); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/DIO.cpp b/hal/src/main/native/sim/DIO.cpp index 9321ef9cc2..3de7d27422 100644 --- a/hal/src/main/native/sim/DIO.cpp +++ b/hal/src/main/native/sim/DIO.cpp @@ -39,7 +39,7 @@ HAL_DigitalHandle HAL_InitializeDIOPort(int32_t channel, HAL_Bool input, if (channel < 0 || channel >= kNumDigitalChannels) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DIO", 0, - kNumDigitalChannels, channel); + kNumDigitalChannels, channel); return HAL_kInvalidHandle; } @@ -51,10 +51,10 @@ HAL_DigitalHandle HAL_InitializeDIOPort(int32_t channel, HAL_Bool input, if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "PWM or DIO", channel, - port->previousAllocation); + port->previousAllocation); } else { wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DIO", 0, - kNumDigitalChannels, channel); + kNumDigitalChannels, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/DutyCycle.cpp b/hal/src/main/native/sim/DutyCycle.cpp index f44ee955fa..0dc0658ca3 100644 --- a/hal/src/main/native/sim/DutyCycle.cpp +++ b/hal/src/main/native/sim/DutyCycle.cpp @@ -48,10 +48,10 @@ HAL_DutyCycleHandle HAL_InitializeDutyCycle(int32_t channel, if (*status != 0) { if (dutyCycle) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - dutyCycle->previousAllocation); + dutyCycle->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Duty Cycle", - 0, kNumDutyCycles, channel); + wpi::hal::SetLastErrorIndexOutOfRange( + status, "Invalid Index for Duty Cycle", 0, kNumDutyCycles, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/Extensions.cpp b/hal/src/main/native/sim/Extensions.cpp index 5500515896..5e60c43733 100644 --- a/hal/src/main/native/sim/Extensions.cpp +++ b/hal/src/main/native/sim/Extensions.cpp @@ -57,7 +57,7 @@ extern "C" { int HAL_LoadOneExtension(const char* library) { int rc = 1; // It is expected and reasonable not to find an extra simulation wpi::util::print("HAL Extensions: Attempting to load: {}\n", - fs::path{library}.stem().string()); + fs::path{library}.stem().string()); std::fflush(stdout); HTYPE handle = DLOPEN(library); #if !defined(WIN32) && !defined(_WIN32) @@ -67,8 +67,9 @@ int HAL_LoadOneExtension(const char* library) { #else auto libraryName = fmt::format("lib{}.so", library); #endif - wpi::util::print("HAL Extensions: Load failed: {}\nTrying modified name: {}\n", - DLERROR, fs::path{libraryName}.stem().string()); + wpi::util::print( + "HAL Extensions: Load failed: {}\nTrying modified name: {}\n", DLERROR, + fs::path{libraryName}.stem().string()); std::fflush(stdout); handle = DLOPEN(libraryName.c_str()); } diff --git a/hal/src/main/native/sim/Notifier.cpp b/hal/src/main/native/sim/Notifier.cpp index 6ff60fce8b..2b0c389975 100644 --- a/hal/src/main/native/sim/Notifier.cpp +++ b/hal/src/main/native/sim/Notifier.cpp @@ -319,8 +319,8 @@ int32_t HALSIM_GetNotifierInfo(struct HALSIM_NotifierInfo* arr, int32_t size) { arr[num].handle = handle; if (notifier->name.empty()) { wpi::util::format_to_n_c_str(arr[num].name, sizeof(arr[num].name), - "Notifier{}", - static_cast(getHandleIndex(handle))); + "Notifier{}", + static_cast(getHandleIndex(handle))); } else { std::strncpy(arr[num].name, notifier->name.c_str(), sizeof(arr[num].name) - 1); diff --git a/hal/src/main/native/sim/PWM.cpp b/hal/src/main/native/sim/PWM.cpp index fb15fafbd9..90ad3f2d89 100644 --- a/hal/src/main/native/sim/PWM.cpp +++ b/hal/src/main/native/sim/PWM.cpp @@ -31,7 +31,7 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel, if (channel < 0 || channel >= kNumPWMChannels) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0, - kNumPWMChannels, channel); + kNumPWMChannels, channel); return HAL_kInvalidHandle; } @@ -51,10 +51,10 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel, if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "PWM or DIO", channel, - port->previousAllocation); + port->previousAllocation); } else { wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0, - kNumPWMChannels, channel); + kNumPWMChannels, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/PowerDistribution.cpp b/hal/src/main/native/sim/PowerDistribution.cpp index 7cb82517db..df0de6e8c7 100644 --- a/hal/src/main/native/sim/PowerDistribution.cpp +++ b/hal/src/main/native/sim/PowerDistribution.cpp @@ -46,11 +46,12 @@ HAL_PowerDistributionHandle HAL_InitializePowerDistribution( if (!HAL_CheckPowerDistributionModule(module, type)) { *status = RESOURCE_OUT_OF_RANGE; if (type == HAL_PowerDistributionType::HAL_PowerDistributionType_kCTRE) { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PDP", 0, - kNumCTREPDPModules - 1, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, + "Invalid Index for CTRE PDP", 0, + kNumCTREPDPModules - 1, module); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PDH", 1, - kNumREVPDHModules, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PDH", + 1, kNumREVPDHModules, module); } return HAL_kInvalidHandle; } diff --git a/hal/src/main/native/sim/REVPH.cpp b/hal/src/main/native/sim/REVPH.cpp index c2f010d4e8..59591d7702 100644 --- a/hal/src/main/native/sim/REVPH.cpp +++ b/hal/src/main/native/sim/REVPH.cpp @@ -43,7 +43,7 @@ HAL_REVPHHandle HAL_InitializeREVPH(int32_t busId, int32_t module, if (!HAL_CheckREVPHModuleNumber(module)) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PH", 1, - kNumREVPHModules, module); + kNumREVPHModules, module); return HAL_kInvalidHandle; } @@ -54,10 +54,10 @@ HAL_REVPHHandle HAL_InitializeREVPH(int32_t busId, int32_t module, if (*status != 0) { if (pcm) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "REV PH", module, - pcm->previousAllocation); + pcm->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PH", 1, - kNumREVPHModules, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PH", + 1, kNumREVPHModules, module); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/sim/mockdata/DriverStationData.cpp b/hal/src/main/native/sim/mockdata/DriverStationData.cpp index 2388775dc7..0eff1ce821 100644 --- a/hal/src/main/native/sim/mockdata/DriverStationData.cpp +++ b/hal/src/main/native/sim/mockdata/DriverStationData.cpp @@ -532,7 +532,8 @@ void HALSIM_SetJoystickName(int32_t stick, const WPI_String* name) { } void HALSIM_SetGameSpecificMessage(const WPI_String* message) { - SimDriverStationData->SetGameSpecificMessage(wpi::util::to_string_view(message)); + SimDriverStationData->SetGameSpecificMessage( + wpi::util::to_string_view(message)); } void HALSIM_SetEventName(const WPI_String* name) { diff --git a/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h b/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h index 1e386e9af9..e613f3a2ab 100644 --- a/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h +++ b/hal/src/main/native/sim/mockdata/SimDeviceDataInternal.h @@ -29,7 +29,8 @@ class SimUnnamedCallbackRegistry { using RawFunctor = void (*)(); protected: - using CallbackVector = wpi::util::UidVector, 4>; + using CallbackVector = + wpi::util::UidVector, 4>; public: void Cancel(int32_t uid) { diff --git a/hal/src/main/native/systemcore/AddressableLED.cpp b/hal/src/main/native/systemcore/AddressableLED.cpp index 1110ca81cc..14df1cb181 100644 --- a/hal/src/main/native/systemcore/AddressableLED.cpp +++ b/hal/src/main/native/systemcore/AddressableLED.cpp @@ -90,8 +90,8 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED( if (channel < 0 || channel >= kNumSmartIo) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for AddressableLED", - 0, kNumSmartIo, channel); + wpi::hal::SetLastErrorIndexOutOfRange( + status, "Invalid Index for AddressableLED", 0, kNumSmartIo, channel); return HAL_kInvalidHandle; } @@ -103,7 +103,7 @@ HAL_AddressableLEDHandle HAL_InitializeAddressableLED( if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - port->previousAllocation); + port->previousAllocation); } else { wpi::hal::SetLastErrorIndexOutOfRange( status, "Invalid Index for AddressableLED", 0, kNumSmartIo, channel); diff --git a/hal/src/main/native/systemcore/AnalogInput.cpp b/hal/src/main/native/systemcore/AnalogInput.cpp index 5c3c1be014..7608a27175 100644 --- a/hal/src/main/native/systemcore/AnalogInput.cpp +++ b/hal/src/main/native/systemcore/AnalogInput.cpp @@ -31,7 +31,7 @@ HAL_AnalogInputHandle HAL_InitializeAnalogInputPort( if (channel < 0 || channel >= kNumSmartIo) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Analog", 0, - kNumSmartIo, channel); + kNumSmartIo, channel); return HAL_kInvalidHandle; } @@ -43,10 +43,10 @@ HAL_AnalogInputHandle HAL_InitializeAnalogInputPort( if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - port->previousAllocation); + port->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Analog", 0, - kNumSmartIo, channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Analog", + 0, kNumSmartIo, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/CAN.cpp b/hal/src/main/native/systemcore/CAN.cpp index 6fd591e36c..5540dfbc06 100644 --- a/hal/src/main/native/systemcore/CAN.cpp +++ b/hal/src/main/native/systemcore/CAN.cpp @@ -88,18 +88,21 @@ struct SocketCanState { wpi::util::mutex writeMutex[wpi::hal::kNumCanBuses]; int socketHandle[wpi::hal::kNumCanBuses]; // ms to count/timer map - wpi::util::DenseMap>> + wpi::util::DenseMap>> timers; // ms to bus mask/packet - wpi::util::DenseMap, wpi::hal::kNumCanBuses>> + wpi::util::DenseMap< + uint16_t, std::array, wpi::hal::kNumCanBuses>> timedFrames; // packet to time - wpi::util::DenseMap> packetToTime; + wpi::util::DenseMap> + packetToTime; wpi::util::mutex readMutex[wpi::hal::kNumCanBuses]; // TODO(thadhouse) we need a MUCH better way of doing this masking - wpi::util::DenseMap readFrames[wpi::hal::kNumCanBuses]; + wpi::util::DenseMap + readFrames[wpi::hal::kNumCanBuses]; std::vector canStreams[wpi::hal::kNumCanBuses]; bool InitializeBuses(); @@ -157,7 +160,7 @@ bool SocketCanState::InitializeBuses() { socketHandle[i] = socket(PF_CAN, SOCK_RAW, CAN_RAW); if (socketHandle[i] == -1) { wpi::util::print("socket() for CAN {} failed with {}\n", i, - std::strerror(errno)); + std::strerror(errno)); success = false; return; } @@ -167,7 +170,7 @@ bool SocketCanState::InitializeBuses() { if (ioctl(socketHandle[i], SIOCGIFINDEX, &ifr) == -1) { wpi::util::print("ioctl(SIOCGIFINDEX) for CAN {} failed with {}\n", - ifr.ifr_name, std::strerror(errno)); + ifr.ifr_name, std::strerror(errno)); success = false; return; } @@ -180,14 +183,14 @@ bool SocketCanState::InitializeBuses() { if (bind(socketHandle[i], reinterpret_cast(&addr), sizeof(addr)) == -1) { wpi::util::print("bind() for CAN {} failed with {}\n", ifr.ifr_name, - std::strerror(errno)); + std::strerror(errno)); success = false; return; } if (ioctl(socketHandle[i], SIOCGIFMTU, &ifr) == -1) { wpi::util::print("ioctl(SIOCGIFMTU) for CAN {} failed with {}\n", - ifr.ifr_name, std::strerror(errno)); + ifr.ifr_name, std::strerror(errno)); success = false; return; } @@ -206,7 +209,8 @@ bool SocketCanState::InitializeBuses() { auto poll = wpi::net::uv::Poll::Create(loop, socketHandle[i]); if (!poll) { - wpi::util::print("wpi::net::uv::Poll::Create for CAN {} failed\n", ifr.ifr_name); + wpi::util::print("wpi::net::uv::Poll::Create for CAN {} failed\n", + ifr.ifr_name); success = false; return; } @@ -309,7 +313,8 @@ void SocketCanState::AddPeriodic(wpi::net::uv::Loop& loop, uint8_t busId, if (timer.first == 1) { auto newTimer = wpi::net::uv::Timer::Create(loop); newTimer->timeout.connect([this, time] { TimerCallback(time); }); - newTimer->Start(wpi::net::uv::Timer::Time{time}, wpi::net::uv::Timer::Time{time}); + newTimer->Start(wpi::net::uv::Timer::Time{time}, + wpi::net::uv::Timer::Time{time}); } } diff --git a/hal/src/main/native/systemcore/CTREPCM.cpp b/hal/src/main/native/systemcore/CTREPCM.cpp index dc738e70dd..9bb9bf8757 100644 --- a/hal/src/main/native/systemcore/CTREPCM.cpp +++ b/hal/src/main/native/systemcore/CTREPCM.cpp @@ -186,10 +186,11 @@ HAL_CTREPCMHandle HAL_InitializeCTREPCM(int32_t busId, int32_t module, if (*status != 0) { if (pcm) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "CTRE PCM", module, - pcm->previousAllocation); + pcm->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PCM", 0, - kNumCTREPCMModules - 1, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, + "Invalid Index for CTRE PCM", 0, + kNumCTREPCMModules - 1, module); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/CTREPDP.cpp b/hal/src/main/native/systemcore/CTREPDP.cpp index c5482a11d0..dd55ab6a2c 100644 --- a/hal/src/main/native/systemcore/CTREPDP.cpp +++ b/hal/src/main/native/systemcore/CTREPDP.cpp @@ -135,8 +135,8 @@ HAL_PDPHandle HAL_InitializePDP(int32_t busId, int32_t module, wpi::hal::init::CheckInit(); if (!HAL_CheckPDPModule(module)) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PDP", 0, - kNumCTREPDPModules - 1, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PDP", + 0, kNumCTREPDPModules - 1, module); return HAL_kInvalidHandle; } @@ -146,10 +146,11 @@ HAL_PDPHandle HAL_InitializePDP(int32_t busId, int32_t module, if (*status != 0) { if (pdp) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "CTRE PDP", module, - pdp->previousAllocation); + pdp->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for CTRE PDP", 0, - kNumCTREPDPModules - 1, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, + "Invalid Index for CTRE PDP", 0, + kNumCTREPDPModules - 1, module); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } @@ -232,7 +233,8 @@ double HAL_GetPDPChannelCurrent(HAL_PDPHandle handle, int32_t channel, int32_t* status) { if (!HAL_CheckPDPChannel(channel)) { *status = PARAMETER_OUT_OF_RANGE; - wpi::hal::SetLastError(status, fmt::format("Invalid pdp channel {}", channel)); + wpi::hal::SetLastError(status, + fmt::format("Invalid pdp channel {}", channel)); return 0; } diff --git a/hal/src/main/native/systemcore/Counter.cpp b/hal/src/main/native/systemcore/Counter.cpp index 5cb4d73402..4ff00eefe0 100644 --- a/hal/src/main/native/systemcore/Counter.cpp +++ b/hal/src/main/native/systemcore/Counter.cpp @@ -33,8 +33,8 @@ HAL_CounterHandle HAL_InitializeCounter(int channel, HAL_Bool risingEdge, wpi::hal::init::CheckInit(); if (channel == InvalidHandleIndex || channel >= kNumSmartIo) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Counter", 0, - kNumSmartIo, channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Counter", + 0, kNumSmartIo, channel); return HAL_kInvalidHandle; } @@ -46,10 +46,10 @@ HAL_CounterHandle HAL_InitializeCounter(int channel, HAL_Bool risingEdge, if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - port->previousAllocation); + port->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Counter", 0, - kNumSmartIo, channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for Counter", + 0, kNumSmartIo, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/DIO.cpp b/hal/src/main/native/systemcore/DIO.cpp index b8850828dc..3a45faa61a 100644 --- a/hal/src/main/native/systemcore/DIO.cpp +++ b/hal/src/main/native/systemcore/DIO.cpp @@ -33,7 +33,7 @@ HAL_DigitalHandle HAL_InitializeDIOPort(int32_t channel, HAL_Bool input, if (channel < 0 || channel >= kNumSmartIo) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DIO", 0, - kNumSmartIo, channel); + kNumSmartIo, channel); return HAL_kInvalidHandle; } @@ -45,10 +45,10 @@ HAL_DigitalHandle HAL_InitializeDIOPort(int32_t channel, HAL_Bool input, if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - port->previousAllocation); + port->previousAllocation); } else { wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DIO", 0, - kNumSmartIo, channel); + kNumSmartIo, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/DutyCycle.cpp b/hal/src/main/native/systemcore/DutyCycle.cpp index b19ea5ec85..9534cc13a8 100644 --- a/hal/src/main/native/systemcore/DutyCycle.cpp +++ b/hal/src/main/native/systemcore/DutyCycle.cpp @@ -31,8 +31,8 @@ HAL_DutyCycleHandle HAL_InitializeDutyCycle(int32_t channel, if (channel < 0 || channel >= kNumSmartIo) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", 0, - kNumSmartIo, channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", + 0, kNumSmartIo, channel); return HAL_kInvalidHandle; } @@ -44,10 +44,10 @@ HAL_DutyCycleHandle HAL_InitializeDutyCycle(int32_t channel, if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - port->previousAllocation); + port->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for DutyCycle", 0, - kNumSmartIo, channel); + wpi::hal::SetLastErrorIndexOutOfRange( + status, "Invalid Index for DutyCycle", 0, kNumSmartIo, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/I2C.cpp b/hal/src/main/native/systemcore/I2C.cpp index 502e38c296..a1732daf84 100644 --- a/hal/src/main/native/systemcore/I2C.cpp +++ b/hal/src/main/native/systemcore/I2C.cpp @@ -48,7 +48,7 @@ void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) { if (port < 0 || port > 2) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for I2C", 0, 1, - port); + port); return; } @@ -61,9 +61,11 @@ void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) { if (handle < 0) { int err = errno; *status = NO_AVAILABLE_RESOURCES; - wpi::hal::SetLastError(status, fmt::format("Failed to open onboard i2c bus: {}", - std::strerror(err))); - wpi::util::print("Failed to open onboard i2c bus: {}\n", std::strerror(err)); + wpi::hal::SetLastError( + status, + fmt::format("Failed to open onboard i2c bus: {}", std::strerror(err))); + wpi::util::print("Failed to open onboard i2c bus: {}\n", + std::strerror(err)); handle = -1; i2cObjs[port].objCount--; return; @@ -76,8 +78,8 @@ int32_t HAL_TransactionI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* dataReceived, int32_t receiveSize) { if (port < 0 || port > 2) { int32_t status = 0; - wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, 1, - port); + wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, + 1, port); return -1; } @@ -103,8 +105,8 @@ int32_t HAL_WriteI2C(HAL_I2CPort port, int32_t deviceAddress, const uint8_t* dataToSend, int32_t sendSize) { if (port < 0 || port > 2) { int32_t status = 0; - wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, 2, - port); + wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, + 2, port); return -1; } @@ -126,8 +128,8 @@ int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer, int32_t count) { if (port < 0 || port > 2) { int32_t status = 0; - wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, 1, - port); + wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, + 1, port); return -1; } @@ -148,8 +150,8 @@ int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer, void HAL_CloseI2C(HAL_I2CPort port) { if (port < 0 || port > 2) { int32_t status = 0; - wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, 1, - port); + wpi::hal::SetLastErrorIndexOutOfRange(&status, "Invalid Index for I2C", 0, + 1, port); return; } diff --git a/hal/src/main/native/systemcore/PWM.cpp b/hal/src/main/native/systemcore/PWM.cpp index df13831969..183d515e54 100644 --- a/hal/src/main/native/systemcore/PWM.cpp +++ b/hal/src/main/native/systemcore/PWM.cpp @@ -36,7 +36,7 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel, if (channel < 0 || channel >= kNumSmartIo) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0, - kNumSmartIo, channel); + kNumSmartIo, channel); return HAL_kInvalidHandle; } @@ -48,10 +48,10 @@ HAL_DigitalHandle HAL_InitializePWMPort(int32_t channel, if (*status != 0) { if (port) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "SmartIo", channel, - port->previousAllocation); + port->previousAllocation); } else { wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for PWM", 0, - kNumSmartIo, channel); + kNumSmartIo, channel); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/REVPDH.cpp b/hal/src/main/native/systemcore/REVPDH.cpp index e8d26cdbf9..adfd9a918d 100644 --- a/hal/src/main/native/systemcore/REVPDH.cpp +++ b/hal/src/main/native/systemcore/REVPDH.cpp @@ -194,8 +194,8 @@ HAL_REVPDHHandle HAL_InitializeREVPDH(int32_t busId, int32_t module, wpi::hal::init::CheckInit(); if (!HAL_CheckREVPDHModuleNumber(module)) { *status = RESOURCE_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PDH", 1, - kNumREVPDHModules, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PDH", + 1, kNumREVPDHModules, module); return HAL_kInvalidHandle; } @@ -205,10 +205,10 @@ HAL_REVPDHHandle HAL_InitializeREVPDH(int32_t busId, int32_t module, if (*status != 0) { if (hpdh) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "REV PDH", module, - hpdh->previousAllocation); + hpdh->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PDH", 1, - kNumREVPDHModules, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PDH", + 1, kNumREVPDHModules, module); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } diff --git a/hal/src/main/native/systemcore/REVPH.cpp b/hal/src/main/native/systemcore/REVPH.cpp index fa99da831b..99f0e7e306 100644 --- a/hal/src/main/native/systemcore/REVPH.cpp +++ b/hal/src/main/native/systemcore/REVPH.cpp @@ -198,7 +198,7 @@ HAL_REVPHHandle HAL_InitializeREVPH(int32_t busId, int32_t module, if (!HAL_CheckREVPHModuleNumber(module)) { *status = RESOURCE_OUT_OF_RANGE; wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PH", 1, - kNumREVPHModules, module); + kNumREVPHModules, module); return HAL_kInvalidHandle; } @@ -208,10 +208,10 @@ HAL_REVPHHandle HAL_InitializeREVPH(int32_t busId, int32_t module, if (*status != 0) { if (hph) { wpi::hal::SetLastErrorPreviouslyAllocated(status, "REV PH", module, - hph->previousAllocation); + hph->previousAllocation); } else { - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PH", 1, - kNumREVPHModules, module); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid Index for REV PH", + 1, kNumREVPHModules, module); } return HAL_kInvalidHandle; // failed to allocate. Pass error back. } @@ -398,8 +398,8 @@ double HAL_GetREVPHAnalogVoltage(HAL_REVPHHandle handle, int32_t channel, if (channel < 0 || channel > 1) { *status = PARAMETER_OUT_OF_RANGE; - wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid REV Analog Index", 0, 2, - channel); + wpi::hal::SetLastErrorIndexOutOfRange(status, "Invalid REV Analog Index", 0, + 2, channel); return 0; } diff --git a/hal/src/main/native/systemcore/UsageReporting.cpp b/hal/src/main/native/systemcore/UsageReporting.cpp index 6d7f48f83c..83de5da798 100644 --- a/hal/src/main/native/systemcore/UsageReporting.cpp +++ b/hal/src/main/native/systemcore/UsageReporting.cpp @@ -46,6 +46,7 @@ int32_t HAL_ReportUsage(const struct WPI_String* resource, namespace wpi::hal::init { void InitializeUsageReporting() { - systemServerUsage = new ::SystemServerUsageReporting{wpi::hal::GetSystemServer()}; + systemServerUsage = + new ::SystemServerUsageReporting{wpi::hal::GetSystemServer()}; } } // namespace wpi::hal::init diff --git a/hal/src/test/native/cpp/handles/HandleTest.cpp b/hal/src/test/native/cpp/handles/HandleTest.cpp index 7060b805c1..b13f359e43 100644 --- a/hal/src/test/native/cpp/handles/HandleTest.cpp +++ b/hal/src/test/native/cpp/handles/HandleTest.cpp @@ -17,7 +17,7 @@ class MyTestClass {}; namespace wpi::hal { TEST(HandleTest, ClassedHandle) { wpi::hal::IndexedClassedHandleResource + HAL_HandleEnum::Vendor> testClass; int32_t status = 0; testClass.Allocate(0, std::make_unique(), &status); diff --git a/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp b/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp index bbdb326b01..e7e1005ca1 100644 --- a/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp +++ b/hal/src/test/native/cpp/mockdata/DriverStationDataTest.cpp @@ -122,9 +122,11 @@ TEST(DriverStationTest, EventInfo) { constexpr std::string_view eventName = "UnitTest"; constexpr std::string_view gameData = "Insert game specific info here :D"; HAL_MatchInfo info; - wpi::util::format_to_n_c_str(info.eventName, sizeof(info.eventName), eventName); - wpi::util::format_to_n_c_str(reinterpret_cast(info.gameSpecificMessage), - sizeof(info.gameSpecificMessage), gameData); + wpi::util::format_to_n_c_str(info.eventName, sizeof(info.eventName), + eventName); + wpi::util::format_to_n_c_str( + reinterpret_cast(info.gameSpecificMessage), + sizeof(info.gameSpecificMessage), gameData); info.gameSpecificMessageSize = gameData.size(); info.matchNumber = 5; info.matchType = HAL_MatchType::HAL_kMatchType_qualification; diff --git a/ntcore/src/dev/native/cpp/main.cpp b/ntcore/src/dev/native/cpp/main.cpp index 345e083d81..922318af88 100644 --- a/ntcore/src/dev/native/cpp/main.cpp +++ b/ntcore/src/dev/native/cpp/main.cpp @@ -72,9 +72,12 @@ void PrintTimes(std::vector& times) { std::inner_product(times.begin(), times.end(), times.begin(), 0); double stdev = std::sqrt(sq_sum / times.size() - mean * mean); - wpi::util::print("min: {} max: {}, mean: {}, stdev: {}\n", min, max, mean, stdev); - wpi::util::print("min 10: {}\n", fmt::join(times.begin(), times.begin() + 10, ",")); - wpi::util::print("max 10: {}\n", fmt::join(times.end() - 10, times.end(), ",")); + wpi::util::print("min: {} max: {}, mean: {}, stdev: {}\n", min, max, mean, + stdev); + wpi::util::print("min 10: {}\n", + fmt::join(times.begin(), times.begin() + 10, ",")); + wpi::util::print("max 10: {}\n", + fmt::join(times.end() - 10, times.end(), ",")); } // benchmark @@ -94,9 +97,10 @@ void bench() { // add "typical" set of subscribers on client and server wpi::nt::SubscribeMultiple(client, {{std::string_view{}}}); wpi::nt::Subscribe(wpi::nt::GetTopic(client, "highrate"), NT_DOUBLE, "double", - {.sendAll = true, .keepDuplicates = true}); + {.sendAll = true, .keepDuplicates = true}); wpi::nt::SubscribeMultiple(server, {{std::string_view{}}}); - auto pub = wpi::nt::Publish(wpi::nt::GetTopic(server, "highrate"), NT_DOUBLE, "double"); + auto pub = wpi::nt::Publish(wpi::nt::GetTopic(server, "highrate"), NT_DOUBLE, + "double"); wpi::nt::SetDouble(pub, 0); // warm up @@ -130,9 +134,10 @@ void bench() { } auto stop = std::chrono::high_resolution_clock::now(); - wpi::util::print("total time: {}us\n", - std::chrono::duration_cast(stop - start) - .count()); + wpi::util::print( + "total time: {}us\n", + std::chrono::duration_cast(stop - start) + .count()); PrintTimes(times); wpi::util::print("-- Flush --\n"); PrintTimes(flushTimes); @@ -163,8 +168,8 @@ void bench2() { std::array pubs; for (int i = 0; i < 1000; ++i) { pubs[i] = wpi::nt::GetEntry( - wpi::nt::GetTopic(server, - fmt::format("/some/long/name/with/lots/of/slashes/{}", i)), + wpi::nt::GetTopic( + server, fmt::format("/some/long/name/with/lots/of/slashes/{}", i)), NT_DOUBLE_ARRAY, "double[]"); } @@ -203,9 +208,10 @@ void bench2() { } auto stop = std::chrono::high_resolution_clock::now(); - wpi::util::print("total time: {}us\n", - std::chrono::duration_cast(stop - start) - .count()); + wpi::util::print( + "total time: {}us\n", + std::chrono::duration_cast(stop - start) + .count()); PrintTimes(times); wpi::util::print("-- Flush --\n"); PrintTimes(flushTimes); @@ -251,9 +257,9 @@ void stress() { // create publishers NT_Publisher pub[30]; for (int i = 0; i < 30; ++i) { - pub[i] = - wpi::nt::Publish(wpi::nt::GetTopic(server, fmt::format("{}_{}", count, i)), - NT_DOUBLE, "double", {}); + pub[i] = wpi::nt::Publish( + wpi::nt::GetTopic(server, fmt::format("{}_{}", count, i)), + NT_DOUBLE, "double", {}); } // publish values @@ -348,13 +354,13 @@ void latency() { std::this_thread::sleep_for(1s); // create publishers and subscribers - auto pub = - wpi::nt::Publish(wpi::nt::GetTopic(client1, "highrate"), NT_DOUBLE, "double"); + auto pub = wpi::nt::Publish(wpi::nt::GetTopic(client1, "highrate"), NT_DOUBLE, + "double"); wpi::nt::SubscribeMultiple(server, {{std::string_view{}}}); - auto sub = - wpi::nt::Subscribe(wpi::nt::GetTopic(server, "highrate"), NT_DOUBLE, "double"); - auto sub2 = - wpi::nt::Subscribe(wpi::nt::GetTopic(client2, "highrate"), NT_DOUBLE, "double"); + auto sub = wpi::nt::Subscribe(wpi::nt::GetTopic(server, "highrate"), + NT_DOUBLE, "double"); + auto sub2 = wpi::nt::Subscribe(wpi::nt::GetTopic(client2, "highrate"), + NT_DOUBLE, "double"); std::this_thread::sleep_for(1s); diff --git a/ntcore/src/main/native/cpp/LocalStorage.hpp b/ntcore/src/main/native/cpp/LocalStorage.hpp index 29e6e078e1..e7a1ad1b5a 100644 --- a/ntcore/src/main/native/cpp/LocalStorage.hpp +++ b/ntcore/src/main/native/cpp/LocalStorage.hpp @@ -23,7 +23,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt { @@ -31,7 +31,8 @@ class IListenerStorage; class LocalStorage final : public net::ILocalStorage { public: - LocalStorage(int inst, IListenerStorage& listenerStorage, wpi::util::Logger& logger) + LocalStorage(int inst, IListenerStorage& listenerStorage, + wpi::util::Logger& logger) : m_impl{inst, listenerStorage, logger} {} LocalStorage(const LocalStorage&) = delete; LocalStorage& operator=(const LocalStorage&) = delete; @@ -51,8 +52,8 @@ class LocalStorage final : public net::ILocalStorage { m_impl.RemoveNetworkPublisher(m_impl.GetOrCreateTopic(name)); } - void ServerPropertiesUpdate(std::string_view name, const wpi::util::json& update, - bool ack) final { + void ServerPropertiesUpdate(std::string_view name, + const wpi::util::json& update, bool ack) final { std::scoped_lock lock{m_mutex}; if (auto topic = m_impl.GetTopicByName(name)) { m_impl.NetworkPropertiesUpdate(topic, update, ack); @@ -177,7 +178,8 @@ class LocalStorage final : public net::ILocalStorage { return topic && topic->Exists(); } - wpi::util::json GetTopicProperty(NT_Topic topicHandle, std::string_view name) { + wpi::util::json GetTopicProperty(NT_Topic topicHandle, + std::string_view name) { std::scoped_lock lock{m_mutex}; if (auto topic = m_impl.GetTopicByHandle(topicHandle)) { return topic->properties.value(name, wpi::util::json{}); @@ -262,7 +264,8 @@ class LocalStorage final : public net::ILocalStorage { } NT_Publisher Publish(NT_Topic topicHandle, NT_Type type, - std::string_view typeStr, const wpi::util::json& properties, + std::string_view typeStr, + const wpi::util::json& properties, const PubSubOptions& options) { std::scoped_lock lock{m_mutex}; if (auto topic = m_impl.GetTopicByHandle(topicHandle)) { diff --git a/ntcore/src/main/native/cpp/LoggerImpl.cpp b/ntcore/src/main/native/cpp/LoggerImpl.cpp index 683185c6f2..b6328eac49 100644 --- a/ntcore/src/main/native/cpp/LoggerImpl.cpp +++ b/ntcore/src/main/native/cpp/LoggerImpl.cpp @@ -71,31 +71,40 @@ static unsigned int LevelToFlag(unsigned int level) { static unsigned int LevelsToEventMask(unsigned int minLevel, unsigned int maxLevel) { unsigned int mask = 0; - if (minLevel <= wpi::util::WPI_LOG_CRITICAL && maxLevel >= wpi::util::WPI_LOG_CRITICAL) { + if (minLevel <= wpi::util::WPI_LOG_CRITICAL && + maxLevel >= wpi::util::WPI_LOG_CRITICAL) { mask |= kFlagCritical; } - if (minLevel <= wpi::util::WPI_LOG_ERROR && maxLevel >= wpi::util::WPI_LOG_ERROR) { + if (minLevel <= wpi::util::WPI_LOG_ERROR && + maxLevel >= wpi::util::WPI_LOG_ERROR) { mask |= kFlagError; } - if (minLevel <= wpi::util::WPI_LOG_WARNING && maxLevel >= wpi::util::WPI_LOG_WARNING) { + if (minLevel <= wpi::util::WPI_LOG_WARNING && + maxLevel >= wpi::util::WPI_LOG_WARNING) { mask |= kFlagWarning; } - if (minLevel <= wpi::util::WPI_LOG_INFO && maxLevel >= wpi::util::WPI_LOG_INFO) { + if (minLevel <= wpi::util::WPI_LOG_INFO && + maxLevel >= wpi::util::WPI_LOG_INFO) { mask |= kFlagInfo; } - if (minLevel <= wpi::util::WPI_LOG_DEBUG && maxLevel >= wpi::util::WPI_LOG_DEBUG) { + if (minLevel <= wpi::util::WPI_LOG_DEBUG && + maxLevel >= wpi::util::WPI_LOG_DEBUG) { mask |= kFlagDebug; } - if (minLevel <= wpi::util::WPI_LOG_DEBUG1 && maxLevel >= wpi::util::WPI_LOG_DEBUG1) { + if (minLevel <= wpi::util::WPI_LOG_DEBUG1 && + maxLevel >= wpi::util::WPI_LOG_DEBUG1) { mask |= kFlagDebug1; } - if (minLevel <= wpi::util::WPI_LOG_DEBUG2 && maxLevel >= wpi::util::WPI_LOG_DEBUG2) { + if (minLevel <= wpi::util::WPI_LOG_DEBUG2 && + maxLevel >= wpi::util::WPI_LOG_DEBUG2) { mask |= kFlagDebug2; } - if (minLevel <= wpi::util::WPI_LOG_DEBUG3 && maxLevel >= wpi::util::WPI_LOG_DEBUG3) { + if (minLevel <= wpi::util::WPI_LOG_DEBUG3 && + maxLevel >= wpi::util::WPI_LOG_DEBUG3) { mask |= kFlagDebug3; } - if (minLevel <= wpi::util::WPI_LOG_DEBUG4 && maxLevel >= wpi::util::WPI_LOG_DEBUG4) { + if (minLevel <= wpi::util::WPI_LOG_DEBUG4 && + maxLevel >= wpi::util::WPI_LOG_DEBUG4) { mask |= kFlagDebug4; } if (mask == 0) { diff --git a/ntcore/src/main/native/cpp/NetworkClient.hpp b/ntcore/src/main/native/cpp/NetworkClient.hpp index 0fce2f0711..61d253548b 100644 --- a/ntcore/src/main/native/cpp/NetworkClient.hpp +++ b/ntcore/src/main/native/cpp/NetworkClient.hpp @@ -27,7 +27,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::net { class ILocalStorage; diff --git a/ntcore/src/main/native/cpp/NetworkServer.cpp b/ntcore/src/main/native/cpp/NetworkServer.cpp index 3f2a0f95e2..ff26afd4e9 100644 --- a/ntcore/src/main/native/cpp/NetworkServer.cpp +++ b/ntcore/src/main/native/cpp/NetworkServer.cpp @@ -126,7 +126,7 @@ void NetworkServer::ServerConnection::ConnectionClosed() { void NetworkServer::ServerConnection4::ProcessRequest() { DEBUG1("HTTP request: '{}'", m_request.GetUrl()); wpi::net::UrlParser url{m_request.GetUrl(), - m_request.GetMethod() == wpi::net::HTTP_CONNECT}; + m_request.GetMethod() == wpi::net::HTTP_CONNECT}; if (!url.IsValid()) { // failed to parse URL SendError(400); @@ -255,7 +255,8 @@ void NetworkServer::ServerConnection4::ProcessWsUpgrade() { NetworkServer::NetworkServer(std::string_view persistentFilename, std::string_view listenAddress, unsigned int port, net::ILocalStorage& localStorage, - IConnectionList& connList, wpi::util::Logger& logger, + IConnectionList& connList, + wpi::util::Logger& logger, std::function initDone) : m_localStorage{localStorage}, m_connList{connList}, diff --git a/ntcore/src/main/native/cpp/NetworkServer.hpp b/ntcore/src/main/native/cpp/NetworkServer.hpp index 721a52a8d1..f1ce4eae29 100644 --- a/ntcore/src/main/native/cpp/NetworkServer.hpp +++ b/ntcore/src/main/native/cpp/NetworkServer.hpp @@ -22,7 +22,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::net { class ILocalStorage; diff --git a/ntcore/src/main/native/cpp/Value.cpp b/ntcore/src/main/native/cpp/Value.cpp index c121526042..8aa2c316f1 100644 --- a/ntcore/src/main/native/cpp/Value.cpp +++ b/ntcore/src/main/native/cpp/Value.cpp @@ -184,7 +184,8 @@ void wpi::nt::ConvertToC(const Value& in, NT_Value* out) { break; case NT_RAW: { auto v = in.GetRaw(); - out->data.v_raw.data = static_cast(wpi::util::safe_malloc(v.size())); + out->data.v_raw.data = + static_cast(wpi::util::safe_malloc(v.size())); out->data.v_raw.size = v.size(); std::memcpy(out->data.v_raw.data, v.data(), v.size()); break; @@ -199,8 +200,8 @@ void wpi::nt::ConvertToC(const Value& in, NT_Value* out) { } case NT_INTEGER_ARRAY: { auto v = in.GetIntegerArray(); - out->data.arr_int.arr = - static_cast(wpi::util::safe_malloc(v.size() * sizeof(int64_t))); + out->data.arr_int.arr = static_cast( + wpi::util::safe_malloc(v.size() * sizeof(int64_t))); out->data.arr_int.size = v.size(); std::copy(v.begin(), v.end(), out->data.arr_int.arr); break; @@ -215,8 +216,8 @@ void wpi::nt::ConvertToC(const Value& in, NT_Value* out) { } case NT_DOUBLE_ARRAY: { auto v = in.GetDoubleArray(); - out->data.arr_double.arr = - static_cast(wpi::util::safe_malloc(v.size() * sizeof(double))); + out->data.arr_double.arr = static_cast( + wpi::util::safe_malloc(v.size() * sizeof(double))); out->data.arr_double.size = v.size(); std::copy(v.begin(), v.end(), out->data.arr_double.arr); break; diff --git a/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp b/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp index 1b2c820d81..f49db39c07 100644 --- a/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp +++ b/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp @@ -122,7 +122,8 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) { // Conversions from Java objects to C++ // -static wpi::nt::PubSubOptions FromJavaPubSubOptions(JNIEnv* env, jobject joptions) { +static wpi::nt::PubSubOptions FromJavaPubSubOptions(JNIEnv* env, + jobject joptions) { if (!joptions) { return {}; } @@ -299,7 +300,8 @@ static jobject MakeJObject(JNIEnv* env, jobject inst, static_cast(data.subentry), value.obj()); } -static jobject MakeJObject(JNIEnv* env, const wpi::nt::TimeSyncEventData& data) { +static jobject MakeJObject(JNIEnv* env, + const wpi::nt::TimeSyncEventData& data) { static jmethodID constructor = env->GetMethodID(timeSyncEventDataCls, "", "(JJZ)V"); return env->NewObject(timeSyncEventDataCls, constructor, @@ -308,7 +310,8 @@ static jobject MakeJObject(JNIEnv* env, const wpi::nt::TimeSyncEventData& data) static_cast(data.valid)); } -static jobject MakeJObject(JNIEnv* env, jobject inst, const wpi::nt::Event& event) { +static jobject MakeJObject(JNIEnv* env, jobject inst, + const wpi::nt::Event& event) { static jmethodID constructor = env->GetMethodID(eventCls, "", "(Lorg/wpilib/networktables/NetworkTableInstance;II" @@ -339,7 +342,8 @@ static jobject MakeJObject(JNIEnv* env, jobject inst, const wpi::nt::Event& even valueData.obj(), logMessage.obj(), timeSyncData.obj()); } -static jobjectArray MakeJObject(JNIEnv* env, std::span arr) { +static jobjectArray MakeJObject(JNIEnv* env, + std::span arr) { jobjectArray jarr = env->NewObjectArray(arr.size(), valueCls, nullptr); if (!jarr) { return nullptr; @@ -580,7 +584,8 @@ Java_org_wpilib_networktables_NetworkTablesJNI_getTopicInfosStr typeStrs.emplace_back(typeStrData.back()); } - auto arr = wpi::nt::GetTopicInfo(inst, JStringRef{env, prefix}.str(), typeStrs); + auto arr = + wpi::nt::GetTopicInfo(inst, JStringRef{env, prefix}.str(), typeStrs); jobjectArray jarr = env->NewObjectArray(arr.size(), topicInfoCls, nullptr); if (!jarr) { return nullptr; @@ -733,8 +738,8 @@ JNIEXPORT jstring JNICALL Java_org_wpilib_networktables_NetworkTablesJNI_getTopicProperty (JNIEnv* env, jclass, jint topic, jstring name) { - return MakeJString(env, - wpi::nt::GetTopicProperty(topic, JStringRef{env, name}).dump()); + return MakeJString( + env, wpi::nt::GetTopicProperty(topic, JStringRef{env, name}).dump()); } /* @@ -815,8 +820,8 @@ Java_org_wpilib_networktables_NetworkTablesJNI_subscribe (JNIEnv* env, jclass, jint topic, jint type, jstring typeStr, jobject options) { return wpi::nt::Subscribe(topic, static_cast(type), - JStringRef{env, typeStr}, - FromJavaPubSubOptions(env, options)); + JStringRef{env, typeStr}, + FromJavaPubSubOptions(env, options)); } /* @@ -841,8 +846,8 @@ Java_org_wpilib_networktables_NetworkTablesJNI_publish (JNIEnv* env, jclass, jint topic, jint type, jstring typeStr, jobject options) { return wpi::nt::Publish(topic, static_cast(type), - JStringRef{env, typeStr}, - FromJavaPubSubOptions(env, options)); + JStringRef{env, typeStr}, + FromJavaPubSubOptions(env, options)); } /* @@ -868,8 +873,8 @@ Java_org_wpilib_networktables_NetworkTablesJNI_publishEx return 0; } return wpi::nt::PublishEx(topic, static_cast(type), - JStringRef{env, typeStr}, j, - FromJavaPubSubOptions(env, options)); + JStringRef{env, typeStr}, j, + FromJavaPubSubOptions(env, options)); } /* @@ -894,8 +899,8 @@ Java_org_wpilib_networktables_NetworkTablesJNI_getEntryImpl (JNIEnv* env, jclass, jint topic, jint type, jstring typeStr, jobject options) { return wpi::nt::GetEntry(topic, static_cast(type), - JStringRef{env, typeStr}, - FromJavaPubSubOptions(env, options)); + JStringRef{env, typeStr}, + FromJavaPubSubOptions(env, options)); } /* @@ -965,7 +970,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_subscribeMultiple } return wpi::nt::SubscribeMultiple(inst, prefixStringViews, - FromJavaPubSubOptions(env, options)); + FromJavaPubSubOptions(env, options)); } /* @@ -1189,7 +1194,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_startServer return; } wpi::nt::StartServer(inst, JStringRef{env, persistFilename}.str(), - JStringRef{env, listenAddress}.c_str(), port); + JStringRef{env, listenAddress}.c_str(), port); } /* @@ -1433,9 +1438,9 @@ JNIEXPORT jint JNICALL Java_org_wpilib_networktables_NetworkTablesJNI_startEntryDataLog (JNIEnv* env, jclass, jint inst, jlong log, jstring prefix, jstring logPrefix) { - return wpi::nt::StartEntryDataLog(inst, *reinterpret_cast(log), - JStringRef{env, prefix}, - JStringRef{env, logPrefix}); + return wpi::nt::StartEntryDataLog( + inst, *reinterpret_cast(log), JStringRef{env, prefix}, + JStringRef{env, logPrefix}); } /* diff --git a/ntcore/src/main/native/cpp/local/LocalDataLogger.cpp b/ntcore/src/main/native/cpp/local/LocalDataLogger.cpp index d8d73caaef..b0edd1a700 100644 --- a/ntcore/src/main/native/cpp/local/LocalDataLogger.cpp +++ b/ntcore/src/main/native/cpp/local/LocalDataLogger.cpp @@ -19,7 +19,8 @@ int LocalDataLogger::Start(std::string_view name, std::string_view typeStr, } else if (typeStr == "int[]") { typeStr = "int64[]"; } - return log.Start(fmt::format("{}{}", logPrefix, - wpi::util::remove_prefix(name, prefix).value_or(name)), - typeStr, metadata, time); + return log.Start( + fmt::format("{}{}", logPrefix, + wpi::util::remove_prefix(name, prefix).value_or(name)), + typeStr, metadata, time); } diff --git a/ntcore/src/main/native/cpp/local/LocalStorageImpl.cpp b/ntcore/src/main/native/cpp/local/LocalStorageImpl.cpp index b444cebbd9..188e1a4715 100644 --- a/ntcore/src/main/native/cpp/local/LocalStorageImpl.cpp +++ b/ntcore/src/main/native/cpp/local/LocalStorageImpl.cpp @@ -110,7 +110,8 @@ void StorageImpl::RemoveNetworkPublisher(LocalTopic* topic) { } void StorageImpl::NetworkPropertiesUpdate(LocalTopic* topic, - const wpi::util::json& update, bool ack) { + const wpi::util::json& update, + bool ack) { DEBUG4("NetworkPropertiesUpdate({},{})", topic->name, ack); if (ack) { return; // ignore acks @@ -215,7 +216,8 @@ void StorageImpl::SetProperty(LocalTopic* topic, std::string_view name, true); } -bool StorageImpl::SetProperties(LocalTopic* topic, const wpi::util::json& update, +bool StorageImpl::SetProperties(LocalTopic* topic, + const wpi::util::json& update, bool sendNetwork) { DEBUG4("SetProperties({},{})", topic->name, sendNetwork); if (!topic->SetProperties(update)) { @@ -864,7 +866,8 @@ void StorageImpl::NotifyValue(LocalTopic* topic, const Value& value, } } -void StorageImpl::PropertiesUpdated(LocalTopic* topic, const wpi::util::json& update, +void StorageImpl::PropertiesUpdated(LocalTopic* topic, + const wpi::util::json& update, unsigned int eventFlags, bool sendNetwork, bool updateFlags) { DEBUG4("PropertiesUpdated({}, {}, {}, {}, {})", topic->name, update.dump(), @@ -901,9 +904,9 @@ void StorageImpl::RefreshPubSubActive(LocalTopic* topic, } } -LocalPublisher* StorageImpl::AddLocalPublisher(LocalTopic* topic, - const wpi::util::json& properties, - const PubSubConfig& config) { +LocalPublisher* StorageImpl::AddLocalPublisher( + LocalTopic* topic, const wpi::util::json& properties, + const PubSubConfig& config) { bool didExist = topic->Exists(); auto publisher = m_publishers.Add(m_inst, topic, config); topic->localPublishers.Add(publisher); diff --git a/ntcore/src/main/native/cpp/local/LocalStorageImpl.hpp b/ntcore/src/main/native/cpp/local/LocalStorageImpl.hpp index 530002c51c..50182d4620 100644 --- a/ntcore/src/main/native/cpp/local/LocalStorageImpl.hpp +++ b/ntcore/src/main/native/cpp/local/LocalStorageImpl.hpp @@ -26,7 +26,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt { class IListenerStorage; @@ -41,7 +41,8 @@ namespace wpi::nt::local { // inner struct to protect against accidentally deadlocking on the mutex class StorageImpl { public: - StorageImpl(int inst, IListenerStorage& listenerStorage, wpi::util::Logger& logger); + StorageImpl(int inst, IListenerStorage& listenerStorage, + wpi::util::Logger& logger); wpi::util::Logger& GetLogger() { return m_logger; } @@ -50,7 +51,8 @@ class StorageImpl { // void NetworkAnnounce(LocalTopic* topic, std::string_view typeStr, - const wpi::util::json& properties, std::optional pubuid); + const wpi::util::json& properties, + std::optional pubuid); void RemoveNetworkPublisher(LocalTopic* topic); void NetworkPropertiesUpdate(LocalTopic* topic, const wpi::util::json& update, bool ack); @@ -156,7 +158,8 @@ class StorageImpl { const PubSubOptions& options); LocalPublisher* Publish(LocalTopic* topic, NT_Type type, - std::string_view typeStr, const wpi::util::json& properties, + std::string_view typeStr, + const wpi::util::json& properties, const PubSubOptions& options); LocalEntry* GetEntry(LocalTopic* topicHandle, NT_Type type, diff --git a/ntcore/src/main/native/cpp/local/LocalTopic.cpp b/ntcore/src/main/native/cpp/local/LocalTopic.cpp index c13071805c..b201a4b90c 100644 --- a/ntcore/src/main/native/cpp/local/LocalTopic.cpp +++ b/ntcore/src/main/native/cpp/local/LocalTopic.cpp @@ -115,7 +115,7 @@ wpi::util::json LocalTopic::SetCached(bool value) { } wpi::util::json LocalTopic::SetProperty(std::string_view name, - const wpi::util::json& value) { + const wpi::util::json& value) { if (value.is_null()) { properties.erase(name); } else { diff --git a/ntcore/src/main/native/cpp/local/LocalTopic.hpp b/ntcore/src/main/native/cpp/local/LocalTopic.hpp index af323de282..dfe19acb07 100644 --- a/ntcore/src/main/native/cpp/local/LocalTopic.hpp +++ b/ntcore/src/main/native/cpp/local/LocalTopic.hpp @@ -52,7 +52,8 @@ struct LocalTopic { wpi::util::json SetPersistent(bool value); wpi::util::json SetRetained(bool value); wpi::util::json SetCached(bool value); - wpi::util::json SetProperty(std::string_view name, const wpi::util::json& value); + wpi::util::json SetProperty(std::string_view name, + const wpi::util::json& value); wpi::util::json DeleteProperty(std::string_view name); // returns false if not object diff --git a/ntcore/src/main/native/cpp/net/ClientImpl.cpp b/ntcore/src/main/native/cpp/net/ClientImpl.cpp index 7359aed6f9..345d16b76d 100644 --- a/ntcore/src/main/native/cpp/net/ClientImpl.cpp +++ b/ntcore/src/main/native/cpp/net/ClientImpl.cpp @@ -28,7 +28,8 @@ using namespace wpi::nt; using namespace wpi::nt::net; ClientImpl::ClientImpl( - uint64_t curTimeMs, WireConnection& wire, bool local, wpi::util::Logger& logger, + uint64_t curTimeMs, WireConnection& wire, bool local, + wpi::util::Logger& logger, std::function timeSyncUpdated, std::function setPeriodic) @@ -165,7 +166,8 @@ void ClientImpl::UpdatePeriodic() { } void ClientImpl::Publish(int32_t pubuid, std::string_view name, - std::string_view typeStr, const wpi::util::json& properties, + std::string_view typeStr, + const wpi::util::json& properties, const PubSubOptionsImpl& options) { if (static_cast(pubuid) >= m_publishers.size()) { m_publishers.resize(pubuid + 1); @@ -239,7 +241,8 @@ void ClientImpl::ServerUnannounce(std::string_view name, int id) { } void ClientImpl::ServerPropertiesUpdate(std::string_view name, - const wpi::util::json& update, bool ack) { + const wpi::util::json& update, + bool ack) { DEBUG4("ServerProperties({}, {}, {})", name, update.dump(), ack); assert(m_local); m_local->ServerPropertiesUpdate(name, update, ack); diff --git a/ntcore/src/main/native/cpp/net/ClientImpl.hpp b/ntcore/src/main/native/cpp/net/ClientImpl.hpp index 0e450bbd80..5341f9366e 100644 --- a/ntcore/src/main/native/cpp/net/ClientImpl.hpp +++ b/ntcore/src/main/native/cpp/net/ClientImpl.hpp @@ -22,7 +22,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt { class PubSubOptionsImpl; @@ -37,7 +37,8 @@ class WireConnection; class ClientImpl final : private ServerMessageHandler { public: ClientImpl( - uint64_t curTimeMs, WireConnection& wire, bool local, wpi::util::Logger& logger, + uint64_t curTimeMs, WireConnection& wire, bool local, + wpi::util::Logger& logger, std::function timeSyncUpdated, std::function setPeriodic); @@ -66,12 +67,13 @@ class ClientImpl final : private ServerMessageHandler { const wpi::util::json& properties, std::optional pubuid) final; void ServerUnannounce(std::string_view name, int id) final; - void ServerPropertiesUpdate(std::string_view name, const wpi::util::json& update, - bool ack) final; + void ServerPropertiesUpdate(std::string_view name, + const wpi::util::json& update, bool ack) final; void ServerSetValue(int topicId, const Value& value) final; void Publish(int pubuid, std::string_view name, std::string_view typeStr, - const wpi::util::json& properties, const PubSubOptionsImpl& options); + const wpi::util::json& properties, + const PubSubOptionsImpl& options); void Unpublish(int pubuid, ClientMessage&& msg); void SetValue(int pubuid, const Value& value); diff --git a/ntcore/src/main/native/cpp/net/ClientMessageQueue.hpp b/ntcore/src/main/native/cpp/net/ClientMessageQueue.hpp index 3e7277c1a3..23d2810f3d 100644 --- a/ntcore/src/main/native/cpp/net/ClientMessageQueue.hpp +++ b/ntcore/src/main/native/cpp/net/ClientMessageQueue.hpp @@ -15,7 +15,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::net { @@ -35,7 +35,8 @@ class ClientMessageQueueImpl final : public ClientMessageHandler, public: static constexpr size_t kBlockSize = 64; - explicit ClientMessageQueueImpl(wpi::util::Logger& logger) : m_logger{logger} {} + explicit ClientMessageQueueImpl(wpi::util::Logger& logger) + : m_logger{logger} {} bool empty() const { return m_queue.empty(); } @@ -71,7 +72,8 @@ class ClientMessageQueueImpl final : public ClientMessageHandler, // ClientMessageHandler - calls to these append to the queue void ClientPublish(int pubuid, std::string_view name, - std::string_view typeStr, const wpi::util::json& properties, + std::string_view typeStr, + const wpi::util::json& properties, const PubSubOptionsImpl& options) final { std::scoped_lock lock{m_mutex}; m_queue.enqueue(ClientMessage{PublishMsg{ diff --git a/ntcore/src/main/native/cpp/net/MessageHandler.hpp b/ntcore/src/main/native/cpp/net/MessageHandler.hpp index e8ae7b1de0..daba1060d5 100644 --- a/ntcore/src/main/native/cpp/net/MessageHandler.hpp +++ b/ntcore/src/main/native/cpp/net/MessageHandler.hpp @@ -45,7 +45,8 @@ class ServerMessageHandler { std::optional pubuid) = 0; virtual void ServerUnannounce(std::string_view name, int id) = 0; virtual void ServerPropertiesUpdate(std::string_view name, - const wpi::util::json& update, bool ack) = 0; + const wpi::util::json& update, + bool ack) = 0; virtual void ServerSetValue(int topicuid, const Value& value) = 0; }; diff --git a/ntcore/src/main/native/cpp/net/WebSocketConnection.cpp b/ntcore/src/main/native/cpp/net/WebSocketConnection.cpp index 22795acf39..d92af20b49 100644 --- a/ntcore/src/main/native/cpp/net/WebSocketConnection.cpp +++ b/ntcore/src/main/native/cpp/net/WebSocketConnection.cpp @@ -124,7 +124,8 @@ void WebSocketConnection::SendPing(uint64_t time) { WPI_DEBUG4(m_logger, "conn: sending ping {}", time); auto buf = AllocBuf(); buf.len = 8; - wpi::util::support::endian::write64(buf.base, time); + wpi::util::support::endian::write64(buf.base, + time); m_ws.SendPing({buf}, [selfweak = weak_from_this()](auto bufs, auto err) { if (auto self = selfweak.lock()) { self->m_err = err; @@ -153,7 +154,8 @@ void WebSocketConnection::FinishText() { } int WebSocketConnection::Write( - State kind, wpi::util::function_ref writer) { + State kind, + wpi::util::function_ref writer) { bool first = false; if (m_state != kind || (m_state == kind && m_framePos >= kNewFrameThresholdBytes)) { @@ -243,7 +245,8 @@ int WebSocketConnection::Flush() { } void WebSocketConnection::Send( - uint8_t opcode, wpi::util::function_ref writer) { + uint8_t opcode, + wpi::util::function_ref writer) { wpi::util::SmallVector bufs; wpi::net::raw_uv_ostream os{bufs, [this] { return AllocBuf(); }}; if (opcode == wpi::net::WebSocket::Frame::kText) { diff --git a/ntcore/src/main/native/cpp/net/WebSocketConnection.hpp b/ntcore/src/main/native/cpp/net/WebSocketConnection.hpp index de62e7856e..52a966db8f 100644 --- a/ntcore/src/main/native/cpp/net/WebSocketConnection.hpp +++ b/ntcore/src/main/native/cpp/net/WebSocketConnection.hpp @@ -17,7 +17,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::net { @@ -37,18 +37,22 @@ class WebSocketConnection final bool Ready() const final { return !m_ws.IsWriteInProgress(); } - int WriteText(wpi::util::function_ref writer) final { + int WriteText( + wpi::util::function_ref writer) final { return Write(kText, writer); } - int WriteBinary(wpi::util::function_ref writer) final { + int WriteBinary( + wpi::util::function_ref writer) final { return Write(kBinary, writer); } int Flush() final; - void SendText(wpi::util::function_ref writer) final { + void SendText( + wpi::util::function_ref writer) final { Send(wpi::net::WebSocket::Frame::kText, writer); } - void SendBinary(wpi::util::function_ref writer) final { + void SendBinary( + wpi::util::function_ref writer) final { Send(wpi::net::WebSocket::Frame::kBinary, writer); } @@ -78,7 +82,8 @@ class WebSocketConnection final private: enum State { kEmpty, kText, kBinary }; - int Write(State kind, wpi::util::function_ref writer); + int Write(State kind, + wpi::util::function_ref writer); void Send(uint8_t opcode, wpi::util::function_ref writer); diff --git a/ntcore/src/main/native/cpp/net/WireConnection.hpp b/ntcore/src/main/native/cpp/net/WireConnection.hpp index cd5684c133..04175defda 100644 --- a/ntcore/src/main/native/cpp/net/WireConnection.hpp +++ b/ntcore/src/main/native/cpp/net/WireConnection.hpp @@ -12,7 +12,7 @@ namespace wpi::util { class raw_ostream; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::net { diff --git a/ntcore/src/main/native/cpp/net/WireDecoder.cpp b/ntcore/src/main/native/cpp/net/WireDecoder.cpp index 3fbc44bd53..c588752213 100644 --- a/ntcore/src/main/native/cpp/net/WireDecoder.cpp +++ b/ntcore/src/main/native/cpp/net/WireDecoder.cpp @@ -47,8 +47,8 @@ static bool GetNumber(wpi::util::json& val, int64_t* num) { return true; } -static std::string* ObjGetString(wpi::util::json::object_t& obj, std::string_view key, - std::string* error) { +static std::string* ObjGetString(wpi::util::json::object_t& obj, + std::string_view key, std::string* error) { auto it = obj.find(key); if (it == obj.end()) { *error = fmt::format("no {} key", key); @@ -75,8 +75,8 @@ static bool ObjGetNumber(wpi::util::json::object_t& obj, std::string_view key, return true; } -static bool ObjGetStringArray(wpi::util::json::object_t& obj, std::string_view key, - std::string* error, +static bool ObjGetStringArray(wpi::util::json::object_t& obj, + std::string_view key, std::string* error, std::vector* out) { // prefixes auto it = obj.find(key); @@ -174,7 +174,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (pubuid >= 0x7fffffffLL || pubuid <= (-0x7fffffffLL - 1)) { error = "pubuid out of range"; goto err; @@ -206,7 +207,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (pubuid >= 0x7fffffffLL || pubuid <= (-0x7fffffffLL - 1)) { error = "pubuid out of range"; goto err; @@ -243,7 +245,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (subuid >= 0x7fffffffLL || subuid <= (-0x7fffffffLL - 1)) { error = "subuid out of range"; goto err; @@ -253,7 +256,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, PubSubOptionsImpl options; auto optionsIt = params->find("options"); if (optionsIt != params->end()) { - auto joptions = optionsIt->second.get_ptr(); + auto joptions = + optionsIt->second.get_ptr(); if (!joptions) { error = "options must be an object"; goto err; @@ -321,7 +325,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (subuid >= 0x7fffffffLL || subuid <= (-0x7fffffffLL - 1)) { error = "pubuid out of range"; goto err; @@ -348,7 +353,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (id >= 0x7fffffffLL || id <= (-0x7fffffffLL - 1)) { error = "id out of range"; goto err; @@ -370,7 +376,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (val >= 0x7fffffffLL || val <= (-0x7fffffffLL - 1)) { error = "pubuid out of range"; goto err; @@ -406,7 +413,8 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, goto err; } - // limit to 32-bit range and exclude endpoints used by wpi::util::DenseMap + // limit to 32-bit range and exclude endpoints used by + // wpi::util::DenseMap if (id >= 0x7fffffffLL || id <= (-0x7fffffffLL - 1)) { error = "id out of range"; goto err; @@ -464,19 +472,21 @@ static bool WireDecodeTextImpl(std::string_view in, T& out, #pragma clang diagnostic pop #endif -bool wpi::nt::net::WireDecodeText(std::string_view in, ClientMessageHandler& out, - wpi::util::Logger& logger) { +bool wpi::nt::net::WireDecodeText(std::string_view in, + ClientMessageHandler& out, + wpi::util::Logger& logger) { return ::WireDecodeTextImpl(in, out, logger); } -void wpi::nt::net::WireDecodeText(std::string_view in, ServerMessageHandler& out, - wpi::util::Logger& logger) { +void wpi::nt::net::WireDecodeText(std::string_view in, + ServerMessageHandler& out, + wpi::util::Logger& logger) { ::WireDecodeTextImpl(in, out, logger); } bool wpi::nt::net::WireDecodeBinary(std::span* in, int* outId, - Value* outValue, std::string* error, - int64_t localTimeOffset) { + Value* outValue, std::string* error, + int64_t localTimeOffset) { mpack_reader_t reader; mpack_reader_init_data(&reader, reinterpret_cast(in->data()), in->size()); diff --git a/ntcore/src/main/native/cpp/net/WireDecoder.hpp b/ntcore/src/main/native/cpp/net/WireDecoder.hpp index 6b8e7bc8bc..dcdfe7410f 100644 --- a/ntcore/src/main/native/cpp/net/WireDecoder.hpp +++ b/ntcore/src/main/native/cpp/net/WireDecoder.hpp @@ -12,7 +12,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt { class Value; diff --git a/ntcore/src/main/native/cpp/net/WireEncoder.cpp b/ntcore/src/main/native/cpp/net/WireEncoder.cpp index 0b737d389c..ee0529354b 100644 --- a/ntcore/src/main/native/cpp/net/WireEncoder.cpp +++ b/ntcore/src/main/native/cpp/net/WireEncoder.cpp @@ -19,8 +19,9 @@ using namespace wpi::nt::net; using namespace mpack; void wpi::nt::net::WireEncodePublish(wpi::util::raw_ostream& os, int pubuid, - std::string_view name, std::string_view typeStr, - const wpi::util::json& properties) { + std::string_view name, + std::string_view typeStr, + const wpi::util::json& properties) { wpi::util::json::serializer s{os, ' ', 0}; os << "{\"method\":\"" << PublishMsg::kMethodStr << "\",\"params\":{"; os << "\"name\":\""; @@ -43,8 +44,8 @@ void wpi::nt::net::WireEncodeUnpublish(wpi::util::raw_ostream& os, int pubuid) { } void wpi::nt::net::WireEncodeSetProperties(wpi::util::raw_ostream& os, - std::string_view name, - const wpi::util::json& update) { + std::string_view name, + const wpi::util::json& update) { wpi::util::json::serializer s{os, ' ', 0}; os << "{\"method\":\"" << SetPropertiesMsg::kMethodStr << "\",\"params\":{"; os << "\"name\":\""; @@ -55,7 +56,8 @@ void wpi::nt::net::WireEncodeSetProperties(wpi::util::raw_ostream& os, } template -static void EncodePrefixes(wpi::util::raw_ostream& os, std::span topicNames, +static void EncodePrefixes(wpi::util::raw_ostream& os, + std::span topicNames, wpi::util::json::serializer& s) { os << '['; bool first = true; @@ -112,19 +114,21 @@ static void WireEncodeSubscribeImpl(wpi::util::raw_ostream& os, int subuid, os << "}}"; } -void wpi::nt::net::WireEncodeSubscribe(wpi::util::raw_ostream& os, int subuid, - std::span topicNames, - const PubSubOptionsImpl& options) { +void wpi::nt::net::WireEncodeSubscribe( + wpi::util::raw_ostream& os, int subuid, + std::span topicNames, + const PubSubOptionsImpl& options) { WireEncodeSubscribeImpl(os, subuid, topicNames, options); } void wpi::nt::net::WireEncodeSubscribe(wpi::util::raw_ostream& os, int subuid, - std::span topicNames, - const PubSubOptionsImpl& options) { + std::span topicNames, + const PubSubOptionsImpl& options) { WireEncodeSubscribeImpl(os, subuid, topicNames, options); } -void wpi::nt::net::WireEncodeUnsubscribe(wpi::util::raw_ostream& os, int subuid) { +void wpi::nt::net::WireEncodeUnsubscribe(wpi::util::raw_ostream& os, + int subuid) { wpi::util::json::serializer s{os, ' ', 0}; os << "{\"method\":\"" << UnsubscribeMsg::kMethodStr << "\",\"params\":{"; os << "\"subuid\":"; @@ -132,7 +136,8 @@ void wpi::nt::net::WireEncodeUnsubscribe(wpi::util::raw_ostream& os, int subuid) os << "}}"; } -bool wpi::nt::net::WireEncodeText(wpi::util::raw_ostream& os, const ClientMessage& msg) { +bool wpi::nt::net::WireEncodeText(wpi::util::raw_ostream& os, + const ClientMessage& msg) { if (auto m = std::get_if(&msg.contents)) { WireEncodePublish(os, m->pubuid, m->name, m->typeStr, m->properties); } else if (auto m = std::get_if(&msg.contents)) { @@ -149,10 +154,11 @@ bool wpi::nt::net::WireEncodeText(wpi::util::raw_ostream& os, const ClientMessag return true; } -void wpi::nt::net::WireEncodeAnnounce(wpi::util::raw_ostream& os, std::string_view name, - int id, std::string_view typeStr, - const wpi::util::json& properties, - std::optional pubuid) { +void wpi::nt::net::WireEncodeAnnounce(wpi::util::raw_ostream& os, + std::string_view name, int id, + std::string_view typeStr, + const wpi::util::json& properties, + std::optional pubuid) { wpi::util::json::serializer s{os, ' ', 0}; os << "{\"method\":\"" << AnnounceMsg::kMethodStr << "\",\"params\":{"; os << "\"id\":"; @@ -170,8 +176,8 @@ void wpi::nt::net::WireEncodeAnnounce(wpi::util::raw_ostream& os, std::string_vi os << "\"}}"; } -void wpi::nt::net::WireEncodeUnannounce(wpi::util::raw_ostream& os, std::string_view name, - int64_t id) { +void wpi::nt::net::WireEncodeUnannounce(wpi::util::raw_ostream& os, + std::string_view name, int64_t id) { wpi::util::json::serializer s{os, ' ', 0}; os << "{\"method\":\"" << UnannounceMsg::kMethodStr << "\",\"params\":{"; os << "\"id\":"; @@ -182,8 +188,9 @@ void wpi::nt::net::WireEncodeUnannounce(wpi::util::raw_ostream& os, std::string_ } void wpi::nt::net::WireEncodePropertiesUpdate(wpi::util::raw_ostream& os, - std::string_view name, - const wpi::util::json& update, bool ack) { + std::string_view name, + const wpi::util::json& update, + bool ack) { wpi::util::json::serializer s{os, ' ', 0}; os << "{\"method\":\"" << PropertiesUpdateMsg::kMethodStr << "\",\"params\":{"; @@ -197,7 +204,8 @@ void wpi::nt::net::WireEncodePropertiesUpdate(wpi::util::raw_ostream& os, os << "}}"; } -bool wpi::nt::net::WireEncodeText(wpi::util::raw_ostream& os, const ServerMessage& msg) { +bool wpi::nt::net::WireEncodeText(wpi::util::raw_ostream& os, + const ServerMessage& msg) { if (auto m = std::get_if(&msg.contents)) { WireEncodeAnnounce(os, m->name, m->id, m->typeStr, m->properties, m->pubuid); @@ -211,16 +219,16 @@ bool wpi::nt::net::WireEncodeText(wpi::util::raw_ostream& os, const ServerMessag return true; } -bool wpi::nt::net::WireEncodeBinary(wpi::util::raw_ostream& os, int id, int64_t time, - const Value& value) { +bool wpi::nt::net::WireEncodeBinary(wpi::util::raw_ostream& os, int id, + int64_t time, const Value& value) { char buf[128]; mpack_writer_t writer; mpack_writer_init(&writer, buf, sizeof(buf)); mpack_writer_set_context(&writer, &os); - mpack_writer_set_flush( - &writer, [](mpack_writer_t* writer, const char* buffer, size_t count) { - static_cast(writer->context)->write(buffer, count); - }); + mpack_writer_set_flush(&writer, [](mpack_writer_t* writer, const char* buffer, + size_t count) { + static_cast(writer->context)->write(buffer, count); + }); mpack_start_array(&writer, 4); mpack_write_int(&writer, id); mpack_write_int(&writer, time); diff --git a/ntcore/src/main/native/cpp/net/WireEncoder.hpp b/ntcore/src/main/native/cpp/net/WireEncoder.hpp index 394cc27fdd..a016b876ea 100644 --- a/ntcore/src/main/native/cpp/net/WireEncoder.hpp +++ b/ntcore/src/main/native/cpp/net/WireEncoder.hpp @@ -13,7 +13,7 @@ namespace wpi::util { class raw_ostream; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt { class PubSubOptionsImpl; @@ -26,8 +26,9 @@ struct ClientMessage; struct ServerMessage; // encoders for client text messages (avoids need to construct a Message struct) -void WireEncodePublish(wpi::util::raw_ostream& os, int pubuid, std::string_view name, - std::string_view typeStr, const wpi::util::json& properties); +void WireEncodePublish(wpi::util::raw_ostream& os, int pubuid, + std::string_view name, std::string_view typeStr, + const wpi::util::json& properties); void WireEncodeUnpublish(wpi::util::raw_ostream& os, int pubuid); void WireEncodeSetProperties(wpi::util::raw_ostream& os, std::string_view name, const wpi::util::json& update); @@ -40,12 +41,14 @@ void WireEncodeSubscribe(wpi::util::raw_ostream& os, int subuid, void WireEncodeUnsubscribe(wpi::util::raw_ostream& os, int subuid); // encoders for server text messages (avoids need to construct a Message struct) -void WireEncodeAnnounce(wpi::util::raw_ostream& os, std::string_view name, int id, - std::string_view typeStr, const wpi::util::json& properties, +void WireEncodeAnnounce(wpi::util::raw_ostream& os, std::string_view name, + int id, std::string_view typeStr, + const wpi::util::json& properties, std::optional pubuid); void WireEncodeUnannounce(wpi::util::raw_ostream& os, std::string_view name, int64_t id); -void WireEncodePropertiesUpdate(wpi::util::raw_ostream& os, std::string_view name, +void WireEncodePropertiesUpdate(wpi::util::raw_ostream& os, + std::string_view name, const wpi::util::json& update, bool ack); // Encode a single message; note text messages must be put into a diff --git a/ntcore/src/main/native/cpp/networktables/NetworkTable.cpp b/ntcore/src/main/native/cpp/networktables/NetworkTable.cpp index 5f6f663fd4..5bd6b8b185 100644 --- a/ntcore/src/main/native/cpp/networktables/NetworkTable.cpp +++ b/ntcore/src/main/native/cpp/networktables/NetworkTable.cpp @@ -46,9 +46,9 @@ std::string NetworkTable::NormalizeKey(std::string_view key, return std::string{NormalizeKey(key, buf, withLeadingSlash)}; } -std::string_view NetworkTable::NormalizeKey(std::string_view key, - wpi::util::SmallVectorImpl& buf, - bool withLeadingSlash) { +std::string_view NetworkTable::NormalizeKey( + std::string_view key, wpi::util::SmallVectorImpl& buf, + bool withLeadingSlash) { buf.clear(); if (withLeadingSlash) { buf.push_back(PATH_SEPARATOR_CHAR); @@ -412,7 +412,8 @@ NT_Listener NetworkTable::AddSubTableListener(SubTableListener listener) { if (!topicInfo) { return; } - auto relative_key = wpi::util::substr(topicInfo->name, m_path.size() + 1); + auto relative_key = + wpi::util::substr(topicInfo->name, m_path.size() + 1); auto end_sub_table = relative_key.find(PATH_SEPARATOR_CHAR); if (end_sub_table == std::string_view::npos) { return; diff --git a/ntcore/src/main/native/cpp/networktables/NetworkTableInstance.cpp b/ntcore/src/main/native/cpp/networktables/NetworkTableInstance.cpp index 8e2e81df72..1727096376 100644 --- a/ntcore/src/main/native/cpp/networktables/NetworkTableInstance.cpp +++ b/ntcore/src/main/native/cpp/networktables/NetworkTableInstance.cpp @@ -112,18 +112,20 @@ NT_Listener NetworkTableInstance::AddListener(Topic topic, wpi::util::print(stderr, "AddListener: topic is not from this instance\n"); return 0; } - return ::wpi::nt::AddListener(topic.GetHandle(), eventMask, std::move(listener)); + return ::wpi::nt::AddListener(topic.GetHandle(), eventMask, + std::move(listener)); } NT_Listener NetworkTableInstance::AddListener(Subscriber& subscriber, unsigned int eventMask, ListenerCallback listener) { if (::wpi::nt::GetInstanceFromHandle(subscriber.GetHandle()) != m_handle) { - wpi::util::print(stderr, "AddListener: subscriber is not from this instance\n"); + wpi::util::print(stderr, + "AddListener: subscriber is not from this instance\n"); return 0; } return ::wpi::nt::AddListener(subscriber.GetHandle(), eventMask, - std::move(listener)); + std::move(listener)); } NT_Listener NetworkTableInstance::AddListener(const NetworkTableEntry& entry, @@ -133,16 +135,18 @@ NT_Listener NetworkTableInstance::AddListener(const NetworkTableEntry& entry, wpi::util::print(stderr, "AddListener: entry is not from this instance\n"); return 0; } - return ::wpi::nt::AddListener(entry.GetHandle(), eventMask, std::move(listener)); + return ::wpi::nt::AddListener(entry.GetHandle(), eventMask, + std::move(listener)); } NT_Listener NetworkTableInstance::AddListener(MultiSubscriber& subscriber, int eventMask, ListenerCallback listener) { if (::wpi::nt::GetInstanceFromHandle(subscriber.GetHandle()) != m_handle) { - wpi::util::print(stderr, "AddListener: subscriber is not from this instance\n"); + wpi::util::print(stderr, + "AddListener: subscriber is not from this instance\n"); return 0; } return ::wpi::nt::AddListener(subscriber.GetHandle(), eventMask, - std::move(listener)); + std::move(listener)); } diff --git a/ntcore/src/main/native/cpp/networktables/Topic.cpp b/ntcore/src/main/native/cpp/networktables/Topic.cpp index 6e47dcefb5..0022761911 100644 --- a/ntcore/src/main/native/cpp/networktables/Topic.cpp +++ b/ntcore/src/main/native/cpp/networktables/Topic.cpp @@ -45,9 +45,9 @@ GenericPublisher Topic::GenericPublish(std::string_view typeString, GenericPublisher Topic::GenericPublishEx(std::string_view typeString, const wpi::util::json& properties, const PubSubOptions& options) { - return GenericPublisher{::wpi::nt::PublishEx(m_handle, - ::wpi::nt::GetTypeFromString(typeString), - typeString, properties, options)}; + return GenericPublisher{ + ::wpi::nt::PublishEx(m_handle, ::wpi::nt::GetTypeFromString(typeString), + typeString, properties, options)}; } GenericEntry Topic::GetGenericEntry(const PubSubOptions& options) { diff --git a/ntcore/src/main/native/cpp/ntcore_c.cpp b/ntcore/src/main/native/cpp/ntcore_c.cpp index 93ea56dbc3..f746acf17c 100644 --- a/ntcore/src/main/native/cpp/ntcore_c.cpp +++ b/ntcore/src/main/native/cpp/ntcore_c.cpp @@ -218,7 +218,8 @@ struct NT_Value* NT_ReadQueueValueType(NT_Handle subentry, unsigned int types, NT_Topic* NT_GetTopics(NT_Inst inst, const struct WPI_String* prefix, unsigned int types, size_t* count) { - auto info_v = wpi::nt::GetTopics(inst, wpi::util::to_string_view(prefix), types); + auto info_v = + wpi::nt::GetTopics(inst, wpi::util::to_string_view(prefix), types); return ConvertToC(info_v, count); } @@ -230,14 +231,16 @@ NT_Topic* NT_GetTopicsStr(NT_Inst inst, const struct WPI_String* prefix, for (size_t i = 0; i < types_len; ++i) { typesCpp.emplace_back(wpi::util::to_string_view(&types[i])); } - auto info_v = wpi::nt::GetTopics(inst, wpi::util::to_string_view(prefix), typesCpp); + auto info_v = + wpi::nt::GetTopics(inst, wpi::util::to_string_view(prefix), typesCpp); return ConvertToC(info_v, count); } struct NT_TopicInfo* NT_GetTopicInfos(NT_Inst inst, const struct WPI_String* prefix, unsigned int types, size_t* count) { - auto info_v = wpi::nt::GetTopicInfo(inst, wpi::util::to_string_view(prefix), types); + auto info_v = + wpi::nt::GetTopicInfo(inst, wpi::util::to_string_view(prefix), types); return ConvertToC(info_v, count); } @@ -250,7 +253,8 @@ struct NT_TopicInfo* NT_GetTopicInfosStr(NT_Inst inst, for (size_t i = 0; i < types_len; ++i) { typesCpp.emplace_back(wpi::util::to_string_view(&types[i])); } - auto info_v = wpi::nt::GetTopicInfo(inst, wpi::util::to_string_view(prefix), typesCpp); + auto info_v = + wpi::nt::GetTopicInfo(inst, wpi::util::to_string_view(prefix), typesCpp); return ConvertToC(info_v, count); } @@ -309,7 +313,8 @@ NT_Bool NT_GetTopicExists(NT_Handle handle) { void NT_GetTopicProperty(NT_Topic topic, const struct WPI_String* name, struct WPI_String* prop) { - wpi::util::json j = wpi::nt::GetTopicProperty(topic, wpi::util::to_string_view(name)); + wpi::util::json j = + wpi::nt::GetTopicProperty(topic, wpi::util::to_string_view(name)); wpi::nt::ConvertToC(j.dump(), prop); } @@ -349,7 +354,7 @@ NT_Subscriber NT_Subscribe(NT_Topic topic, NT_Type type, const struct WPI_String* typeStr, const struct NT_PubSubOptions* options) { return wpi::nt::Subscribe(topic, type, wpi::util::to_string_view(typeStr), - ConvertToCpp(options)); + ConvertToCpp(options)); } void NT_Unsubscribe(NT_Subscriber sub) { @@ -360,7 +365,7 @@ NT_Publisher NT_Publish(NT_Topic topic, NT_Type type, const struct WPI_String* typeStr, const struct NT_PubSubOptions* options) { return wpi::nt::Publish(topic, type, wpi::util::to_string_view(typeStr), - ConvertToCpp(options)); + ConvertToCpp(options)); } NT_Publisher NT_PublishEx(NT_Topic topic, NT_Type type, @@ -380,7 +385,7 @@ NT_Publisher NT_PublishEx(NT_Topic topic, NT_Type type, } return wpi::nt::PublishEx(topic, type, wpi::util::to_string_view(typeStr), j, - ConvertToCpp(options)); + ConvertToCpp(options)); } void NT_Unpublish(NT_Handle pubentry) { @@ -391,7 +396,7 @@ NT_Entry NT_GetEntryEx(NT_Topic topic, NT_Type type, const struct WPI_String* typeStr, const struct NT_PubSubOptions* options) { return wpi::nt::GetEntry(topic, type, wpi::util::to_string_view(typeStr), - ConvertToCpp(options)); + ConvertToCpp(options)); } void NT_ReleaseEntry(NT_Entry entry) { @@ -529,7 +534,7 @@ void NT_StartServer(NT_Inst inst, const struct WPI_String* persist_filename, const struct WPI_String* listen_address, unsigned int port) { wpi::nt::StartServer(inst, wpi::util::to_string_view(persist_filename), - wpi::util::to_string_view(listen_address), port); + wpi::util::to_string_view(listen_address), port); } void NT_StopServer(NT_Inst inst) { @@ -619,9 +624,9 @@ void NT_SetNow(int64_t timestamp) { NT_DataLogger NT_StartEntryDataLog(NT_Inst inst, struct WPI_DataLog* log, const struct WPI_String* prefix, const struct WPI_String* logPrefix) { - return wpi::nt::StartEntryDataLog(inst, *reinterpret_cast(log), - wpi::util::to_string_view(prefix), - wpi::util::to_string_view(logPrefix)); + return wpi::nt::StartEntryDataLog( + inst, *reinterpret_cast(log), + wpi::util::to_string_view(prefix), wpi::util::to_string_view(logPrefix)); } void NT_StopEntryDataLog(NT_DataLogger logger) { @@ -630,9 +635,9 @@ void NT_StopEntryDataLog(NT_DataLogger logger) { NT_ConnectionDataLogger NT_StartConnectionDataLog( NT_Inst inst, struct WPI_DataLog* log, const struct WPI_String* name) { - return wpi::nt::StartConnectionDataLog(inst, - *reinterpret_cast(log), - wpi::util::to_string_view(name)); + return wpi::nt::StartConnectionDataLog( + inst, *reinterpret_cast(log), + wpi::util::to_string_view(name)); } void NT_StopConnectionDataLog(NT_ConnectionDataLogger logger) { @@ -662,8 +667,8 @@ NT_Bool NT_HasSchema(NT_Inst inst, const struct WPI_String* name) { void NT_AddSchema(NT_Inst inst, const struct WPI_String* name, const struct WPI_String* type, const uint8_t* schema, size_t schemaSize) { - wpi::nt::AddSchema(inst, wpi::util::to_string_view(name), wpi::util::to_string_view(type), - {schema, schemaSize}); + wpi::nt::AddSchema(inst, wpi::util::to_string_view(name), + wpi::util::to_string_view(type), {schema, schemaSize}); } void NT_DisposeValue(NT_Value* value) { @@ -754,7 +759,8 @@ void NT_DisposeEvent(NT_Event* event) { /* Array and Struct Allocations */ char* NT_AllocateCharArray(size_t size) { - char* retVal = static_cast(wpi::util::safe_malloc(size * sizeof(char))); + char* retVal = + static_cast(wpi::util::safe_malloc(size * sizeof(char))); return retVal; } @@ -770,7 +776,8 @@ int64_t* NT_AllocateIntegerArray(size_t size) { } float* NT_AllocateFloatArray(size_t size) { - float* retVal = static_cast(wpi::util::safe_malloc(size * sizeof(float))); + float* retVal = + static_cast(wpi::util::safe_malloc(size * sizeof(float))); return retVal; } diff --git a/ntcore/src/main/native/cpp/ntcore_meta.cpp b/ntcore/src/main/native/cpp/ntcore_meta.cpp index 727fe1a234..d8d1f030a7 100644 --- a/ntcore/src/main/native/cpp/ntcore_meta.cpp +++ b/ntcore/src/main/native/cpp/ntcore_meta.cpp @@ -39,8 +39,8 @@ static SubscriberOptions DecodeSubscriberOptions(mpack_reader_t& r) { return options; } -std::optional> wpi::nt::meta::DecodeClientPublishers( - std::span data) { +std::optional> +wpi::nt::meta::DecodeClientPublishers(std::span data) { mpack_reader_t r; mpack_reader_init_data(&r, data); uint32_t numPub = mpack_expect_array_max(&r, 10000); @@ -71,8 +71,8 @@ std::optional> wpi::nt::meta::DecodeClientPublisher } } -std::optional> wpi::nt::meta::DecodeClientSubscribers( - std::span data) { +std::optional> +wpi::nt::meta::DecodeClientSubscribers(std::span data) { mpack_reader_t r; mpack_reader_init_data(&r, data); uint32_t numSub = mpack_expect_array_max(&r, 10000); @@ -145,8 +145,8 @@ std::optional> wpi::nt::meta::DecodeTopicPublishers( } } -std::optional> wpi::nt::meta::DecodeTopicSubscribers( - std::span data) { +std::optional> +wpi::nt::meta::DecodeTopicSubscribers(std::span data) { mpack_reader_t r; mpack_reader_init_data(&r, data); uint32_t numSub = mpack_expect_array_max(&r, 1000); diff --git a/ntcore/src/main/native/cpp/ntcore_test.cpp b/ntcore/src/main/native/cpp/ntcore_test.cpp index 21f7894bf1..1a6467aafe 100644 --- a/ntcore/src/main/native/cpp/ntcore_test.cpp +++ b/ntcore/src/main/native/cpp/ntcore_test.cpp @@ -22,8 +22,8 @@ struct NT_TopicInfo* NT_GetTopicInfoForTesting(const char* name, enum NT_Type type, const char* type_str, int* struct_size) { - struct NT_TopicInfo* topic_info = - static_cast(wpi::util::safe_calloc(1, sizeof(NT_TopicInfo))); + struct NT_TopicInfo* topic_info = static_cast( + wpi::util::safe_calloc(1, sizeof(NT_TopicInfo))); wpi::nt::ConvertToC(name, &topic_info->name); topic_info->type = type; wpi::nt::ConvertToC(type_str, &topic_info->type_str); diff --git a/ntcore/src/main/native/cpp/server/MessagePackWriter.hpp b/ntcore/src/main/native/cpp/server/MessagePackWriter.hpp index 7a690165c3..4c8f3f4327 100644 --- a/ntcore/src/main/native/cpp/server/MessagePackWriter.hpp +++ b/ntcore/src/main/native/cpp/server/MessagePackWriter.hpp @@ -17,10 +17,10 @@ struct Writer : public mpack::mpack_writer_t { Writer() { mpack::mpack_writer_init(this, buf, sizeof(buf)); mpack::mpack_writer_set_context(this, &os); - mpack::mpack_writer_set_flush( - this, [](mpack::mpack_writer_t* w, const char* buffer, size_t count) { - static_cast(w->context)->write(buffer, count); - }); + mpack::mpack_writer_set_flush(this, [](mpack::mpack_writer_t* w, + const char* buffer, size_t count) { + static_cast(w->context)->write(buffer, count); + }); } std::vector bytes; diff --git a/ntcore/src/main/native/cpp/server/ServerClient.hpp b/ntcore/src/main/native/cpp/server/ServerClient.hpp index b15f7cade4..59ec3fcba8 100644 --- a/ntcore/src/main/native/cpp/server/ServerClient.hpp +++ b/ntcore/src/main/native/cpp/server/ServerClient.hpp @@ -23,7 +23,7 @@ namespace wpi::util { class Logger; template class SmallVectorImpl; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::server { @@ -55,7 +55,8 @@ class ServerClient { net::ValueSendMode mode) = 0; virtual void SendAnnounce(ServerTopic* topic, std::optional pubuid) = 0; virtual void SendUnannounce(ServerTopic* topic) = 0; - virtual void SendPropertiesUpdate(ServerTopic* topic, const wpi::util::json& update, + virtual void SendPropertiesUpdate(ServerTopic* topic, + const wpi::util::json& update, bool ack) = 0; virtual void SendOutgoing(uint64_t curTimeMs, bool flush) = 0; virtual void Flush() = 0; diff --git a/ntcore/src/main/native/cpp/server/ServerClient4.cpp b/ntcore/src/main/native/cpp/server/ServerClient4.cpp index f0add7f7dd..ed6ad86104 100644 --- a/ntcore/src/main/native/cpp/server/ServerClient4.cpp +++ b/ntcore/src/main/native/cpp/server/ServerClient4.cpp @@ -142,7 +142,8 @@ void ServerClient4::SendUnannounce(ServerTopic* topic) { } void ServerClient4::SendPropertiesUpdate(ServerTopic* topic, - const wpi::util::json& update, bool ack) { + const wpi::util::json& update, + bool ack) { if (!m_announceSent.lookup(topic)) { return; } diff --git a/ntcore/src/main/native/cpp/server/ServerClient4Base.hpp b/ntcore/src/main/native/cpp/server/ServerClient4Base.hpp index 274546a9b2..1f035de321 100644 --- a/ntcore/src/main/native/cpp/server/ServerClient4Base.hpp +++ b/ntcore/src/main/native/cpp/server/ServerClient4Base.hpp @@ -25,7 +25,8 @@ class ServerClient4Base : public ServerClient, protected: // ClientMessageHandler interface void ClientPublish(int pubuid, std::string_view name, - std::string_view typeStr, const wpi::util::json& properties, + std::string_view typeStr, + const wpi::util::json& properties, const PubSubOptionsImpl& options) final; void ClientUnpublish(int pubuid) final; void ClientSetProperties(std::string_view name, diff --git a/ntcore/src/main/native/cpp/server/ServerImpl.hpp b/ntcore/src/main/native/cpp/server/ServerImpl.hpp index af640ae9c2..c6f4493569 100644 --- a/ntcore/src/main/native/cpp/server/ServerImpl.hpp +++ b/ntcore/src/main/native/cpp/server/ServerImpl.hpp @@ -19,7 +19,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::net { class ClientMessageQueue; diff --git a/ntcore/src/main/native/cpp/server/ServerStorage.cpp b/ntcore/src/main/native/cpp/server/ServerStorage.cpp index 24e5c2e0b6..c039fcdd32 100644 --- a/ntcore/src/main/native/cpp/server/ServerStorage.cpp +++ b/ntcore/src/main/native/cpp/server/ServerStorage.cpp @@ -372,8 +372,8 @@ void ServerStorage::DumpPersistent(wpi::util::raw_ostream& os) { os << "\n]\n"; } -static std::string* ObjGetString(wpi::util::json::object_t& obj, std::string_view key, - std::string* error) { +static std::string* ObjGetString(wpi::util::json::object_t& obj, + std::string_view key, std::string* error) { auto it = obj.find(key); if (it == obj.end()) { *error = fmt::format("no {} key", key); diff --git a/ntcore/src/main/native/cpp/server/ServerStorage.hpp b/ntcore/src/main/native/cpp/server/ServerStorage.hpp index 16f5eff2b1..3c5756b4ef 100644 --- a/ntcore/src/main/native/cpp/server/ServerStorage.hpp +++ b/ntcore/src/main/native/cpp/server/ServerStorage.hpp @@ -17,7 +17,7 @@ namespace wpi::util { class Logger; class raw_ostream; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::server { @@ -34,7 +34,8 @@ class ServerStorage final { ServerTopic* CreateTopic(ServerClient* client, std::string_view name, std::string_view typeStr, - const wpi::util::json& properties, bool special = false); + const wpi::util::json& properties, + bool special = false); ServerTopic* CreateMetaTopic(std::string_view name); void DeleteTopic(ServerTopic* topic); void SetProperties(ServerClient* client, ServerTopic* topic, diff --git a/ntcore/src/main/native/cpp/server/ServerTopic.hpp b/ntcore/src/main/native/cpp/server/ServerTopic.hpp index 42b43f8269..df2b0e7914 100644 --- a/ntcore/src/main/native/cpp/server/ServerTopic.hpp +++ b/ntcore/src/main/native/cpp/server/ServerTopic.hpp @@ -18,7 +18,7 @@ namespace wpi::util { class Logger; -} // namespace wpi +} // namespace wpi::util namespace wpi::nt::server { diff --git a/ntcore/src/main/native/include/wpi/nt/MultiSubscriber.hpp b/ntcore/src/main/native/include/wpi/nt/MultiSubscriber.hpp index eff021e223..b751c7e02b 100644 --- a/ntcore/src/main/native/include/wpi/nt/MultiSubscriber.hpp +++ b/ntcore/src/main/native/include/wpi/nt/MultiSubscriber.hpp @@ -31,8 +31,8 @@ class MultiSubscriber final { MultiSubscriber(NetworkTableInstance inst, std::span prefixes, const PubSubOptions& options = kDefaultPubSubOptions) - : m_handle{::wpi::nt::SubscribeMultiple(inst.GetHandle(), prefixes, options)} { - } + : m_handle{::wpi::nt::SubscribeMultiple(inst.GetHandle(), prefixes, + options)} {} MultiSubscriber(const MultiSubscriber&) = delete; MultiSubscriber& operator=(const MultiSubscriber&) = delete; diff --git a/ntcore/src/main/native/include/wpi/nt/NetworkTableInstance.hpp b/ntcore/src/main/native/include/wpi/nt/NetworkTableInstance.hpp index eab900ff8b..6469f7038c 100644 --- a/ntcore/src/main/native/include/wpi/nt/NetworkTableInstance.hpp +++ b/ntcore/src/main/native/include/wpi/nt/NetworkTableInstance.hpp @@ -567,7 +567,7 @@ class NetworkTableInstance final { NT_Listener AddListener(std::span prefixes, int eventMask, ListenerCallback listener) { return ::wpi::nt::AddListener(m_handle, prefixes, eventMask, - std::move(listener)); + std::move(listener)); } /** @} */ @@ -582,7 +582,9 @@ class NetworkTableInstance final { * * @return Bitmask of NetworkMode. */ - unsigned int GetNetworkMode() const { return ::wpi::nt::GetNetworkMode(m_handle); } + unsigned int GetNetworkMode() const { + return ::wpi::nt::GetNetworkMode(m_handle); + } /** * Starts local-only operation. Prevents calls to StartServer or StartClient diff --git a/ntcore/src/main/native/include/wpi/nt/NetworkTableListener.hpp b/ntcore/src/main/native/include/wpi/nt/NetworkTableListener.hpp index 244423c325..c4b872c550 100644 --- a/ntcore/src/main/native/include/wpi/nt/NetworkTableListener.hpp +++ b/ntcore/src/main/native/include/wpi/nt/NetworkTableListener.hpp @@ -47,8 +47,8 @@ class NetworkTableListener final { static NetworkTableListener CreateListener( NetworkTableInstance inst, std::span prefixes, unsigned int mask, ListenerCallback listener) { - return NetworkTableListener{::wpi::nt::AddListener(inst.GetHandle(), prefixes, - mask, std::move(listener))}; + return NetworkTableListener{::wpi::nt::AddListener( + inst.GetHandle(), prefixes, mask, std::move(listener))}; } /** @@ -78,8 +78,8 @@ class NetworkTableListener final { static NetworkTableListener CreateListener(Subscriber& subscriber, unsigned int mask, ListenerCallback listener) { - return NetworkTableListener{ - ::wpi::nt::AddListener(subscriber.GetHandle(), mask, std::move(listener))}; + return NetworkTableListener{::wpi::nt::AddListener( + subscriber.GetHandle(), mask, std::move(listener))}; } /** @@ -94,8 +94,8 @@ class NetworkTableListener final { static NetworkTableListener CreateListener(MultiSubscriber& subscriber, unsigned int mask, ListenerCallback listener) { - return NetworkTableListener{ - ::wpi::nt::AddListener(subscriber.GetHandle(), mask, std::move(listener))}; + return NetworkTableListener{::wpi::nt::AddListener( + subscriber.GetHandle(), mask, std::move(listener))}; } /** @@ -166,8 +166,8 @@ class NetworkTableListener final { unsigned int minLevel, unsigned int maxLevel, ListenerCallback listener) { - return NetworkTableListener{::wpi::nt::AddLogger(inst.GetHandle(), minLevel, - maxLevel, std::move(listener))}; + return NetworkTableListener{::wpi::nt::AddLogger( + inst.GetHandle(), minLevel, maxLevel, std::move(listener))}; } NetworkTableListener(const NetworkTableListener&) = delete; @@ -386,14 +386,18 @@ class NetworkTableListenerPoller final { * * @param listener Listener handle */ - void RemoveListener(NT_Listener listener) { ::wpi::nt::RemoveListener(listener); } + void RemoveListener(NT_Listener listener) { + ::wpi::nt::RemoveListener(listener); + } /** * Read events. * * @return Events since the previous call to ReadQueue() */ - std::vector ReadQueue() { return ::wpi::nt::ReadListenerQueue(m_handle); } + std::vector ReadQueue() { + return ::wpi::nt::ReadListenerQueue(m_handle); + } private: NT_ListenerPoller m_handle{0}; diff --git a/ntcore/src/main/native/include/wpi/nt/ProtobufTopic.hpp b/ntcore/src/main/native/include/wpi/nt/ProtobufTopic.hpp index 3b2e0a8a2f..47b757f749 100644 --- a/ntcore/src/main/native/include/wpi/nt/ProtobufTopic.hpp +++ b/ntcore/src/main/native/include/wpi/nt/ProtobufTopic.hpp @@ -195,7 +195,8 @@ class ProtobufPublisher : public Publisher { * @param handle Native handle * @param msg Protobuf message */ - explicit ProtobufPublisher(NT_Publisher handle, wpi::util::ProtobufMessage msg) + explicit ProtobufPublisher(NT_Publisher handle, + wpi::util::ProtobufMessage msg) : Publisher{handle}, m_msg{std::move(msg)} {} ProtobufPublisher(const ProtobufPublisher&) = delete; @@ -294,7 +295,8 @@ class ProtobufEntry final : public ProtobufSubscriber, * @param msg Protobuf message * @param defaultValue Default value */ - ProtobufEntry(NT_Entry handle, wpi::util::ProtobufMessage msg, T defaultValue) + ProtobufEntry(NT_Entry handle, wpi::util::ProtobufMessage msg, + T defaultValue) : ProtobufSubscriber{handle, std::move(msg), std::move(defaultValue)}, ProtobufPublisher{handle, wpi::util::ProtobufMessage{}} {} @@ -378,8 +380,8 @@ class ProtobufTopic final : public Topic { wpi::util::ProtobufMessage msg; auto typeString = msg.GetTypeString(); return ProtobufSubscriber{ - ::wpi::nt::Subscribe(m_handle, NT_RAW, typeString, options), std::move(msg), - std::move(defaultValue)}; + ::wpi::nt::Subscribe(m_handle, NT_RAW, typeString, options), + std::move(msg), std::move(defaultValue)}; } /** @@ -402,7 +404,8 @@ class ProtobufTopic final : public Topic { wpi::util::ProtobufMessage msg; auto typeString = msg.GetTypeString(); return ProtobufPublisher{ - ::wpi::nt::Publish(m_handle, NT_RAW, typeString, options), std::move(msg)}; + ::wpi::nt::Publish(m_handle, NT_RAW, typeString, options), + std::move(msg)}; } /** @@ -459,8 +462,8 @@ class ProtobufTopic final : public Topic { wpi::util::ProtobufMessage msg; auto typeString = msg.GetTypeString(); return ProtobufEntry{ - ::wpi::nt::GetEntry(m_handle, NT_RAW, typeString, options), std::move(msg), - std::move(defaultValue)}; + ::wpi::nt::GetEntry(m_handle, NT_RAW, typeString, options), + std::move(msg), std::move(defaultValue)}; } }; diff --git a/ntcore/src/main/native/include/wpi/nt/StructTopic.hpp b/ntcore/src/main/native/include/wpi/nt/StructTopic.hpp index ee7d22a470..363f7092a1 100644 --- a/ntcore/src/main/native/include/wpi/nt/StructTopic.hpp +++ b/ntcore/src/main/native/include/wpi/nt/StructTopic.hpp @@ -171,8 +171,8 @@ class StructSubscriber : public Subscriber { TopicType GetTopic() const { return std::apply( [&](const I&... info) { - return StructTopic{::wpi::nt::GetTopicFromHandle(m_subHandle), - info...}; + return StructTopic{ + ::wpi::nt::GetTopicFromHandle(m_subHandle), info...}; }, m_info); } @@ -293,8 +293,8 @@ class StructPublisher : public Publisher { TopicType GetTopic() const { return std::apply( [&](const I&... info) { - return StructTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle), - info...}; + return StructTopic{ + ::wpi::nt::GetTopicFromHandle(m_pubHandle), info...}; }, m_info); } @@ -420,9 +420,9 @@ class StructTopic final : public Topic { return std::apply( [&](const I&... info) { return StructSubscriber{ - ::wpi::nt::Subscribe(m_handle, NT_RAW, - wpi::util::GetStructTypeString(info...), - options), + ::wpi::nt::Subscribe( + m_handle, NT_RAW, + wpi::util::GetStructTypeString(info...), options), std::move(defaultValue), info...}; }, m_info); @@ -448,9 +448,9 @@ class StructTopic final : public Topic { return std::apply( [&](const I&... info) { return StructPublisher{ - ::wpi::nt::Publish(m_handle, NT_RAW, - wpi::util::GetStructTypeString(info...), - options), + ::wpi::nt::Publish( + m_handle, NT_RAW, + wpi::util::GetStructTypeString(info...), options), info...}; }, m_info); @@ -480,9 +480,10 @@ class StructTopic final : public Topic { return std::apply( [&](const I&... info) { return StructPublisher{ - ::wpi::nt::PublishEx(m_handle, NT_RAW, - wpi::util::GetStructTypeString(info...), - properties, options), + ::wpi::nt::PublishEx( + m_handle, NT_RAW, + wpi::util::GetStructTypeString(info...), properties, + options), info...}; }, m_info); @@ -514,9 +515,9 @@ class StructTopic final : public Topic { return std::apply( [&](const I&... info) { return StructEntry{ - ::wpi::nt::GetEntry(m_handle, NT_RAW, - wpi::util::GetStructTypeString(info...), - options), + ::wpi::nt::GetEntry( + m_handle, NT_RAW, + wpi::util::GetStructTypeString(info...), options), std::move(defaultValue), info...}; }, m_info); diff --git a/ntcore/src/main/native/include/wpi/nt/UnitTopic.hpp b/ntcore/src/main/native/include/wpi/nt/UnitTopic.hpp index cc9d99acea..b113e56056 100644 --- a/ntcore/src/main/native/include/wpi/nt/UnitTopic.hpp +++ b/ntcore/src/main/native/include/wpi/nt/UnitTopic.hpp @@ -107,7 +107,8 @@ class UnitSubscriber : public Subscriber { * @return timestamped value */ TimestampedValueType GetAtomic(ParamType defaultValue) const { - auto doubleVal = ::wpi::nt::GetAtomicDouble(m_subHandle, defaultValue.value()); + auto doubleVal = + ::wpi::nt::GetAtomicDouble(m_subHandle, defaultValue.value()); return {doubleVal.time, doubleVal.serverTime, doubleVal.value}; } @@ -320,7 +321,8 @@ class UnitTopic final : public Topic { ParamType defaultValue, const PubSubOptions& options = kDefaultPubSubOptions) { return UnitSubscriber{ - ::wpi::nt::Subscribe(m_handle, NT_DOUBLE, "double", options), defaultValue}; + ::wpi::nt::Subscribe(m_handle, NT_DOUBLE, "double", options), + defaultValue}; } /** @@ -365,8 +367,8 @@ class UnitTopic final : public Topic { */ [[nodiscard]] PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) { - return UnitPublisher{::wpi::nt::PublishEx(m_handle, NT_DOUBLE, "double", - {{"unit", T{}.name()}}, options)}; + return UnitPublisher{::wpi::nt::PublishEx( + m_handle, NT_DOUBLE, "double", {{"unit", T{}.name()}}, options)}; } /** @@ -420,8 +422,9 @@ class UnitTopic final : public Topic { [[nodiscard]] EntryType GetEntry(ParamType defaultValue, const PubSubOptions& options = kDefaultPubSubOptions) { - return UnitEntry{::wpi::nt::GetEntry(m_handle, NT_DOUBLE, "double", options), - defaultValue}; + return UnitEntry{ + ::wpi::nt::GetEntry(m_handle, NT_DOUBLE, "double", options), + defaultValue}; } /** @@ -449,7 +452,8 @@ class UnitTopic final : public Topic { EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue, const PubSubOptions& options = kDefaultPubSubOptions) { return UnitEntry{ - ::wpi::nt::GetEntry(m_handle, NT_DOUBLE, typeString, options), defaultValue}; + ::wpi::nt::GetEntry(m_handle, NT_DOUBLE, typeString, options), + defaultValue}; } }; diff --git a/ntcore/src/main/native/include/wpi/nt/ntcore_cpp.hpp b/ntcore/src/main/native/include/wpi/nt/ntcore_cpp.hpp index 64b3d6ac82..be28f7965b 100644 --- a/ntcore/src/main/native/include/wpi/nt/ntcore_cpp.hpp +++ b/ntcore/src/main/native/include/wpi/nt/ntcore_cpp.hpp @@ -25,7 +25,7 @@ namespace wpi::util { template class SmallVectorImpl; -} // namespace wpi +} // namespace wpi::util namespace wpi::log { class DataLog; diff --git a/ntcore/src/test/native/cpp/ConnectionListenerTest.cpp b/ntcore/src/test/native/cpp/ConnectionListenerTest.cpp index 209601f563..31b9515573 100644 --- a/ntcore/src/test/native/cpp/ConnectionListenerTest.cpp +++ b/ntcore/src/test/native/cpp/ConnectionListenerTest.cpp @@ -16,7 +16,8 @@ class ConnectionListenerTest : public ::testing::Test { public: ConnectionListenerTest() - : server_inst(wpi::nt::CreateInstance()), client_inst(wpi::nt::CreateInstance()) {} + : server_inst(wpi::nt::CreateInstance()), + client_inst(wpi::nt::CreateInstance()) {} ~ConnectionListenerTest() override { wpi::nt::DestroyInstance(server_inst); @@ -31,7 +32,8 @@ class ConnectionListenerTest : public ::testing::Test { }; void ConnectionListenerTest::Connect(const char* address, unsigned int port4) { - wpi::nt::StartServer(server_inst, "connectionlistenertest.ini", address, port4); + wpi::nt::StartServer(server_inst, "connectionlistenertest.ini", address, + port4); wpi::nt::StartClient(client_inst, "client"); wpi::nt::SetServer(client_inst, address, port4); @@ -50,8 +52,8 @@ TEST_F(ConnectionListenerTest, Polled) { // set up the poller NT_ListenerPoller poller = wpi::nt::CreateListenerPoller(server_inst); ASSERT_NE(poller, 0u); - NT_Listener handle = - wpi::nt::AddPolledListener(poller, server_inst, wpi::nt::EventFlags::kConnection); + NT_Listener handle = wpi::nt::AddPolledListener( + poller, server_inst, wpi::nt::EventFlags::kConnection); ASSERT_NE(handle, 0u); // trigger a connect event @@ -89,11 +91,11 @@ class ConnectionListenerVariantTest TEST_P(ConnectionListenerVariantTest, Threaded) { wpi::util::mutex m; std::vector result; - auto handle = wpi::nt::AddListener(server_inst, wpi::nt::EventFlags::kConnection, - [&](auto& event) { - std::scoped_lock lock{m}; - result.push_back(event); - }); + auto handle = wpi::nt::AddListener( + server_inst, wpi::nt::EventFlags::kConnection, [&](auto& event) { + std::scoped_lock lock{m}; + result.push_back(event); + }); // trigger a connect event Connect(GetParam().first, 20001 + GetParam().second); diff --git a/ntcore/src/test/native/cpp/LocalStorageTest.cpp b/ntcore/src/test/native/cpp/LocalStorageTest.cpp index bae92b07f8..80275ae6c6 100644 --- a/ntcore/src/test/native/cpp/LocalStorageTest.cpp +++ b/ntcore/src/test/native/cpp/LocalStorageTest.cpp @@ -80,8 +80,9 @@ TEST_F(LocalStorageTest, GetEntryEmptyName) { } TEST_F(LocalStorageTest, GetEntryCached) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"tocache"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"tocache"}}), + IsDefaultPubSubOptions())); auto entry1 = storage.GetEntry("tocache"); EXPECT_EQ(entry1, storage.GetEntry("tocache")); @@ -110,7 +111,8 @@ TEST_F(LocalStorageTest, DefaultProps) { network, ClientPublish(_, std::string_view{"foo"}, std::string_view{"boolean"}, wpi::util::json::object(), IsDefaultPubSubOptions())); - storage.Publish(fooTopic, NT_BOOLEAN, "boolean", wpi::util::json::object(), {}); + storage.Publish(fooTopic, NT_BOOLEAN, "boolean", wpi::util::json::object(), + {}); EXPECT_FALSE(storage.GetTopicPersistent(fooTopic)); EXPECT_FALSE(storage.GetTopicRetained(fooTopic)); @@ -122,7 +124,8 @@ TEST_F(LocalStorageTest, PublishNewNoProps) { network, ClientPublish(_, std::string_view{"foo"}, std::string_view{"boolean"}, wpi::util::json::object(), IsDefaultPubSubOptions())); - storage.Publish(fooTopic, NT_BOOLEAN, "boolean", wpi::util::json::object(), {}); + storage.Publish(fooTopic, NT_BOOLEAN, "boolean", wpi::util::json::object(), + {}); auto info = storage.GetTopicInfo(fooTopic); EXPECT_EQ(info.properties, "{}"); @@ -159,8 +162,9 @@ TEST_F(LocalStorageTest, PublishNew) { } TEST_F(LocalStorageTest, SubscribeNoTypeLocalPubPost) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto sub = storage.Subscribe(fooTopic, NT_UNASSIGNED, "", {}); EXPECT_CALL( @@ -206,8 +210,9 @@ TEST_F(LocalStorageTest, SubscribeNoTypeLocalPubPre) { EXPECT_CALL(network, ClientSetValue(Handle{pub}.GetIndex(), val)); storage.SetEntryValue(pub, val); - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto sub = storage.Subscribe(fooTopic, NT_UNASSIGNED, "", {}); EXPECT_EQ(storage.GetTopicType(fooTopic), NT_BOOLEAN); @@ -221,8 +226,9 @@ TEST_F(LocalStorageTest, SubscribeNoTypeLocalPubPre) { } TEST_F(LocalStorageTest, EntryNoTypeLocalSet) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto entry = storage.GetEntry(fooTopic, NT_UNASSIGNED, "", {}); // results in a publish and value set @@ -268,8 +274,9 @@ TEST_F(LocalStorageTest, EntryNoTypeLocalSet) { } TEST_F(LocalStorageTest, PubUnpubPub) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto sub = storage.Subscribe(fooTopic, NT_INTEGER, "int", {}); EXPECT_CALL( @@ -300,9 +307,10 @@ TEST_F(LocalStorageTest, PubUnpubPub) { EXPECT_EQ(storage.GetTopicTypeString(fooTopic), ""); EXPECT_FALSE(storage.GetTopicExists(fooTopic)); - EXPECT_CALL(network, - ClientPublish(_, std::string_view{"foo"}, std::string_view{"int"}, - wpi::util::json::object(), IsDefaultPubSubOptions())); + EXPECT_CALL( + network, + ClientPublish(_, std::string_view{"foo"}, std::string_view{"int"}, + wpi::util::json::object(), IsDefaultPubSubOptions())); pub = storage.Publish(fooTopic, NT_INTEGER, "int", {}, {}); val = Value::MakeInteger(3, 5); @@ -341,9 +349,10 @@ TEST_F(LocalStorageTest, LocalPubConflict) { // unpublishing pub1 will publish pub2 to the network EXPECT_CALL(network, ClientUnpublish(Handle{pub1}.GetIndex())); - EXPECT_CALL(network, - ClientPublish(_, std::string_view{"foo"}, std::string_view{"int"}, - wpi::util::json::object(), IsDefaultPubSubOptions())); + EXPECT_CALL( + network, + ClientPublish(_, std::string_view{"foo"}, std::string_view{"int"}, + wpi::util::json::object(), IsDefaultPubSubOptions())); storage.Unpublish(pub1); EXPECT_EQ(storage.GetTopicType(fooTopic), NT_INTEGER); @@ -363,8 +372,9 @@ TEST_F(LocalStorageTest, LocalSubConflict) { wpi::util::json::object(), IsDefaultPubSubOptions())); storage.Publish(fooTopic, NT_BOOLEAN, "boolean", {}, {}); - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); EXPECT_CALL(logger, Call(NT_LOG_INFO, _, _, std::string_view{ @@ -409,15 +419,17 @@ TEST_F(LocalStorageTest, RemotePubConflict) { TEST_F(LocalStorageTest, SubNonExist) { // makes sure no warning is emitted - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); storage.Subscribe(fooTopic, NT_BOOLEAN, "boolean", {}); } TEST_F(LocalStorageTest, SetDefaultSubscribe) { // no publish, no value on wire, this is just handled locally - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto sub = storage.Subscribe(fooTopic, NT_BOOLEAN, "boolean", {}); EXPECT_TRUE(storage.SetDefaultEntryValue(sub, Value::MakeBoolean(true))); auto val = storage.GetEntryValue(sub); @@ -447,8 +459,9 @@ TEST_F(LocalStorageTest, SetDefaultPublish) { } TEST_F(LocalStorageTest, SetDefaultEntry) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto entry = storage.GetEntry(fooTopic, NT_BOOLEAN, "boolean", {}); // expect a publish and value @@ -467,8 +480,9 @@ TEST_F(LocalStorageTest, SetDefaultEntry) { } TEST_F(LocalStorageTest, SetDefaultEntryUnassigned) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto entry = storage.GetEntry(fooTopic, NT_UNASSIGNED, "", {}); // expect a publish and value @@ -509,8 +523,9 @@ TEST_F(LocalStorageTest, SetValueEmptyValue) { } TEST_F(LocalStorageTest, SetValueEmptyUntypedEntry) { - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsDefaultPubSubOptions())); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsDefaultPubSubOptions())); auto entry = storage.GetEntry(fooTopic, NT_UNASSIGNED, "", {}); EXPECT_FALSE(storage.SetEntryValue(entry, {})); } @@ -553,8 +568,9 @@ void LocalStorageDuplicatesTest::SetupPubSub(bool keepPub, bool keepSub) { PubSubOptionsImpl subOptions; subOptions.pollStorage = 10; subOptions.keepDuplicates = keepSub; - EXPECT_CALL(network, ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), - IsPubSubOptions(subOptions))); + EXPECT_CALL(network, + ClientSubscribe(_, wpi::util::SpanEq({std::string{"foo"}}), + IsPubSubOptions(subOptions))); sub = storage.Subscribe(fooTopic, NT_DOUBLE, "double", {.pollStorage = 10, .keepDuplicates = keepSub}); } @@ -942,8 +958,8 @@ TEST_F(LocalStorageTest, MultiSubSpecial) { TEST_F(LocalStorageTest, NetworkDuplicateDetect) { EXPECT_CALL(network, ClientPublish(_, _, _, _, _)); auto pub = storage.Publish(fooTopic, NT_DOUBLE, "double", {}, {}); - auto remoteTopic = storage.ServerAnnounce("foo", 0, "double", - wpi::util::json::object(), std::nullopt); + auto remoteTopic = storage.ServerAnnounce( + "foo", 0, "double", wpi::util::json::object(), std::nullopt); // local set EXPECT_CALL(network, ClientSetValue(_, _)); @@ -968,8 +984,8 @@ TEST_F(LocalStorageTest, ReadQueueLocalRemote) { auto subRemote = storage.Subscribe(fooTopic, NT_DOUBLE, "double", {.disableLocal = true}); auto pub = storage.Publish(fooTopic, NT_DOUBLE, "double", {}, {}); - auto remoteTopic = storage.ServerAnnounce("foo", 0, "double", - wpi::util::json::object(), std::nullopt); + auto remoteTopic = storage.ServerAnnounce( + "foo", 0, "double", wpi::util::json::object(), std::nullopt); // local set EXPECT_CALL(network, ClientSetValue(_, _)); @@ -997,8 +1013,8 @@ TEST_F(LocalStorageTest, SubExcludePub) { auto subActive = storage.Subscribe(fooTopic, NT_DOUBLE, "double", {}); auto subExclude = storage.Subscribe(fooTopic, NT_DOUBLE, "double", {.excludePublisher = pub}); - auto remoteTopic = storage.ServerAnnounce("foo", 0, "double", - wpi::util::json::object(), std::nullopt); + auto remoteTopic = storage.ServerAnnounce( + "foo", 0, "double", wpi::util::json::object(), std::nullopt); // local set EXPECT_CALL(network, ClientSetValue(_, _)); @@ -1020,8 +1036,8 @@ TEST_F(LocalStorageTest, EntryExcludeSelf) { auto entry = storage.GetEntry(fooTopic, NT_DOUBLE, "double", {.excludeSelf = true}); - auto remoteTopic = storage.ServerAnnounce("foo", 0, "double", - wpi::util::json::object(), std::nullopt); + auto remoteTopic = storage.ServerAnnounce( + "foo", 0, "double", wpi::util::json::object(), std::nullopt); // local set EXPECT_CALL(network, ClientPublish(_, _, _, _, _)); @@ -1060,8 +1076,8 @@ TEST_F(LocalStorageTest, ReadQueueInitialLocal) { TEST_F(LocalStorageTest, ReadQueueInitialRemote) { EXPECT_CALL(network, ClientSubscribe(_, _, _)).Times(3); - auto remoteTopic = storage.ServerAnnounce("foo", 0, "double", - wpi::util::json::object(), std::nullopt); + auto remoteTopic = storage.ServerAnnounce( + "foo", 0, "double", wpi::util::json::object(), std::nullopt); storage.ServerSetValue(remoteTopic, Value::MakeDouble(2.0, 60)); auto subBoth = diff --git a/ntcore/src/test/native/cpp/LoggerTest.cpp b/ntcore/src/test/native/cpp/LoggerTest.cpp index 9a7fc19382..ae7bd61065 100644 --- a/ntcore/src/test/native/cpp/LoggerTest.cpp +++ b/ntcore/src/test/native/cpp/LoggerTest.cpp @@ -30,12 +30,13 @@ void LoggerTest::Generate() { wpi::nt::StartClient(m_inst, ""); // generate error message - wpi::nt::Publish(wpi::nt::Handle(wpi::nt::Handle{m_inst}.GetInst(), 5, wpi::nt::Handle::kTopic), - NT_DOUBLE, ""); + wpi::nt::Publish(wpi::nt::Handle(wpi::nt::Handle{m_inst}.GetInst(), 5, + wpi::nt::Handle::kTopic), + NT_DOUBLE, ""); } -void LoggerTest::Check(const std::vector& events, NT_Listener handle, - bool infoMsg, bool errMsg) { +void LoggerTest::Check(const std::vector& events, + NT_Listener handle, bool infoMsg, bool errMsg) { size_t count = (infoMsg ? 1u : 0u) + (errMsg ? 1u : 0u); ASSERT_EQ(events.size(), count); for (size_t i = 0; i < count; ++i) { @@ -59,8 +60,8 @@ void LoggerTest::Check(const std::vector& events, NT_Listener ha TEST_F(LoggerTest, DefaultLogRange) { auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto handle = - wpi::nt::AddPolledListener(poller, m_inst, wpi::nt::EventFlags::kLogMessage); + auto handle = wpi::nt::AddPolledListener(poller, m_inst, + wpi::nt::EventFlags::kLogMessage); Generate(); diff --git a/ntcore/src/test/native/cpp/NetworkTableTest.cpp b/ntcore/src/test/native/cpp/NetworkTableTest.cpp index 3b3fd0371d..0076978928 100644 --- a/ntcore/src/test/native/cpp/NetworkTableTest.cpp +++ b/ntcore/src/test/native/cpp/NetworkTableTest.cpp @@ -15,14 +15,16 @@ class NetworkTableTest : public ::testing::Test {}; TEST_F(NetworkTableTest, BasenameKey) { EXPECT_EQ("simple", wpi::nt::NetworkTable::BasenameKey("simple")); - EXPECT_EQ("simple", wpi::nt::NetworkTable::BasenameKey("one/two/many/simple")); EXPECT_EQ("simple", - wpi::nt::NetworkTable::BasenameKey("//////an/////awful/key////simple")); + wpi::nt::NetworkTable::BasenameKey("one/two/many/simple")); + EXPECT_EQ("simple", wpi::nt::NetworkTable::BasenameKey( + "//////an/////awful/key////simple")); } TEST_F(NetworkTableTest, NormalizeKeySlash) { EXPECT_EQ("/", wpi::nt::NetworkTable::NormalizeKey("///")); - EXPECT_EQ("/no/normal/req", wpi::nt::NetworkTable::NormalizeKey("/no/normal/req")); + EXPECT_EQ("/no/normal/req", + wpi::nt::NetworkTable::NormalizeKey("/no/normal/req")); EXPECT_EQ("/no/leading/slash", wpi::nt::NetworkTable::NormalizeKey("no/leading/slash")); EXPECT_EQ("/what/an/awful/key/", wpi::nt::NetworkTable::NormalizeKey( @@ -37,8 +39,8 @@ TEST_F(NetworkTableTest, NormalizeKeyNoSlash) { EXPECT_EQ("no/leading/slash", wpi::nt::NetworkTable::NormalizeKey("no/leading/slash", false)); EXPECT_EQ("what/an/awful/key/", - wpi::nt::NetworkTable::NormalizeKey("//////what////an/awful/////key///", - false)); + wpi::nt::NetworkTable::NormalizeKey( + "//////what////an/awful/////key///", false)); } TEST_F(NetworkTableTest, GetHierarchyEmpty) { diff --git a/ntcore/src/test/native/cpp/StructTest.cpp b/ntcore/src/test/native/cpp/StructTest.cpp index b263c09fff..2271a079b9 100644 --- a/ntcore/src/test/native/cpp/StructTest.cpp +++ b/ntcore/src/test/native/cpp/StructTest.cpp @@ -63,7 +63,9 @@ struct wpi::util::Struct { template <> struct wpi::util::Struct { static constexpr std::string_view GetTypeName() { return "Outer"; } - static constexpr size_t GetSize() { return wpi::util::GetStructSize() + 4; } + static constexpr size_t GetSize() { + return wpi::util::GetStructSize() + 4; + } static constexpr std::string_view GetSchema() { return "Inner inner; int32 c"; } @@ -283,7 +285,8 @@ TEST_F(StructTest, OuterNonconstexpr) { } TEST_F(StructTest, InnerArrayConstexpr) { - wpi::nt::StructArrayTopic topic = inst.GetStructArrayTopic("innerA"); + wpi::nt::StructArrayTopic topic = + inst.GetStructArrayTopic("innerA"); wpi::nt::StructArrayPublisher pub = topic.Publish(); wpi::nt::StructArraySubscriber sub = topic.Subscribe({}); @@ -353,7 +356,8 @@ TEST_F(StructTest, StructA) { } TEST_F(StructTest, StructArrayA) { - wpi::nt::StructArrayTopic topic = inst.GetStructArrayTopic("a"); + wpi::nt::StructArrayTopic topic = + inst.GetStructArrayTopic("a"); wpi::nt::StructArrayPublisher pub = topic.Publish(); wpi::nt::StructArrayPublisher pub2 = topic.PublishEx({{}}); wpi::nt::StructArraySubscriber sub = topic.Subscribe({}); @@ -433,7 +437,8 @@ TEST_F(StructTest, StructFixedArrayB) { wpi::nt::StructPublisher, Info1> pub = topic.Publish(); wpi::nt::StructPublisher, Info1> pub2 = topic.PublishEx({{}}); - wpi::nt::StructSubscriber, Info1> sub = topic.Subscribe({}); + wpi::nt::StructSubscriber, Info1> sub = + topic.Subscribe({}); wpi::nt::StructEntry, Info1> entry = topic.GetEntry({}); std::array arr; pub.SetDefault(arr); diff --git a/ntcore/src/test/native/cpp/TableListenerTest.cpp b/ntcore/src/test/native/cpp/TableListenerTest.cpp index 09f95baae3..04972d1dce 100644 --- a/ntcore/src/test/native/cpp/TableListenerTest.cpp +++ b/ntcore/src/test/native/cpp/TableListenerTest.cpp @@ -15,16 +15,19 @@ using ::testing::_; using MockTableEventListener = testing::MockFunction; -using MockSubTableListener = - testing::MockFunction table)>; + wpi::nt::NetworkTable* table, std::string_view key, + const wpi::nt::Event& event)>; +using MockSubTableListener = testing::MockFunction table)>; class TableListenerTest : public ::testing::Test { public: TableListenerTest() : m_inst(wpi::nt::NetworkTableInstance::Create()) {} - ~TableListenerTest() override { wpi::nt::NetworkTableInstance::Destroy(m_inst); } + ~TableListenerTest() override { + wpi::nt::NetworkTableInstance::Destroy(m_inst); + } void PublishTopics(); diff --git a/ntcore/src/test/native/cpp/TopicListenerTest.cpp b/ntcore/src/test/native/cpp/TopicListenerTest.cpp index c512fb1f01..6d209bfc25 100644 --- a/ntcore/src/test/native/cpp/TopicListenerTest.cpp +++ b/ntcore/src/test/native/cpp/TopicListenerTest.cpp @@ -19,7 +19,8 @@ class TopicListenerTest : public ::testing::Test { public: TopicListenerTest() - : m_serverInst(wpi::nt::CreateInstance()), m_clientInst(wpi::nt::CreateInstance()) { + : m_serverInst(wpi::nt::CreateInstance()), + m_clientInst(wpi::nt::CreateInstance()) { #if 0 wpi::nt::AddLogger(m_serverInst, 0, UINT_MAX, [](auto& event) { if (auto msg = event.GetLogMessage()) { @@ -41,8 +42,9 @@ class TopicListenerTest : public ::testing::Test { void Connect(unsigned int port); static void PublishTopics(NT_Inst inst); - void CheckEvents(const std::vector& events, NT_Listener handle, - unsigned int flags, std::string_view topicName = "/foo/bar"); + void CheckEvents(const std::vector& events, + NT_Listener handle, unsigned int flags, + std::string_view topicName = "/foo/bar"); protected: NT_Inst m_serverInst; @@ -50,13 +52,15 @@ class TopicListenerTest : public ::testing::Test { }; void TopicListenerTest::Connect(unsigned int port) { - wpi::nt::StartServer(m_serverInst, "topiclistenertest.json", "127.0.0.1", port); + wpi::nt::StartServer(m_serverInst, "topiclistenertest.json", "127.0.0.1", + port); wpi::nt::StartClient(m_clientInst, "client"); wpi::nt::SetServer(m_clientInst, "127.0.0.1", port); // Use connection listener to ensure we've connected NT_ListenerPoller poller = wpi::nt::CreateListenerPoller(m_clientInst); - wpi::nt::AddPolledListener(poller, m_clientInst, wpi::nt::EventFlags::kConnected); + wpi::nt::AddPolledListener(poller, m_clientInst, + wpi::nt::EventFlags::kConnected); bool timedOut = false; if (!wpi::util::WaitForObject(poller, 1.0, &timedOut)) { FAIL() << "client didn't connect to server"; @@ -84,7 +88,8 @@ void TopicListenerTest::CheckEvents(const std::vector& events, TEST_F(TopicListenerTest, TopicNewLocal) { auto poller = wpi::nt::CreateListenerPoller(m_serverInst); auto handle = wpi::nt::AddPolledListener( - poller, wpi::nt::GetTopic(m_serverInst, "/foo"), wpi::nt::EventFlags::kPublish); + poller, wpi::nt::GetTopic(m_serverInst, "/foo"), + wpi::nt::EventFlags::kPublish); PublishTopics(m_serverInst); @@ -101,7 +106,8 @@ TEST_F(TopicListenerTest, DISABLED_TopicNewRemote) { } auto poller = wpi::nt::CreateListenerPoller(m_serverInst); auto handle = wpi::nt::AddPolledListener( - poller, wpi::nt::GetTopic(m_serverInst, "/foo"), wpi::nt::EventFlags::kPublish); + poller, wpi::nt::GetTopic(m_serverInst, "/foo"), + wpi::nt::EventFlags::kPublish); PublishTopics(m_clientInst); @@ -126,7 +132,8 @@ TEST_F(TopicListenerTest, TopicPublishImm) { ASSERT_TRUE(wpi::util::WaitForObject(poller, 1.0, &timedOut)); auto events = wpi::nt::ReadListenerQueue(poller); CheckEvents(events, handle, - wpi::nt::EventFlags::kPublish | wpi::nt::EventFlags::kImmediate, "/foo"); + wpi::nt::EventFlags::kPublish | wpi::nt::EventFlags::kImmediate, + "/foo"); } TEST_F(TopicListenerTest, TopicUnpublishPropsImm) { @@ -134,9 +141,9 @@ TEST_F(TopicListenerTest, TopicUnpublishPropsImm) { auto poller = wpi::nt::CreateListenerPoller(m_serverInst); wpi::nt::AddPolledListener(poller, wpi::nt::GetTopic(m_serverInst, "/foo"), - wpi::nt::EventFlags::kUnpublish | - wpi::nt::EventFlags::kProperties | - wpi::nt::EventFlags::kImmediate); + wpi::nt::EventFlags::kUnpublish | + wpi::nt::EventFlags::kProperties | + wpi::nt::EventFlags::kImmediate); bool timedOut = false; ASSERT_FALSE(wpi::util::WaitForObject(poller, 0.02, &timedOut)); @@ -148,8 +155,8 @@ TEST_F(TopicListenerTest, TopicUnpublishLocal) { auto topic = wpi::nt::GetTopic(m_serverInst, "/foo"); auto poller = wpi::nt::CreateListenerPoller(m_serverInst); - auto handle = - wpi::nt::AddPolledListener(poller, topic, wpi::nt::EventFlags::kUnpublish); + auto handle = wpi::nt::AddPolledListener(poller, topic, + wpi::nt::EventFlags::kUnpublish); auto pub = wpi::nt::Publish(topic, NT_DOUBLE, "double"); wpi::nt::Unpublish(pub); @@ -167,10 +174,11 @@ TEST_F(TopicListenerTest, DISABLED_TopicUnpublishRemote) { } auto poller = wpi::nt::CreateListenerPoller(m_serverInst); auto handle = wpi::nt::AddPolledListener( - poller, wpi::nt::GetTopic(m_serverInst, "/foo"), wpi::nt::EventFlags::kUnpublish); + poller, wpi::nt::GetTopic(m_serverInst, "/foo"), + wpi::nt::EventFlags::kUnpublish); - auto pub = - wpi::nt::Publish(wpi::nt::GetTopic(m_clientInst, "/foo"), NT_DOUBLE, "double"); + auto pub = wpi::nt::Publish(wpi::nt::GetTopic(m_clientInst, "/foo"), + NT_DOUBLE, "double"); wpi::nt::Flush(m_clientInst); std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -189,8 +197,8 @@ TEST_F(TopicListenerTest, TopicPropertiesLocal) { auto topic = wpi::nt::GetTopic(m_serverInst, "/foo"); auto poller = wpi::nt::CreateListenerPoller(m_serverInst); - auto handle = - wpi::nt::AddPolledListener(poller, topic, wpi::nt::EventFlags::kProperties); + auto handle = wpi::nt::AddPolledListener(poller, topic, + wpi::nt::EventFlags::kProperties); wpi::nt::SetTopicProperty(topic, "foo", 5); @@ -206,11 +214,13 @@ TEST_F(TopicListenerTest, DISABLED_TopicPropertiesRemote) { return; } // the topic needs to actually exist - wpi::nt::Publish(wpi::nt::GetTopic(m_serverInst, "/foo"), NT_BOOLEAN, "boolean"); + wpi::nt::Publish(wpi::nt::GetTopic(m_serverInst, "/foo"), NT_BOOLEAN, + "boolean"); auto poller = wpi::nt::CreateListenerPoller(m_serverInst); auto handle = wpi::nt::AddPolledListener( - poller, wpi::nt::GetTopic(m_serverInst, "/foo"), wpi::nt::EventFlags::kProperties); + poller, wpi::nt::GetTopic(m_serverInst, "/foo"), + wpi::nt::EventFlags::kProperties); wpi::nt::FlushLocal(m_serverInst); wpi::nt::SetTopicProperty(wpi::nt::GetTopic(m_clientInst, "/foo"), "foo", 5); @@ -225,8 +235,8 @@ TEST_F(TopicListenerTest, DISABLED_TopicPropertiesRemote) { TEST_F(TopicListenerTest, PrefixPublishLocal) { auto poller = wpi::nt::CreateListenerPoller(m_serverInst); - auto handle = - wpi::nt::AddPolledListener(poller, {{"/foo/"}}, wpi::nt::EventFlags::kPublish); + auto handle = wpi::nt::AddPolledListener(poller, {{"/foo/"}}, + wpi::nt::EventFlags::kPublish); PublishTopics(m_serverInst); @@ -242,8 +252,8 @@ TEST_F(TopicListenerTest, DISABLED_PrefixPublishRemote) { return; } auto poller = wpi::nt::CreateListenerPoller(m_serverInst); - auto handle = - wpi::nt::AddPolledListener(poller, {{"/foo/"}}, wpi::nt::EventFlags::kPublish); + auto handle = wpi::nt::AddPolledListener(poller, {{"/foo/"}}, + wpi::nt::EventFlags::kPublish); PublishTopics(m_clientInst); @@ -276,9 +286,9 @@ TEST_F(TopicListenerTest, PrefixUnpublishPropsImm) { auto poller = wpi::nt::CreateListenerPoller(m_serverInst); wpi::nt::AddPolledListener(poller, {{"/foo/"}}, - wpi::nt::EventFlags::kUnpublish | - wpi::nt::EventFlags::kProperties | - wpi::nt::EventFlags::kImmediate); + wpi::nt::EventFlags::kUnpublish | + wpi::nt::EventFlags::kProperties | + wpi::nt::EventFlags::kImmediate); bool timedOut = false; ASSERT_FALSE(wpi::util::WaitForObject(poller, 0.02, &timedOut)); diff --git a/ntcore/src/test/native/cpp/ValueListenerTest.cpp b/ntcore/src/test/native/cpp/ValueListenerTest.cpp index acf268e6bc..91d51de0e2 100644 --- a/ntcore/src/test/native/cpp/ValueListenerTest.cpp +++ b/ntcore/src/test/native/cpp/ValueListenerTest.cpp @@ -37,9 +37,12 @@ TEST_F(ValueListenerTest, MultiPollSub) { auto poller1 = wpi::nt::CreateListenerPoller(m_inst); auto poller2 = wpi::nt::CreateListenerPoller(m_inst); auto poller3 = wpi::nt::CreateListenerPoller(m_inst); - auto h1 = wpi::nt::AddPolledListener(poller1, sub, wpi::nt::EventFlags::kValueLocal); - auto h2 = wpi::nt::AddPolledListener(poller2, sub, wpi::nt::EventFlags::kValueLocal); - auto h3 = wpi::nt::AddPolledListener(poller3, sub, wpi::nt::EventFlags::kValueLocal); + auto h1 = wpi::nt::AddPolledListener(poller1, sub, + wpi::nt::EventFlags::kValueLocal); + auto h2 = wpi::nt::AddPolledListener(poller2, sub, + wpi::nt::EventFlags::kValueLocal); + auto h3 = wpi::nt::AddPolledListener(poller3, sub, + wpi::nt::EventFlags::kValueLocal); wpi::nt::SetDouble(pub, 0); @@ -89,8 +92,10 @@ TEST_F(ValueListenerTest, PollMultiSub) { auto sub2 = wpi::nt::Subscribe(topic, NT_DOUBLE, "double"); auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h1 = wpi::nt::AddPolledListener(poller, sub1, wpi::nt::EventFlags::kValueLocal); - auto h2 = wpi::nt::AddPolledListener(poller, sub2, wpi::nt::EventFlags::kValueLocal); + auto h1 = wpi::nt::AddPolledListener(poller, sub1, + wpi::nt::EventFlags::kValueLocal); + auto h2 = wpi::nt::AddPolledListener(poller, sub2, + wpi::nt::EventFlags::kValueLocal); wpi::nt::SetDouble(pub, 0); @@ -126,8 +131,10 @@ TEST_F(ValueListenerTest, PollMultiSubTopic) { auto sub2 = wpi::nt::Subscribe(topic2, NT_DOUBLE, "double"); auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h1 = wpi::nt::AddPolledListener(poller, sub1, wpi::nt::EventFlags::kValueLocal); - auto h2 = wpi::nt::AddPolledListener(poller, sub2, wpi::nt::EventFlags::kValueLocal); + auto h1 = wpi::nt::AddPolledListener(poller, sub1, + wpi::nt::EventFlags::kValueLocal); + auto h2 = wpi::nt::AddPolledListener(poller, sub2, + wpi::nt::EventFlags::kValueLocal); wpi::nt::SetDouble(pub1, 0); wpi::nt::SetDouble(pub2, 1); @@ -163,7 +170,8 @@ TEST_F(ValueListenerTest, PollSubMultiple) { auto sub = wpi::nt::SubscribeMultiple(m_inst, {{"foo"}}); auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h = wpi::nt::AddPolledListener(poller, sub, wpi::nt::EventFlags::kValueLocal); + auto h = + wpi::nt::AddPolledListener(poller, sub, wpi::nt::EventFlags::kValueLocal); wpi::nt::SetDouble(pub1, 0); wpi::nt::SetDouble(pub2, 1); @@ -193,8 +201,8 @@ TEST_F(ValueListenerTest, PollSubMultiple) { TEST_F(ValueListenerTest, PollSubPrefixCreated) { auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h = - wpi::nt::AddPolledListener(poller, {{"foo"}}, wpi::nt::EventFlags::kValueLocal); + auto h = wpi::nt::AddPolledListener(poller, {{"foo"}}, + wpi::nt::EventFlags::kValueLocal); auto topic1 = wpi::nt::GetTopic(m_inst, "foo/1"); auto topic2 = wpi::nt::GetTopic(m_inst, "foo/2"); @@ -232,7 +240,8 @@ TEST_F(ValueListenerTest, PollEntry) { auto entry = wpi::nt::GetEntry(m_inst, "foo"); auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h = wpi::nt::AddPolledListener(poller, entry, wpi::nt::EventFlags::kValueLocal); + auto h = wpi::nt::AddPolledListener(poller, entry, + wpi::nt::EventFlags::kValueLocal); ASSERT_TRUE(wpi::nt::SetDouble(entry, 0)); @@ -257,7 +266,8 @@ TEST_F(ValueListenerTest, PollImmediate) { auto poller = wpi::nt::CreateListenerPoller(m_inst); auto h = wpi::nt::AddPolledListener( - poller, entry, wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); + poller, entry, + wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); bool timedOut = false; ASSERT_TRUE(wpi::util::WaitForObject(poller, 1.0, &timedOut)); @@ -265,8 +275,8 @@ TEST_F(ValueListenerTest, PollImmediate) { auto results = wpi::nt::ReadListenerQueue(poller); ASSERT_EQ(results.size(), 1u); - EXPECT_EQ(results[0].flags & - (wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate), + EXPECT_EQ(results[0].flags & (wpi::nt::EventFlags::kValueLocal | + wpi::nt::EventFlags::kImmediate), wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); EXPECT_EQ(results[0].listener, h); auto valueData = results[0].GetValueEventData(); @@ -281,7 +291,8 @@ TEST_F(ValueListenerTest, PollImmediateNoValue) { auto poller = wpi::nt::CreateListenerPoller(m_inst); auto h = wpi::nt::AddPolledListener( - poller, entry, wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); + poller, entry, + wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); bool timedOut = false; ASSERT_FALSE(wpi::util::WaitForObject(poller, 0.02, &timedOut)); @@ -317,7 +328,8 @@ TEST_F(ValueListenerTest, PollImmediateSubMultiple) { auto poller = wpi::nt::CreateListenerPoller(m_inst); auto h = wpi::nt::AddPolledListener( - poller, sub, wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); + poller, sub, + wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); bool timedOut = false; ASSERT_TRUE(wpi::util::WaitForObject(poller, 1.0, &timedOut)); @@ -325,8 +337,8 @@ TEST_F(ValueListenerTest, PollImmediateSubMultiple) { auto results = wpi::nt::ReadListenerQueue(poller); ASSERT_EQ(results.size(), 2u); - EXPECT_EQ(results[0].flags & - (wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate), + EXPECT_EQ(results[0].flags & (wpi::nt::EventFlags::kValueLocal | + wpi::nt::EventFlags::kImmediate), wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); EXPECT_EQ(results[0].listener, h); auto valueData = results[0].GetValueEventData(); @@ -335,8 +347,8 @@ TEST_F(ValueListenerTest, PollImmediateSubMultiple) { EXPECT_EQ(valueData->topic, topic1); EXPECT_EQ(valueData->value, wpi::nt::Value::MakeDouble(0.0)); - EXPECT_EQ(results[1].flags & - (wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate), + EXPECT_EQ(results[1].flags & (wpi::nt::EventFlags::kValueLocal | + wpi::nt::EventFlags::kImmediate), wpi::nt::EventFlags::kValueLocal | wpi::nt::EventFlags::kImmediate); EXPECT_EQ(results[1].listener, h); valueData = results[1].GetValueEventData(); @@ -354,7 +366,8 @@ TEST_F(ValueListenerTest, TwoSubOneListener) { auto sub3 = wpi::nt::SubscribeMultiple(m_inst, {{"foo"}}); auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h = wpi::nt::AddPolledListener(poller, sub1, wpi::nt::EventFlags::kValueLocal); + auto h = wpi::nt::AddPolledListener(poller, sub1, + wpi::nt::EventFlags::kValueLocal); (void)sub2; (void)sub3; @@ -384,7 +397,8 @@ TEST_F(ValueListenerTest, TwoSubOneMultiListener) { auto sub3 = wpi::nt::SubscribeMultiple(m_inst, {{"foo"}}); auto poller = wpi::nt::CreateListenerPoller(m_inst); - auto h = wpi::nt::AddPolledListener(poller, sub3, wpi::nt::EventFlags::kValueLocal); + auto h = wpi::nt::AddPolledListener(poller, sub3, + wpi::nt::EventFlags::kValueLocal); (void)sub1; (void)sub2; diff --git a/ntcore/src/test/native/cpp/main.cpp b/ntcore/src/test/native/cpp/main.cpp index 01d1bec3ab..4cfa8ac89d 100644 --- a/ntcore/src/test/native/cpp/main.cpp +++ b/ntcore/src/test/native/cpp/main.cpp @@ -10,12 +10,13 @@ #include "wpi/util/timestamp.h" int main(int argc, char** argv) { - wpi::nt::AddLogger(wpi::nt::GetDefaultInstance(), 0, UINT_MAX, [](auto& event) { - if (auto msg = event.GetLogMessage()) { - std::fputs(msg->message.c_str(), stderr); - std::fputc('\n', stderr); - } - }); + wpi::nt::AddLogger(wpi::nt::GetDefaultInstance(), 0, UINT_MAX, + [](auto& event) { + if (auto msg = event.GetLogMessage()) { + std::fputs(msg->message.c_str(), stderr); + std::fputc('\n', stderr); + } + }); ::testing::InitGoogleMock(&argc, argv); int ret = RUN_ALL_TESTS(); return ret; diff --git a/ntcore/src/test/native/cpp/net/MockMessageHandler.hpp b/ntcore/src/test/native/cpp/net/MockMessageHandler.hpp index 8b47a37bcc..da42575ea6 100644 --- a/ntcore/src/test/native/cpp/net/MockMessageHandler.hpp +++ b/ntcore/src/test/native/cpp/net/MockMessageHandler.hpp @@ -17,11 +17,13 @@ class MockClientMessageHandler : public net::ClientMessageHandler { public: MOCK_METHOD(void, ClientPublish, (int pubuid, std::string_view name, std::string_view typeStr, - const wpi::util::json& properties, const PubSubOptionsImpl& options), + const wpi::util::json& properties, + const PubSubOptionsImpl& options), (override)); MOCK_METHOD(void, ClientUnpublish, (int pubuid), (override)); MOCK_METHOD(void, ClientSetProperties, - (std::string_view name, const wpi::util::json& update), (override)); + (std::string_view name, const wpi::util::json& update), + (override)); MOCK_METHOD(void, ClientSubscribe, (int subuid, std::span prefixes, const PubSubOptionsImpl& options), diff --git a/ntcore/src/test/native/cpp/net/MockWireConnection.hpp b/ntcore/src/test/native/cpp/net/MockWireConnection.hpp index ebb937c264..a67d59786d 100644 --- a/ntcore/src/test/native/cpp/net/MockWireConnection.hpp +++ b/ntcore/src/test/native/cpp/net/MockWireConnection.hpp @@ -25,28 +25,30 @@ class MockWireConnection : public WireConnection { MOCK_METHOD(bool, Ready, (), (const, override)); - int WriteText(wpi::util::function_ref writer) override { + int WriteText(wpi::util::function_ref + writer) override { std::string text; wpi::util::raw_string_ostream os{text}; writer(os); return DoWriteText(text); } - int WriteBinary( - wpi::util::function_ref writer) override { + int WriteBinary(wpi::util::function_ref + writer) override { std::vector binary; wpi::util::raw_uvector_ostream os{binary}; writer(os); return DoWriteBinary(binary); } - void SendText(wpi::util::function_ref writer) override { + void SendText(wpi::util::function_ref + writer) override { std::string text; wpi::util::raw_string_ostream os{text}; writer(os); DoSendText(text); } - void SendBinary( - wpi::util::function_ref writer) override { + void SendBinary(wpi::util::function_ref + writer) override { std::vector binary; wpi::util::raw_uvector_ostream os{binary}; writer(os); diff --git a/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp b/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp index 95de5b6cb1..5fa50878f4 100644 --- a/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp +++ b/ntcore/src/test/native/cpp/net/WireDecoderTest.cpp @@ -108,17 +108,19 @@ TEST_F(WireDecodeTextClientTest, ErrorUnknownMethod) { } TEST_F(WireDecodeTextClientTest, PublishPropsEmpty) { - EXPECT_CALL(handler, ClientPublish(5, std::string_view{"test"}, - std::string_view{"double"}, - wpi::util::json::object(), PubSubOptionsEq({}))); + EXPECT_CALL( + handler, + ClientPublish(5, std::string_view{"test"}, std::string_view{"double"}, + wpi::util::json::object(), PubSubOptionsEq({}))); net::WireDecodeText( "[{\"method\":\"publish\",\"params\":{" "\"name\":\"test\",\"properties\":{},\"pubuid\":5,\"type\":\"double\"}}]", handler, logger); - EXPECT_CALL(handler, ClientPublish(5, std::string_view{"test"}, - std::string_view{"double"}, - wpi::util::json::object(), PubSubOptionsEq({}))); + EXPECT_CALL( + handler, + ClientPublish(5, std::string_view{"test"}, std::string_view{"double"}, + wpi::util::json::object(), PubSubOptionsEq({}))); net::WireDecodeText( "[{\"method\":\"publish\",\"params\":{" "\"name\":\"test\",\"pubuid\":5,\"type\":\"double\"}}]", diff --git a/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp b/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp index ab49ff5981..9c2c905f31 100644 --- a/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp +++ b/ntcore/src/test/native/cpp/net/WireEncoderTest.cpp @@ -128,7 +128,8 @@ TEST_F(WireEncoderTextTest, AnnounceProperties) { } TEST_F(WireEncoderTextTest, AnnouncePubuid) { - net::WireEncodeAnnounce(os, "test", 5, "double", wpi::util::json::object(), 6); + net::WireEncodeAnnounce(os, "test", 5, "double", wpi::util::json::object(), + 6); ASSERT_EQ(os.str(), "{\"method\":\"announce\",\"params\":{\"id\":5,\"name\":\"test\"," "\"properties\":{},\"pubuid\":6,\"type\":\"double\"}}"); @@ -179,8 +180,8 @@ TEST_F(WireEncoderTextTest, MessageUnsubscribe) { } TEST_F(WireEncoderTextTest, MessageAnnounce) { - net::ServerMessage msg{ - net::AnnounceMsg{"test", 5, "double", std::nullopt, wpi::util::json::object()}}; + net::ServerMessage msg{net::AnnounceMsg{"test", 5, "double", std::nullopt, + wpi::util::json::object()}}; ASSERT_TRUE(net::WireEncodeText(os, msg)); ASSERT_EQ(os.str(), "{\"method\":\"announce\",\"params\":{\"id\":5,\"name\":\"test\"," @@ -234,14 +235,15 @@ TEST_F(WireEncoderBinaryTest, Integer) { TEST_F(WireEncoderBinaryTest, Float) { net::WireEncodeBinary(os, 5, 6, Value::MakeFloat(2.5)); - ASSERT_THAT(out, wpi::util::SpanEq("\x94\x05\x06\x03\xca\x40\x20\x00\x00"_us)); + ASSERT_THAT(out, + wpi::util::SpanEq("\x94\x05\x06\x03\xca\x40\x20\x00\x00"_us)); } TEST_F(WireEncoderBinaryTest, Double) { net::WireEncodeBinary(os, 5, 6, Value::MakeDouble(2.5)); - ASSERT_THAT( - out, - wpi::util::SpanEq("\x94\x05\x06\x01\xcb\x40\x04\x00\x00\x00\x00\x00\x00"_us)); + ASSERT_THAT(out, + wpi::util::SpanEq( + "\x94\x05\x06\x01\xcb\x40\x04\x00\x00\x00\x00\x00\x00"_us)); } TEST_F(WireEncoderBinaryTest, String) { @@ -267,23 +269,24 @@ TEST_F(WireEncoderBinaryTest, IntegerArray) { TEST_F(WireEncoderBinaryTest, FloatArray) { net::WireEncodeBinary(os, 5, 6, Value::MakeFloatArray({1, 2, 3})); ASSERT_THAT(out, wpi::util::SpanEq("\x94\x05\x06\x13\x93" - "\xca\x3f\x80\x00\x00" - "\xca\x40\x00\x00\x00" - "\xca\x40\x40\x00\x00"_us)); + "\xca\x3f\x80\x00\x00" + "\xca\x40\x00\x00\x00" + "\xca\x40\x40\x00\x00"_us)); } TEST_F(WireEncoderBinaryTest, DoubleArray) { net::WireEncodeBinary(os, 5, 6, Value::MakeDoubleArray({1, 2, 3})); - ASSERT_THAT(out, wpi::util::SpanEq("\x94\x05\x06\x11\x93" - "\xcb\x3f\xf0\x00\x00\x00\x00\x00\x00" - "\xcb\x40\x00\x00\x00\x00\x00\x00\x00" - "\xcb\x40\x08\x00\x00\x00\x00\x00\x00"_us)); + ASSERT_THAT(out, + wpi::util::SpanEq("\x94\x05\x06\x11\x93" + "\xcb\x3f\xf0\x00\x00\x00\x00\x00\x00" + "\xcb\x40\x00\x00\x00\x00\x00\x00\x00" + "\xcb\x40\x08\x00\x00\x00\x00\x00\x00"_us)); } TEST_F(WireEncoderBinaryTest, StringArray) { net::WireEncodeBinary(os, 5, 6, Value::MakeStringArray({"hello", "bye"})); ASSERT_THAT(out, wpi::util::SpanEq("\x94\x05\x06\x14\x92\xa5hello\xa3" - "bye"_us)); + "bye"_us)); } } // namespace wpi::nt diff --git a/ntcore/src/test/native/cpp/server/ServerImplTest.cpp b/ntcore/src/test/native/cpp/server/ServerImplTest.cpp index 401414699c..4df6949588 100644 --- a/ntcore/src/test/native/cpp/server/ServerImplTest.cpp +++ b/ntcore/src/test/native/cpp/server/ServerImplTest.cpp @@ -167,8 +167,8 @@ TEST_F(ServerImplTest, PublishLocal) { } { - queue.msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid, "test", "double", wpi::util::json::object(), {}}}); + queue.msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid, "test", "double", wpi::util::json::object(), {}}}); EXPECT_FALSE(server.ProcessLocalMessages(UINT_MAX)); } @@ -186,18 +186,21 @@ TEST_F(ServerImplTest, PublishLocal) { EXPECT_CALL(wire, SendPing(100)); EXPECT_CALL(wire, Ready()).WillOnce(Return(true)); // SendControl() EXPECT_CALL( - wire, DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ - "test", 3, "double", std::nullopt, wpi::util::json::object()}})))) + wire, + DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ + "test", 3, "double", std::nullopt, wpi::util::json::object()}})))) .WillOnce(Return(0)); EXPECT_CALL( - wire, DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ - "test2", 8, "double", std::nullopt, wpi::util::json::object()}})))) + wire, + DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ + "test2", 8, "double", std::nullopt, wpi::util::json::object()}})))) .WillOnce(Return(0)); EXPECT_CALL(wire, Flush()).WillOnce(Return(0)); // SendControl() EXPECT_CALL(wire, Ready()).WillOnce(Return(true)); // SendControl() EXPECT_CALL( - wire, DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ - "test3", 11, "double", std::nullopt, wpi::util::json::object()}})))) + wire, + DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ + "test3", 11, "double", std::nullopt, wpi::util::json::object()}})))) .WillOnce(Return(0)); EXPECT_CALL(wire, Flush()).WillOnce(Return(0)); // SendControl() } @@ -214,8 +217,8 @@ TEST_F(ServerImplTest, PublishLocal) { // publish before send control { - queue.msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid2, "test2", "double", wpi::util::json::object(), {}}}); + queue.msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid2, "test2", "double", wpi::util::json::object(), {}}}); EXPECT_FALSE(server.ProcessLocalMessages(UINT_MAX)); } @@ -223,8 +226,8 @@ TEST_F(ServerImplTest, PublishLocal) { // publish after send control { - queue.msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid3, "test3", "double", wpi::util::json::object(), {}}}); + queue.msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid3, "test3", "double", wpi::util::json::object(), {}}}); EXPECT_FALSE(server.ProcessLocalMessages(UINT_MAX)); } @@ -241,8 +244,8 @@ TEST_F(ServerImplTest, ClientSubTopicOnlyThenValue) { wpi::util::json::object(), std::optional{pubuid})); { - queue.msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid, "test", "double", wpi::util::json::object(), {}}}); + queue.msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid, "test", "double", wpi::util::json::object(), {}}}); queue.msgs.emplace_back(net::ClientMessage{ net::ClientValueMsg{pubuid, Value::MakeDouble(1.0, 10)}}); EXPECT_FALSE(server.ProcessLocalMessages(UINT_MAX)); @@ -260,16 +263,18 @@ TEST_F(ServerImplTest, ClientSubTopicOnlyThenValue) { EXPECT_CALL(wire, SendPing(100)); EXPECT_CALL(wire, Ready()).WillOnce(Return(true)); // SendValues() EXPECT_CALL( - wire, DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ - "test", 3, "double", std::nullopt, wpi::util::json::object()}})))) + wire, + DoWriteText(StrEq(EncodeText1(net::ServerMessage{net::AnnounceMsg{ + "test", 3, "double", std::nullopt, wpi::util::json::object()}})))) .WillOnce(Return(0)); EXPECT_CALL(wire, Flush()).WillOnce(Return(0)); // SendValues() EXPECT_CALL(setPeriodic, Call(100)); // ClientSubscribe() // EXPECT_CALL(wire, Flush()).WillOnce(Return(0)); // ClientSubscribe() EXPECT_CALL(wire, Ready()).WillOnce(Return(true)); // SendValues() EXPECT_CALL( - wire, DoWriteBinary(wpi::util::SpanEq(EncodeServerBinary1(net::ServerMessage{ - net::ServerValueMsg{3, Value::MakeDouble(1.0, 10)}})))) + wire, + DoWriteBinary(wpi::util::SpanEq(EncodeServerBinary1(net::ServerMessage{ + net::ServerValueMsg{3, Value::MakeDouble(1.0, 10)}})))) .WillOnce(Return(0)); EXPECT_CALL(wire, Flush()); // SendValues() } @@ -309,10 +314,10 @@ TEST_F(ServerImplTest, ClientDisconnectUnpublish) { constexpr int subuid = 1; { ::testing::InSequence seq; - EXPECT_CALL( - local, - ServerAnnounce(std::string_view{"test2"}, 0, std::string_view{"double"}, - wpi::util::json::object(), std::optional{pubuidLocal})); + EXPECT_CALL(local, ServerAnnounce(std::string_view{"test2"}, 0, + std::string_view{"double"}, + wpi::util::json::object(), + std::optional{pubuidLocal})); EXPECT_CALL( local, ServerAnnounce(std::string_view{"test"}, 0, std::string_view{"double"}, @@ -357,8 +362,8 @@ TEST_F(ServerImplTest, ClientDisconnectUnpublish) { { constexpr int pubuid = 1; std::vector msgs; - msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid, "test", "double", wpi::util::json::object(), {}}}); + msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid, "test", "double", wpi::util::json::object(), {}}}); server.ProcessIncomingText(id, EncodeText(msgs)); } @@ -390,8 +395,8 @@ TEST_F(ServerImplTest, ZeroTimestampNegativeTime) { } { - queue.msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid, "test", "double", wpi::util::json::object(), {}}}); + queue.msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid, "test", "double", wpi::util::json::object(), {}}}); queue.msgs.emplace_back( net::ClientMessage{net::ClientValueMsg{pubuid, defaultValue}}); queue.msgs.emplace_back( @@ -414,8 +419,8 @@ TEST_F(ServerImplTest, ZeroTimestampNegativeTime) { { constexpr int pubuid2 = 2; std::vector msgs; - msgs.emplace_back(net::ClientMessage{ - net::PublishMsg{pubuid2, "test", "double", wpi::util::json::object(), {}}}); + msgs.emplace_back(net::ClientMessage{net::PublishMsg{ + pubuid2, "test", "double", wpi::util::json::object(), {}}}); server.ProcessIncomingText(id, EncodeText(msgs)); msgs.clear(); msgs.emplace_back(net::ClientMessage{net::ClientValueMsg{pubuid2, value}}); diff --git a/ntcoreffi/src/main/native/cpp/DataLogManager.cpp b/ntcoreffi/src/main/native/cpp/DataLogManager.cpp index 6ef50188c8..9cfd23552f 100644 --- a/ntcoreffi/src/main/native/cpp/DataLogManager.cpp +++ b/ntcoreffi/src/main/native/cpp/DataLogManager.cpp @@ -57,12 +57,12 @@ inline void ReportError(int32_t status, const char* fileName, int lineNumber, } } // namespace wpi -#define WPILIB_ReportError(status, format, ...) \ - do { \ - if ((status) != 0) { \ +#define WPILIB_ReportError(status, format, ...) \ + do { \ + if ((status) != 0) { \ wpi::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \ - format __VA_OPT__(, ) __VA_ARGS__); \ - } \ + format __VA_OPT__(, ) __VA_ARGS__); \ + } \ } while (0) namespace RobotController { @@ -282,8 +282,8 @@ void Thread::Main() { freeSpace = UINTMAX_MAX; } if (freeSpace < kFreeSpaceThreshold) { - // Delete oldest WPILIB_*.wpilog files (ignore WPILIB_TBD_*.wpilog as we just - // created one) + // Delete oldest WPILIB_*.wpilog files (ignore WPILIB_TBD_*.wpilog as we + // just created one) std::vector entries; for (auto&& entry : fs::directory_iterator{m_logDir, ec}) { auto stem = entry.path().stem().string(); @@ -307,14 +307,14 @@ void Thread::Main() { auto size = entry.file_size(); if (fs::remove(entry.path(), ec)) { WPILIB_ReportError(warn::Warning, "DataLogManager: Deleted {}", - entry.path().string()); + entry.path().string()); freeSpace += size; if (freeSpace >= kFreeSpaceThreshold) { break; } } else { ::wpi::util::print(stderr, "DataLogManager: could not delete {}\n", - entry.path().string()); + entry.path().string()); } } } else if (freeSpace < 2 * kFreeSpaceThreshold) { @@ -456,7 +456,8 @@ void Thread::StopNTLog() { void Thread::StartConsoleLog() { if (!m_consoleLoggerEnabled) { m_consoleLoggerEnabled = true; - m_consoleLogger = {"/home/systemcore/WPILIB_UserProgram.log", m_log, "output"}; + m_consoleLogger = {"/home/systemcore/WPILIB_UserProgram.log", m_log, + "output"}; } } @@ -479,7 +480,7 @@ Instance::Instance(std::string_view dir, std::string_view filename, entry.path().extension() == ".wpilog") { if (!fs::remove(entry, ec)) { ::wpi::util::print(stderr, "DataLogManager: could not delete {}\n", - entry.path().string()); + entry.path().string()); } } } @@ -549,8 +550,8 @@ extern "C" { void DLM_Start(const struct WPI_String* dir, const struct WPI_String* filename, double period) { - DataLogManager::Start(::wpi::util::to_string_view(dir), ::wpi::util::to_string_view(filename), - period); + DataLogManager::Start(::wpi::util::to_string_view(dir), + ::wpi::util::to_string_view(filename), period); } void DLM_Stop(void) { diff --git a/simulation/halsim_ds_socket/src/main/native/cpp/main.cpp b/simulation/halsim_ds_socket/src/main/native/cpp/main.cpp index a4ed0ce07e..353757fc9a 100644 --- a/simulation/halsim_ds_socket/src/main/native/cpp/main.cpp +++ b/simulation/halsim_ds_socket/src/main/native/cpp/main.cpp @@ -152,8 +152,8 @@ static void SetupUdp(wpi::net::uv::Loop& loop) { outAddr.sin_port = htons(1150); wpi::util::SmallVector sendBufs; - wpi::net::raw_uv_ostream stream{sendBufs, - [] { return GetBufferPool().Allocate(); }}; + wpi::net::raw_uv_ostream stream{ + sendBufs, [] { return GetBufferPool().Allocate(); }}; ds->SetupSendBuffer(stream); udpLocal->Send(outAddr, sendBufs, [](auto bufs, Error err) { diff --git a/simulation/halsim_gui/src/main/native/cpp/AddressableLEDGui.cpp b/simulation/halsim_gui/src/main/native/cpp/AddressableLEDGui.cpp index 9ee2cade12..e1e02be725 100644 --- a/simulation/halsim_gui/src/main/native/cpp/AddressableLEDGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/AddressableLEDGui.cpp @@ -48,9 +48,9 @@ class AddressableLEDsModel : public wpi::glass::LEDDisplaysModel { size_t GetNumLEDDisplays() override { return m_models.size(); } - void ForEachLEDDisplay( - wpi::util::function_ref func) - override; + void ForEachLEDDisplay(wpi::util::function_ref< + void(wpi::glass::LEDDisplayModel& model, int channel)> + func) override; private: std::vector> m_models; @@ -83,7 +83,9 @@ bool AddressableLEDsModel::Exists() { } void AddressableLEDsModel::ForEachLEDDisplay( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { for (int i = 0; i < static_cast(m_models.size()); ++i) { if (m_models[i]) { func(*m_models[i], i); @@ -109,7 +111,8 @@ void AddressableLEDGui::Initialize() { win->SetFlags(ImGuiWindowFlags_AlwaysAutoResize); win->SetDefaultPos(290, 100); return wpi::glass::MakeFunctionView([=] { - wpi::glass::DisplayLEDDisplays(static_cast(model)); + wpi::glass::DisplayLEDDisplays( + static_cast(model)); }); }); } diff --git a/simulation/halsim_gui/src/main/native/cpp/AnalogInputSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/AnalogInputSimGui.cpp index 992064a485..96aae0b033 100644 --- a/simulation/halsim_gui/src/main/native/cpp/AnalogInputSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/AnalogInputSimGui.cpp @@ -56,9 +56,9 @@ class AnalogInputsSimModel : public wpi::glass::AnalogInputsModel { bool Exists() override { return true; } - void ForEachAnalogInput( - wpi::util::function_ref func) - override; + void ForEachAnalogInput(wpi::util::function_ref< + void(wpi::glass::AnalogInputModel& model, int index)> + func) override; private: // indexed by channel @@ -81,7 +81,9 @@ void AnalogInputsSimModel::Update() { } void AnalogInputsSimModel::ForEachAnalogInput( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { for (int32_t i = 0, iend = static_cast(m_models.size()); i < iend; ++i) { if (auto model = m_models[i].get()) { @@ -108,7 +110,8 @@ void AnalogInputSimGui::Initialize() { win->SetFlags(ImGuiWindowFlags_AlwaysAutoResize); win->SetDefaultPos(640, 20); return wpi::glass::MakeFunctionView([=] { - wpi::glass::DisplayAnalogInputs(static_cast(model)); + wpi::glass::DisplayAnalogInputs( + static_cast(model)); }); }); } diff --git a/simulation/halsim_gui/src/main/native/cpp/DIOSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/DIOSimGui.cpp index 45620ccc50..3b76caccd7 100644 --- a/simulation/halsim_gui/src/main/native/cpp/DIOSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/DIOSimGui.cpp @@ -138,7 +138,8 @@ class DIOsSimModel : public wpi::glass::DIOsModel { bool Exists() override { return true; } void ForEachDIO( - wpi::util::function_ref func) override; + wpi::util::function_ref + func) override; private: // indexed by channel @@ -210,7 +211,8 @@ void DIOsSimModel::Update() { } void DIOsSimModel::ForEachDIO( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { const int32_t numDIO = m_dioModels.size(); for (int32_t i = 0; i < numDIO; ++i) { if (auto model = m_dioModels[i].get()) { @@ -237,7 +239,7 @@ void DIOSimGui::Initialize() { win->SetDefaultPos(470, 20); return wpi::glass::MakeFunctionView([=] { wpi::glass::DisplayDIOs(static_cast(model), - HALSimGui::halProvider->AreOutputsEnabled()); + HALSimGui::halProvider->AreOutputsEnabled()); }); }); } diff --git a/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp b/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp index 25aaab7325..2ed385fbcb 100644 --- a/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/DriverStationGui.cpp @@ -214,8 +214,12 @@ class FMSSimModel : public wpi::glass::FMSModel { public: FMSSimModel(); - wpi::glass::BooleanSource* GetFmsAttachedData() override { return &m_fmsAttached; } - wpi::glass::BooleanSource* GetDsAttachedData() override { return &m_dsAttached; } + wpi::glass::BooleanSource* GetFmsAttachedData() override { + return &m_fmsAttached; + } + wpi::glass::BooleanSource* GetDsAttachedData() override { + return &m_dsAttached; + } wpi::glass::IntegerSource* GetAllianceStationIdData() override { return &m_allianceStationId; } @@ -223,7 +227,9 @@ class FMSSimModel : public wpi::glass::FMSModel { wpi::glass::BooleanSource* GetEStopData() override { return &m_estop; } wpi::glass::BooleanSource* GetEnabledData() override { return &m_enabled; } wpi::glass::BooleanSource* GetTestData() override { return &m_test; } - wpi::glass::BooleanSource* GetAutonomousData() override { return &m_autonomous; } + wpi::glass::BooleanSource* GetAutonomousData() override { + return &m_autonomous; + } wpi::glass::StringSource* GetGameSpecificMessageData() override { return &m_gameMessage; } @@ -562,10 +568,11 @@ void KeyboardJoystick::EditKey(const char* label, int* key) { char editLabel[32]; if (s_keyEdit == key) { - wpi::util::format_to_n_c_str(editLabel, sizeof(editLabel), "(press key)###edit"); + wpi::util::format_to_n_c_str(editLabel, sizeof(editLabel), + "(press key)###edit"); } else { wpi::util::format_to_n_c_str(editLabel, sizeof(editLabel), "{}###edit", - GetKeyName(*key)); + GetKeyName(*key)); } if (ImGui::SmallButton(editLabel)) { @@ -842,7 +849,8 @@ void KeyboardJoystick::ClearKey(int key) { } } -GlfwKeyboardJoystick::GlfwKeyboardJoystick(wpi::glass::Storage& storage, int index) +GlfwKeyboardJoystick::GlfwKeyboardJoystick(wpi::glass::Storage& storage, + int index) : KeyboardJoystick{storage, index} { // set up a default keyboard config for 0, 1, and 2 if (index == 0) { @@ -1216,7 +1224,8 @@ bool FMSSimModel::IsReadOnly() { static void DisplaySystemJoystick(SystemJoystick& joy, int i) { char label[64]; - wpi::util::format_to_n_c_str(label, sizeof(label), "{}: {}", i, joy.GetName()); + wpi::util::format_to_n_c_str(label, sizeof(label), "{}: {}", i, + joy.GetName()); // highlight if any buttons pressed bool anyButtonPressed = joy.IsAnyButtonPressed(); @@ -1250,7 +1259,8 @@ static void DisplaySystemJoysticks() { DisplaySystemJoystick(*joy, i + GLFW_JOYSTICK_LAST + 1); if (ImGui::BeginPopupContextItem()) { char buf[64]; - wpi::util::format_to_n_c_str(buf, sizeof(buf), "{} Settings", joy->GetName()); + wpi::util::format_to_n_c_str(buf, sizeof(buf), "{} Settings", + joy->GetName()); if (ImGui::MenuItem(buf)) { if (auto win = DriverStationGui::dsManager->GetWindow(buf)) { @@ -1300,8 +1310,8 @@ static void DisplayJoysticks() { joy.sys = payload_sys; joy.guid = payload_sys->GetGUID(); std::string_view name{payload_sys->GetName()}; - joy.useGamepad = - wpi::util::starts_with(name, "Xbox") || wpi::util::contains(name, "pad"); + joy.useGamepad = wpi::util::starts_with(name, "Xbox") || + wpi::util::contains(name, "pad"); } ImGui::EndDragDropTarget(); } @@ -1460,7 +1470,7 @@ void DriverStationGui::GlobalInit() { for (auto&& joy : gKeyboardJoysticks) { char label[64]; wpi::util::format_to_n_c_str(label, sizeof(label), "{} Settings", - joy->GetName()); + joy->GetName()); if (auto win = dsManager->AddWindow( label, [j = joy.get()] { j->SettingsDisplay(); }, diff --git a/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp index 3313a38706..8e7c9a1919 100644 --- a/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp @@ -93,7 +93,9 @@ class EncoderSimModel : public wpi::glass::EncoderModel { } wpi::glass::IntegerSource* GetCountData() override { return &m_count; } wpi::glass::DoubleSource* GetPeriodData() override { return &m_period; } - wpi::glass::BooleanSource* GetDirectionData() override { return &m_direction; } + wpi::glass::BooleanSource* GetDirectionData() override { + return &m_direction; + } wpi::glass::DoubleSource* GetDistanceData() override { return &m_distance; } wpi::glass::DoubleSource* GetRateData() override { return &m_rate; } @@ -201,8 +203,8 @@ class EncodersSimModel : public wpi::glass::EncodersModel { bool Exists() override { return true; } void ForEachEncoder( - wpi::util::function_ref func) - override; + wpi::util::function_ref + func) override; private: std::vector> m_models; @@ -224,7 +226,8 @@ void EncodersSimModel::Update() { } void EncodersSimModel::ForEachEncoder( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { for (int32_t i = 0, iend = static_cast(m_models.size()); i < iend; ++i) { if (auto model = m_models[i].get()) { diff --git a/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.hpp b/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.hpp index 410e4d40d3..46241e4679 100644 --- a/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.hpp +++ b/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.hpp @@ -6,7 +6,7 @@ namespace wpi::glass { class EncodersModel; -} // namespace glass +} // namespace wpi::glass namespace halsimgui { diff --git a/simulation/halsim_gui/src/main/native/cpp/HALProvider.cpp b/simulation/halsim_gui/src/main/native/cpp/HALProvider.cpp index 7e727e0a5d..b3f3a97954 100644 --- a/simulation/halsim_gui/src/main/native/cpp/HALProvider.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/HALProvider.cpp @@ -95,9 +95,9 @@ void HALProvider::Show(ViewEntry* entry, wpi::glass::Window* window) { // the window might exist and we're just not associated to it yet if (!window) { - window = GetOrAddWindow( - entry->name, true, - entry->showDefault ? wpi::glass::Window::kShow : wpi::glass::Window::kHide); + window = GetOrAddWindow(entry->name, true, + entry->showDefault ? wpi::glass::Window::kShow + : wpi::glass::Window::kHide); } if (!window) { return; diff --git a/simulation/halsim_gui/src/main/native/cpp/NetworkTablesSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/NetworkTablesSimGui.cpp index 4e2816d205..fb24707101 100644 --- a/simulation/halsim_gui/src/main/native/cpp/NetworkTablesSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/NetworkTablesSimGui.cpp @@ -23,9 +23,10 @@ void NetworkTablesSimGui::Initialize() { wpi::gui::AddEarlyExecute([] { gNetworkTablesModel->Update(); }); gNetworkTablesWindow = std::make_unique( - wpi::glass::GetStorageRoot().GetChild("NetworkTables View"), "NetworkTables"); - gNetworkTablesWindow->SetView( - std::make_unique(gNetworkTablesModel.get())); + wpi::glass::GetStorageRoot().GetChild("NetworkTables View"), + "NetworkTables"); + gNetworkTablesWindow->SetView(std::make_unique( + gNetworkTablesModel.get())); gNetworkTablesWindow->SetDefaultPos(250, 277); gNetworkTablesWindow->SetDefaultSize(750, 185); gNetworkTablesWindow->DisableRenamePopup(); @@ -35,8 +36,9 @@ void NetworkTablesSimGui::Initialize() { gNetworkTablesInfoWindow = std::make_unique( wpi::glass::GetStorageRoot().GetChild("NetworkTables Info"), "NetworkTables Info"); - gNetworkTablesInfoWindow->SetView(wpi::glass::MakeFunctionView( - [&] { wpi::glass::DisplayNetworkTablesInfo(gNetworkTablesModel.get()); })); + gNetworkTablesInfoWindow->SetView(wpi::glass::MakeFunctionView([&] { + wpi::glass::DisplayNetworkTablesInfo(gNetworkTablesModel.get()); + })); gNetworkTablesInfoWindow->SetDefaultPos(250, 130); gNetworkTablesInfoWindow->SetDefaultSize(750, 145); gNetworkTablesInfoWindow->SetDefaultVisibility(wpi::glass::Window::kHide); diff --git a/simulation/halsim_gui/src/main/native/cpp/PCMSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/PCMSimGui.cpp index ee663207f2..61691c2882 100644 --- a/simulation/halsim_gui/src/main/native/cpp/PCMSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/PCMSimGui.cpp @@ -103,8 +103,8 @@ class PCMSimModel : public wpi::glass::PneumaticControlModel { CompressorSimModel* GetCompressor() override { return &m_compressor; } void ForEachSolenoid( - wpi::util::function_ref func) - override; + wpi::util::function_ref + func) override; std::string_view GetName() override { return "PCM"; } @@ -126,7 +126,8 @@ class PCMsSimModel : public wpi::glass::PneumaticControlsModel { bool Exists() override { return true; } void ForEachPneumaticControl( - wpi::util::function_ref + wpi::util::function_ref func) override; private: @@ -151,7 +152,8 @@ void PCMSimModel::Update() { } void PCMSimModel::ForEachSolenoid( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { if (m_solenoidInitCount == 0) { return; } @@ -179,7 +181,8 @@ void PCMsSimModel::Update() { } void PCMsSimModel::ForEachPneumaticControl( - wpi::util::function_ref + wpi::util::function_ref func) { int32_t numCTREPCMs = m_models.size(); for (int32_t i = 0; i < numCTREPCMs; ++i) { @@ -220,7 +223,8 @@ void PCMSimGui::Initialize() { [] { return std::make_unique(); }); SimDeviceGui::GetDeviceTree().Add( - HALSimGui::halProvider->GetModel("CTREPCMs"), [](wpi::glass::Model* model) { + HALSimGui::halProvider->GetModel("CTREPCMs"), + [](wpi::glass::Model* model) { wpi::glass::DisplayCompressorsDevice( static_cast(model), HALSimGui::halProvider->AreOutputsEnabled()); diff --git a/simulation/halsim_gui/src/main/native/cpp/PHSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/PHSimGui.cpp index d0a5ac1fb3..d12d027ddd 100644 --- a/simulation/halsim_gui/src/main/native/cpp/PHSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/PHSimGui.cpp @@ -98,8 +98,8 @@ class PHSimModel : public wpi::glass::PneumaticControlModel { CompressorSimModel* GetCompressor() override { return &m_compressor; } void ForEachSolenoid( - wpi::util::function_ref func) - override; + wpi::util::function_ref + func) override; std::string_view GetName() override { return "PH"; } @@ -121,7 +121,8 @@ class PHsSimModel : public wpi::glass::PneumaticControlsModel { bool Exists() override { return true; } void ForEachPneumaticControl( - wpi::util::function_ref + wpi::util::function_ref func) override; private: @@ -146,7 +147,8 @@ void PHSimModel::Update() { } void PHSimModel::ForEachSolenoid( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { if (m_solenoidInitCount == 0) { return; } @@ -174,7 +176,8 @@ void PHsSimModel::Update() { } void PHsSimModel::ForEachPneumaticControl( - wpi::util::function_ref + wpi::util::function_ref func) { int32_t numREVPHs = m_models.size(); for (int32_t i = 0; i < numREVPHs; ++i) { diff --git a/simulation/halsim_gui/src/main/native/cpp/PWMSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/PWMSimGui.cpp index 295223f337..13c337b2d7 100644 --- a/simulation/halsim_gui/src/main/native/cpp/PWMSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/PWMSimGui.cpp @@ -47,7 +47,8 @@ class PWMsSimModel : public wpi::glass::PWMsModel { bool Exists() override { return true; } void ForEachPWM( - wpi::util::function_ref func) override; + wpi::util::function_ref + func) override; private: // indexed by channel @@ -70,7 +71,8 @@ void PWMsSimModel::Update() { } void PWMsSimModel::ForEachPWM( - wpi::util::function_ref func) { + wpi::util::function_ref + func) { const int32_t numPWM = m_sources.size(); for (int32_t i = 0; i < numPWM; ++i) { if (auto model = m_sources[i].get()) { @@ -98,7 +100,7 @@ void PWMSimGui::Initialize() { win->SetDefaultPos(910, 20); return wpi::glass::MakeFunctionView([=] { wpi::glass::DisplayPWMs(static_cast(model), - HALSimGui::halProvider->AreOutputsEnabled()); + HALSimGui::halProvider->AreOutputsEnabled()); }); }); } diff --git a/simulation/halsim_gui/src/main/native/cpp/PowerDistributionSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/PowerDistributionSimGui.cpp index eeaa7b4d4b..21f3fdd135 100644 --- a/simulation/halsim_gui/src/main/native/cpp/PowerDistributionSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/PowerDistributionSimGui.cpp @@ -78,7 +78,8 @@ class PowerDistributionsSimModel : public wpi::glass::PowerDistributionsModel { bool Exists() override { return true; } void ForEachPowerDistribution( - wpi::util::function_ref + wpi::util::function_ref func) override; private: @@ -101,7 +102,8 @@ void PowerDistributionsSimModel::Update() { } void PowerDistributionsSimModel::ForEachPowerDistribution( - wpi::util::function_ref + wpi::util::function_ref func) { for (int32_t i = 0, iend = static_cast(m_models.size()); i < iend; ++i) { diff --git a/simulation/halsim_gui/src/main/native/cpp/RoboRioSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/RoboRioSimGui.cpp index dfadcc3c98..b6d7273be0 100644 --- a/simulation/halsim_gui/src/main/native/cpp/RoboRioSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/RoboRioSimGui.cpp @@ -48,9 +48,13 @@ class RoboRioSimModel : public wpi::glass::RoboRioModel { bool Exists() override { return true; } - wpi::glass::RoboRioRailModel* GetUser3V3Rail() override { return &m_user3V3Rail; } + wpi::glass::RoboRioRailModel* GetUser3V3Rail() override { + return &m_user3V3Rail; + } - wpi::glass::DoubleSource* GetVInVoltageData() override { return &m_vInVoltage; } + wpi::glass::DoubleSource* GetVInVoltageData() override { + return &m_vInVoltage; + } wpi::glass::DoubleSource* GetBrownoutVoltage() override { return &m_brownoutVoltage; } diff --git a/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp b/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp index 23dd7d2e4a..9aa3a7605d 100644 --- a/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp @@ -23,7 +23,7 @@ using namespace halsimgui; namespace { #define DEFINE_SIMVALUESOURCE(Type, TYPE, v_type) \ - class Sim##Type##ValueSource : public wpi::glass::Type##Source { \ + class Sim##Type##ValueSource : public wpi::glass::Type##Source { \ public: \ explicit Sim##Type##ValueSource(HAL_SimValueHandle handle, \ const char* device, const char* name) \ @@ -90,7 +90,8 @@ class SimDevicesModel : public wpi::glass::Model { } private: - wpi::util::DenseMap> + wpi::util::DenseMap> m_sources; }; } // namespace @@ -151,7 +152,7 @@ static void DisplaySimValue(const char* name, void* data, case HAL_BOOLEAN: { bool v = value->data.v_boolean; if (wpi::glass::DeviceBoolean(name, direction == HAL_SimValueOutput, &v, - model->GetSource(handle))) { + model->GetSource(handle))) { valueCopy.data.v_boolean = v ? 1 : 0; HAL_SetSimValue(handle, valueCopy); } @@ -159,8 +160,8 @@ static void DisplaySimValue(const char* name, void* data, } case HAL_DOUBLE: if (wpi::glass::DeviceDouble(name, direction == HAL_SimValueOutput, - &valueCopy.data.v_double, - model->GetSource(handle))) { + &valueCopy.data.v_double, + model->GetSource(handle))) { HAL_SetSimValue(handle, valueCopy); } break; @@ -168,21 +169,23 @@ static void DisplaySimValue(const char* name, void* data, int32_t numOptions = 0; const char** options = HALSIM_GetSimValueEnumOptions(handle, &numOptions); if (wpi::glass::DeviceEnum(name, direction == HAL_SimValueOutput, - &valueCopy.data.v_enum, options, numOptions, - model->GetSource(handle))) { + &valueCopy.data.v_enum, options, numOptions, + model->GetSource(handle))) { HAL_SetSimValue(handle, valueCopy); } break; } case HAL_INT: if (wpi::glass::DeviceInt(name, direction == HAL_SimValueOutput, - &valueCopy.data.v_int, model->GetSource(handle))) { + &valueCopy.data.v_int, + model->GetSource(handle))) { HAL_SetSimValue(handle, valueCopy); } break; case HAL_LONG: if (wpi::glass::DeviceLong(name, direction == HAL_SimValueOutput, - &valueCopy.data.v_long, model->GetSource(handle))) { + &valueCopy.data.v_long, + model->GetSource(handle))) { HAL_SetSimValue(handle, valueCopy); } break; @@ -234,7 +237,8 @@ void SimDeviceGui::Initialize() { }); } -wpi::glass::DataSource* SimDeviceGui::GetValueSource(HAL_SimValueHandle handle) { +wpi::glass::DataSource* SimDeviceGui::GetValueSource( + HAL_SimValueHandle handle) { return gSimDevicesModel->GetSource(handle); } diff --git a/simulation/halsim_gui/src/main/native/cpp/main.cpp b/simulation/halsim_gui/src/main/native/cpp/main.cpp index 651e1715c6..c46828a95c 100644 --- a/simulation/halsim_gui/src/main/native/cpp/main.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/main.cpp @@ -64,9 +64,9 @@ int HALSIM_InitExtension(void) { HAL_RegisterExtension( HALSIMGUI_EXT_GETGUICONTEXT, reinterpret_cast((GetGuiContextFn)&gui::GetCurrentContext)); - HAL_RegisterExtension( - HALSIMGUI_EXT_GETGLASSCONTEXT, - reinterpret_cast((GetGlassContextFn)&wpi::glass::GetCurrentContext)); + HAL_RegisterExtension(HALSIMGUI_EXT_GETGLASSCONTEXT, + reinterpret_cast( + (GetGlassContextFn)&wpi::glass::GetCurrentContext)); HALSimGui::GlobalInit(); DriverStationGui::GlobalInit(); diff --git a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp index ba69301d6f..0a71a76e46 100644 --- a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp +++ b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALDataSource.hpp @@ -7,7 +7,7 @@ #include "wpi/glass/DataSource.hpp" #define HALSIMGUI_DATASOURCE(cbname, id, TYPE, Type, vtype) \ - class cbname##Source : public ::wpi::glass::Type##Source { \ + class cbname##Source : public ::wpi::glass::Type##Source { \ public: \ cbname##Source() \ : Type##Source{id}, \ @@ -39,11 +39,11 @@ HALSIMGUI_DATASOURCE(cbname, id, INT, Integer, int) #define HALSIMGUI_DATASOURCE_INDEXED(cbname, id, TYPE, Type, vtype) \ - class cbname##Source : public ::wpi::glass::Type##Source { \ + class cbname##Source : public ::wpi::glass::Type##Source { \ public: \ explicit cbname##Source(int32_t index, int channel = -1) \ - : Type##Source{::wpi::glass::MakeSourceId(id, \ - channel < 0 ? index : channel)}, \ + : Type##Source{::wpi::glass::MakeSourceId( \ + id, channel < 0 ? index : channel)}, \ m_index{index}, \ m_channel{channel < 0 ? index : channel}, \ m_callback{HALSIM_Register##cbname##Callback(index, CallbackFunc, \ @@ -77,10 +77,10 @@ HALSIMGUI_DATASOURCE_INDEXED(cbname, id, DOUBLE, Double, double) #define HALSIMGUI_DATASOURCE_INDEXED2(cbname, id, TYPE, Type, vtype) \ - class cbname##Source : public ::wpi::glass::Type##Source { \ + class cbname##Source : public ::wpi::glass::Type##Source { \ public: \ explicit cbname##Source(int32_t index, int32_t channel) \ - : Type##Source{::wpi::glass::MakeSourceId(id, index, channel)}, \ + : Type##Source{::wpi::glass::MakeSourceId(id, index, channel)}, \ m_index{index}, \ m_channel{channel}, \ m_callback{HALSIM_Register##cbname##Callback( \ diff --git a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALSimGuiExt.hpp b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALSimGuiExt.hpp index a1a2e9fda5..9f77a07439 100644 --- a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALSimGuiExt.hpp +++ b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/HALSimGuiExt.hpp @@ -10,7 +10,7 @@ struct ImGuiContext; namespace wpi::glass { class Context; -} // namespace glass +} // namespace wpi::glass namespace wpi::gui { struct Context; diff --git a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/SimDeviceGui.hpp b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/SimDeviceGui.hpp index 0c32a893af..c2f176e48f 100644 --- a/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/SimDeviceGui.hpp +++ b/simulation/halsim_gui/src/main/native/include/wpi/halsim/gui/SimDeviceGui.hpp @@ -9,7 +9,7 @@ namespace wpi::glass { class DataSource; class DeviceTreeModel; -} // namespace glass +} // namespace wpi::glass namespace halsimgui { diff --git a/simulation/halsim_ws_client/src/main/native/cpp/HALSimWS.cpp b/simulation/halsim_ws_client/src/main/native/cpp/HALSimWS.cpp index 2575f592ac..2e685b622d 100644 --- a/simulation/halsim_ws_client/src/main/native/cpp/HALSimWS.cpp +++ b/simulation/halsim_ws_client/src/main/native/cpp/HALSimWS.cpp @@ -54,7 +54,8 @@ bool HALSimWS::Initialize() { try { m_port = std::stoi(port); } catch (const std::invalid_argument& err) { - wpi::util::print(stderr, "Error decoding HALSIMWS_PORT ({})\n", err.what()); + wpi::util::print(stderr, "Error decoding HALSIMWS_PORT ({})\n", + err.what()); return false; } } else { @@ -71,8 +72,9 @@ bool HALSimWS::Initialize() { const char* msgFilters = std::getenv("HALSIMWS_FILTERS"); if (msgFilters != nullptr) { m_useMsgFiltering = true; - wpi::util::split(wpi::util::trim(msgFilters), ',', -1, false, - [&](auto val) { m_msgFilters[wpi::util::trim(val)] = true; }); + wpi::util::split( + wpi::util::trim(msgFilters), ',', -1, false, + [&](auto val) { m_msgFilters[wpi::util::trim(val)] = true; }); } else { m_useMsgFiltering = false; } @@ -112,7 +114,7 @@ void HALSimWS::Start() { // Set up the connection timer wpi::util::print("Will attempt to connect to ws://{}:{}{}\n", m_host, m_port, - m_uri); + m_uri); // Set up the timer to attempt connection m_connect_timer->timeout.connect([this] { AttemptConnect(); }); diff --git a/simulation/halsim_ws_client/src/main/native/cpp/HALSimWSClientConnection.cpp b/simulation/halsim_ws_client/src/main/native/cpp/HALSimWSClientConnection.cpp index c7203587af..57bd42f0d8 100644 --- a/simulation/halsim_ws_client/src/main/native/cpp/HALSimWSClientConnection.cpp +++ b/simulation/halsim_ws_client/src/main/native/cpp/HALSimWSClientConnection.cpp @@ -89,9 +89,9 @@ void HALSimWSClientConnection::OnSimValueChanged(const wpi::util::json& msg) { wpi::util::SmallVector sendBufs; wpi::net::raw_uv_ostream os{sendBufs, [this]() -> uv::Buffer { - std::lock_guard lock(m_buffers_mutex); - return m_buffers.Allocate(); - }}; + std::lock_guard lock(m_buffers_mutex); + return m_buffers.Allocate(); + }}; os << msg; diff --git a/simulation/halsim_ws_client/src/main/native/include/wpi/halsim/ws_client/HALSimWSClientConnection.hpp b/simulation/halsim_ws_client/src/main/native/include/wpi/halsim/ws_client/HALSimWSClientConnection.hpp index 573efac95d..25cde92214 100644 --- a/simulation/halsim_ws_client/src/main/native/include/wpi/halsim/ws_client/HALSimWSClientConnection.hpp +++ b/simulation/halsim_ws_client/src/main/native/include/wpi/halsim/ws_client/HALSimWSClientConnection.hpp @@ -23,8 +23,9 @@ class HALSimWSClientConnection : public HALSimBaseWebSocketConnection, public std::enable_shared_from_this { public: - explicit HALSimWSClientConnection(std::shared_ptr client, - std::shared_ptr stream) + explicit HALSimWSClientConnection( + std::shared_ptr client, + std::shared_ptr stream) : m_client(std::move(client)), m_stream(std::move(stream)), m_buffers(128) {} diff --git a/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_DriverStation.cpp b/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_DriverStation.cpp index 02bcdd06e3..0d32e430e4 100644 --- a/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_DriverStation.cpp +++ b/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_DriverStation.cpp @@ -122,7 +122,8 @@ void HALSimWSProviderDriverStation::DoCancelCallbacks() { m_matchTimeCbKey = 0; } -void HALSimWSProviderDriverStation::OnNetValueChanged(const wpi::util::json& json) { +void HALSimWSProviderDriverStation::OnNetValueChanged( + const wpi::util::json& json) { // ignore if DS connected if (gDSSocketConnected && *gDSSocketConnected) { return; diff --git a/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_Joystick.cpp b/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_Joystick.cpp index c9570c16a1..72dcba954c 100644 --- a/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_Joystick.cpp +++ b/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_Joystick.cpp @@ -115,8 +115,8 @@ void HALSimWSProviderJoystick::OnNetValueChanged(const wpi::util::json& json) { if ((it = json.find(">buttons")) != json.end()) { HAL_JoystickButtons buttons{}; - wpi::util::json::size_type buttonsCount = - std::min(it.value().size(), static_cast(64)); + wpi::util::json::size_type buttonsCount = std::min( + it.value().size(), static_cast(64)); if (buttonsCount < 64) { buttons.available = (1ULL << buttonsCount) - 1; } else { diff --git a/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_SimDevice.cpp b/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_SimDevice.cpp index 8141821323..ef9abf6e81 100644 --- a/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_SimDevice.cpp +++ b/simulation/halsim_ws_core/src/main/native/cpp/WSProvider_SimDevice.cpp @@ -250,7 +250,8 @@ void HALSimWSProviderSimDevice::OnValueReset(SimDeviceValueData* valueData, } } -void HALSimWSProviderSimDevice::ProcessHalCallback(const wpi::util::json& payload) { +void HALSimWSProviderSimDevice::ProcessHalCallback( + const wpi::util::json& payload) { auto ws = m_ws.lock(); if (ws) { wpi::util::json netValue = { diff --git a/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp b/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp index 26a022e07d..a58b35b6e9 100644 --- a/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp +++ b/simulation/halsim_ws_server/src/main/native/cpp/HALSimHttpConnection.cpp @@ -91,9 +91,9 @@ void HALSimHttpConnection::OnSimValueChanged(const wpi::util::json& msg) { // render json to buffers wpi::util::SmallVector sendBufs; wpi::net::raw_uv_ostream os{sendBufs, [this]() -> uv::Buffer { - std::lock_guard lock(m_buffers_mutex); - return m_buffers.Allocate(); - }}; + std::lock_guard lock(m_buffers_mutex); + return m_buffers.Allocate(); + }}; os << msg; // call the websocket send function on the uv loop @@ -154,7 +154,7 @@ void HALSimHttpConnection::SendFileResponse(int code, std::string_view codeText, void HALSimHttpConnection::ProcessRequest() { wpi::net::UrlParser url{m_request.GetUrl(), - m_request.GetMethod() == wpi::net::HTTP_CONNECT}; + m_request.GetMethod() == wpi::net::HTTP_CONNECT}; if (!url.IsValid()) { // failed to parse URL MySendError(400, "Invalid URL"); @@ -166,17 +166,18 @@ void HALSimHttpConnection::ProcessRequest() { path = url.GetPath(); } - if (m_request.GetMethod() == wpi::net::HTTP_GET && wpi::util::starts_with(path, '/') && - !wpi::util::contains(path, "..") && !wpi::util::contains(path, "//")) { + if (m_request.GetMethod() == wpi::net::HTTP_GET && + wpi::util::starts_with(path, '/') && !wpi::util::contains(path, "..") && + !wpi::util::contains(path, "//")) { // convert to fs native representation fs::path nativePath; if (auto userPath = wpi::util::remove_prefix(path, "/user/")) { nativePath = fs::path{m_server->GetWebrootSys()} / fs::path{*userPath, fs::path::format::generic_format}; } else { - nativePath = - fs::path{m_server->GetWebrootSys()} / - fs::path{wpi::util::drop_front(path), fs::path::format::generic_format}; + nativePath = fs::path{m_server->GetWebrootSys()} / + fs::path{wpi::util::drop_front(path), + fs::path::format::generic_format}; } if (fs::is_directory(nativePath)) { @@ -202,5 +203,5 @@ void HALSimHttpConnection::MySendError(int code, std::string_view message) { void HALSimHttpConnection::Log(int code) { auto method = wpi::net::http_method_str(m_request.GetMethod()); wpi::util::print(stderr, "{} {} HTTP/{}.{} {}\n", method, m_request.GetUrl(), - m_request.GetMajor(), m_request.GetMinor(), code); + m_request.GetMajor(), m_request.GetMinor(), code); } diff --git a/simulation/halsim_ws_server/src/main/native/cpp/HALSimWeb.cpp b/simulation/halsim_ws_server/src/main/native/cpp/HALSimWeb.cpp index af3b4f4f04..035c70ed14 100644 --- a/simulation/halsim_ws_server/src/main/native/cpp/HALSimWeb.cpp +++ b/simulation/halsim_ws_server/src/main/native/cpp/HALSimWeb.cpp @@ -72,7 +72,8 @@ bool HALSimWeb::Initialize() { try { m_port = std::stoi(port); } catch (const std::invalid_argument& err) { - wpi::util::print(stderr, "Error decoding HALSIMWS_PORT ({})\n", err.what()); + wpi::util::print(stderr, "Error decoding HALSIMWS_PORT ({})\n", + err.what()); return false; } } else { @@ -82,8 +83,9 @@ bool HALSimWeb::Initialize() { const char* msgFilters = std::getenv("HALSIMWS_FILTERS"); if (msgFilters != nullptr) { m_useMsgFiltering = true; - wpi::util::split(wpi::util::trim(msgFilters), ',', -1, false, - [&](auto val) { m_msgFilters[wpi::util::trim(val)] = true; }); + wpi::util::split( + wpi::util::trim(msgFilters), ',', -1, false, + [&](auto val) { m_msgFilters[wpi::util::trim(val)] = true; }); } else { m_useMsgFiltering = false; } diff --git a/simulation/halsim_ws_server/src/main/native/include/wpi/halsim/ws_server/HALSimHttpConnection.hpp b/simulation/halsim_ws_server/src/main/native/include/wpi/halsim/ws_server/HALSimHttpConnection.hpp index 0ee5c96216..507909e47f 100644 --- a/simulation/halsim_ws_server/src/main/native/include/wpi/halsim/ws_server/HALSimHttpConnection.hpp +++ b/simulation/halsim_ws_server/src/main/native/include/wpi/halsim/ws_server/HALSimHttpConnection.hpp @@ -25,7 +25,8 @@ class HALSimHttpConnection public: HALSimHttpConnection(std::shared_ptr server, std::shared_ptr stream) - : wpi::net::HttpWebSocketServerConnection(stream, {}), + : wpi::net::HttpWebSocketServerConnection(stream, + {}), m_server(std::move(server)), m_buffers(128) {} diff --git a/simulation/halsim_ws_server/src/test/native/cpp/WebServerClientTest.cpp b/simulation/halsim_ws_server/src/test/native/cpp/WebServerClientTest.cpp index 127359c577..06bd4e43b3 100644 --- a/simulation/halsim_ws_server/src/test/native/cpp/WebServerClientTest.cpp +++ b/simulation/halsim_ws_server/src/test/native/cpp/WebServerClientTest.cpp @@ -25,8 +25,8 @@ namespace wpilibws { void WebServerClientTest::InitializeWebSocket(const std::string& host, int port, const std::string& uri) { wpi::util::print("Will attempt to connect to: {}:{}{}\n", host, port, uri); - m_websocket = wpi::net::WebSocket::CreateClient(*m_tcp_client.get(), uri, - fmt::format("{}:{}", host, port)); + m_websocket = wpi::net::WebSocket::CreateClient( + *m_tcp_client.get(), uri, fmt::format("{}:{}", host, port)); // Hook up events m_websocket->open.connect_extended([this](auto conn, auto) { @@ -68,8 +68,9 @@ void WebServerClientTest::InitializeWebSocket(const std::string& host, int port, // Create tcp client, specify callbacks, and create timers for loop bool WebServerClientTest::Initialize() { - m_loop.error.connect( - [](uv::Error err) { wpi::util::print(stderr, "uv Error: {}\n", err.str()); }); + m_loop.error.connect([](uv::Error err) { + wpi::util::print(stderr, "uv Error: {}\n", err.str()); + }); m_tcp_client = uv::Tcp::Create(m_loop); if (!m_tcp_client) { @@ -135,9 +136,9 @@ void WebServerClientTest::SendMessage(const wpi::util::json& msg) { wpi::util::SmallVector sendBufs; wpi::net::raw_uv_ostream os{sendBufs, [this]() -> uv::Buffer { - std::lock_guard lock(m_buffers_mutex); - return m_buffers->Allocate(); - }}; + std::lock_guard lock(m_buffers_mutex); + return m_buffers->Allocate(); + }}; os << msg; // Call the websocket send function on the uv loop diff --git a/simulation/halsim_ws_server/src/test/native/cpp/main.cpp b/simulation/halsim_ws_server/src/test/native/cpp/main.cpp index 1a7109a647..585915825f 100644 --- a/simulation/halsim_ws_server/src/test/native/cpp/main.cpp +++ b/simulation/halsim_ws_server/src/test/native/cpp/main.cpp @@ -58,7 +58,7 @@ TEST_F(WebServerIntegrationTest, DISABLED_DigitalOutput) { } if (IsConnectedClientWS()) { wpi::util::print("***** Setting DIO value for pin {} to {}\n", PIN, - (EXPECTED_VALUE ? "true" : "false")); + (EXPECTED_VALUE ? "true" : "false")); HALSIM_SetDIOValue(PIN, EXPECTED_VALUE); done = true; } @@ -109,8 +109,8 @@ TEST_F(WebServerIntegrationTest, DISABLED_DigitalInput) { } if (IsConnectedClientWS()) { wpi::util::json msg = {{"type", "DIO"}, - {"device", std::to_string(PIN)}, - {"data", {{"<>value", EXPECTED_VALUE}}}}; + {"device", std::to_string(PIN)}, + {"data", {{"<>value", EXPECTED_VALUE}}}}; wpi::util::print("***** Input JSON: {}\n", msg.dump()); m_webserverClient->SendMessage(msg); done = true; diff --git a/simulation/halsim_xrp/src/main/native/cpp/HALSimXRP.cpp b/simulation/halsim_xrp/src/main/native/cpp/HALSimXRP.cpp index 54a5118ce6..c2a30408eb 100644 --- a/simulation/halsim_xrp/src/main/native/cpp/HALSimXRP.cpp +++ b/simulation/halsim_xrp/src/main/native/cpp/HALSimXRP.cpp @@ -52,7 +52,8 @@ bool HALSimXRP::Initialize() { try { m_port = std::stoi(port); } catch (const std::invalid_argument& err) { - wpi::util::print(stderr, "Error decoding HALSIMXRP_PORT ({})\n", err.what()); + wpi::util::print(stderr, "Error decoding HALSIMXRP_PORT ({})\n", + err.what()); return false; } } else { @@ -145,9 +146,9 @@ uv::SimpleBufferPool<4>& HALSimXRP::GetBufferPool() { void HALSimXRP::SendStateToXRP() { wpi::util::SmallVector sendBufs; wpi::net::raw_uv_ostream stream{sendBufs, [&] { - std::lock_guard lock(m_buffer_mutex); - return GetBufferPool().Allocate(); - }}; + std::lock_guard lock(m_buffer_mutex); + return GetBufferPool().Allocate(); + }}; m_xrp.SetupXRPSendBuffer(stream); m_exec->Send([this, sendBufs]() mutable { diff --git a/simulation/halsim_xrp/src/main/native/cpp/XRP.cpp b/simulation/halsim_xrp/src/main/native/cpp/XRP.cpp index 7757d62a1c..02183c65ac 100644 --- a/simulation/halsim_xrp/src/main/native/cpp/XRP.cpp +++ b/simulation/halsim_xrp/src/main/native/cpp/XRP.cpp @@ -15,7 +15,8 @@ using namespace wpilibxrp; XRP::XRP() - : m_gyro_name{"XRPGyro"}, m_wpilib_update_func([](const wpi::util::json&) {}) { + : m_gyro_name{"XRPGyro"}, + m_wpilib_update_func([](const wpi::util::json&) {}) { // Set up the inputs and outputs m_motor_outputs.emplace(0, 0.0f); m_motor_outputs.emplace(1, 0.0f); @@ -246,8 +247,8 @@ void XRP::SetupMotorTag(wpi::net::raw_uv_ostream& buf) { << static_cast(motor.first); // Channel // Convert the value - wpi::util::support::endian::write32be(value, - std::bit_cast(motor.second)); + wpi::util::support::endian::write32be( + value, std::bit_cast(motor.second)); buf << value[0] << value[1] << value[2] << value[3]; } } @@ -262,8 +263,8 @@ void XRP::SetupServoTag(wpi::net::raw_uv_ostream& buf) { << static_cast(servo.first); // Channel // Convert the value - wpi::util::support::endian::write32be(value, - std::bit_cast(servo.second)); + wpi::util::support::endian::write32be( + value, std::bit_cast(servo.second)); buf << value[0] << value[1] << value[2] << value[3]; } } @@ -374,7 +375,8 @@ void XRP::ReadEncoderTag(std::span packet) { period = -period; } - encJson["data"].push_back({wpi::util::json(">period"), wpi::util::json(period)}); + encJson["data"].push_back( + {wpi::util::json(">period"), wpi::util::json(period)}); } m_wpilib_update_func(encJson); diff --git a/tools/datalogtool/src/main/native/cpp/App.cpp b/tools/datalogtool/src/main/native/cpp/App.cpp index 47e8dd4427..62ef9cbcef 100644 --- a/tools/datalogtool/src/main/native/cpp/App.cpp +++ b/tools/datalogtool/src/main/native/cpp/App.cpp @@ -145,14 +145,15 @@ void Application(std::string_view saveDir) { wpi::glass::SetStorageName("datalogtool"); wpi::glass::SetStorageDir(saveDir.empty() ? gui::GetPlatformSaveFileDir() - : saveDir); + : saveDir); gui::AddWindowScaler([](float scale) { gDefaultScale = scale; }); gui::AddLateExecute(DisplayGui); gui::Initialize("Datalog Tool", 925, 510); - gDownloadVisible = - &wpi::glass::GetStorageRoot().GetChild("download").GetBool("visible", true); + gDownloadVisible = &wpi::glass::GetStorageRoot() + .GetChild("download") + .GetBool("visible", true); gui::Main(); diff --git a/tools/datalogtool/src/main/native/cpp/Downloader.cpp b/tools/datalogtool/src/main/native/cpp/Downloader.cpp index 3839c149a2..28fd49e3fb 100644 --- a/tools/datalogtool/src/main/native/cpp/Downloader.cpp +++ b/tools/datalogtool/src/main/native/cpp/Downloader.cpp @@ -286,7 +286,8 @@ void Downloader::ThreadMain() { try { switch (m_state) { case kConnecting: - if (auto team = wpi::util::parse_integer(m_serverTeam, 10)) { + if (auto team = + wpi::util::parse_integer(m_serverTeam, 10)) { // team number session = std::make_unique( fmt::format("roborio-{}-frc.local", team.value()), 22, diff --git a/tools/datalogtool/src/main/native/cpp/Downloader.hpp b/tools/datalogtool/src/main/native/cpp/Downloader.hpp index 94410a03fb..565ddafd32 100644 --- a/tools/datalogtool/src/main/native/cpp/Downloader.hpp +++ b/tools/datalogtool/src/main/native/cpp/Downloader.hpp @@ -14,7 +14,7 @@ namespace wpi::glass { class Storage; -} // namespace glass +} // namespace wpi::glass namespace pfd { class select_folder; diff --git a/tools/datalogtool/src/main/native/cpp/Exporter.cpp b/tools/datalogtool/src/main/native/cpp/Exporter.cpp index 0b28733fe2..24c0b2cc6e 100644 --- a/tools/datalogtool/src/main/native/cpp/Exporter.cpp +++ b/tools/datalogtool/src/main/native/cpp/Exporter.cpp @@ -103,7 +103,7 @@ static void RebuildEntryTree() { parts.emplace_back(prefix); } wpi::util::split(mainpart, '/', -1, false, - [&](auto part) { parts.emplace_back(part); }); + [&](auto part) { parts.emplace_back(part); }); // ignore a raw "/" key if (parts.empty()) { @@ -112,7 +112,8 @@ static void RebuildEntryTree() { // get to leaf auto nodes = &gEntryTree; - for (auto part : wpi::util::drop_back(std::span{parts.begin(), parts.end()})) { + for (auto part : + wpi::util::drop_back(std::span{parts.begin(), parts.end()})) { auto it = std::find_if(nodes->begin(), nodes->end(), [&](const auto& node) { return node.name == part; }); @@ -439,7 +440,8 @@ void DisplayEntries() { static wpi::util::mutex gExportMutex; static std::vector gExportErrors; -static void PrintEscapedCsvString(wpi::util::raw_ostream& os, std::string_view str) { +static void PrintEscapedCsvString(wpi::util::raw_ostream& os, + std::string_view str) { auto s = str; while (!s.empty()) { std::string_view fragment; @@ -461,8 +463,8 @@ static void ValueToCsv(wpi::util::raw_ostream& os, const Entry& entry, int64_t val; if (record.GetInteger(&val)) { std::time_t timeval = val / 1000000; - wpi::util::print(os, "{:%Y-%m-%d %H:%M:%S}.{:06}", *std::localtime(&timeval), - val % 1000000); + wpi::util::print(os, "{:%Y-%m-%d %H:%M:%S}.{:06}", + *std::localtime(&timeval), val % 1000000); return; } } else if (entry.type == "double") { diff --git a/tools/datalogtool/src/main/native/cpp/Exporter.hpp b/tools/datalogtool/src/main/native/cpp/Exporter.hpp index a0ca032a18..56229f1516 100644 --- a/tools/datalogtool/src/main/native/cpp/Exporter.hpp +++ b/tools/datalogtool/src/main/native/cpp/Exporter.hpp @@ -6,7 +6,7 @@ namespace wpi::glass { class Storage; -} // namespace glass +} // namespace wpi::glass void DisplayInputFiles(); void DisplayEntries(); diff --git a/tools/outlineviewer/src/main/native/cpp/main.cpp b/tools/outlineviewer/src/main/native/cpp/main.cpp index 8b2048e22d..41b5218148 100644 --- a/tools/outlineviewer/src/main/native/cpp/main.cpp +++ b/tools/outlineviewer/src/main/native/cpp/main.cpp @@ -63,7 +63,8 @@ static std::string MakeTitle(NT_Inst inst, wpi::nt::Event event) { static void NtInitialize() { auto inst = wpi::nt::GetDefaultInstance(); auto poller = wpi::nt::CreateListenerPoller(inst); - wpi::nt::AddPolledListener(poller, inst, NT_EVENT_CONNECTION | NT_EVENT_IMMEDIATE); + wpi::nt::AddPolledListener(poller, inst, + NT_EVENT_CONNECTION | NT_EVENT_IMMEDIATE); wpi::nt::AddPolledLogger(poller, NT_LOG_INFO, 100); gui::AddEarlyExecute([inst, poller] { auto win = gui::GetSystemWindow(); @@ -255,7 +256,7 @@ int main(int argc, char** argv) { wpi::glass::SetStorageName("outlineviewer"); wpi::glass::SetStorageDir(saveDir.empty() ? gui::GetPlatformSaveFileDir() - : saveDir); + : saveDir); gui::AddInit(NtInitialize); diff --git a/tools/sysid/src/main/native/cpp/App.cpp b/tools/sysid/src/main/native/cpp/App.cpp index 6ee8e6a576..f8c516ba07 100644 --- a/tools/sysid/src/main/native/cpp/App.cpp +++ b/tools/sysid/src/main/native/cpp/App.cpp @@ -70,7 +70,7 @@ void Application(std::string_view saveDir) { wpi::glass::SetStorageName("sysid"); wpi::glass::SetStorageDir(saveDir.empty() ? gui::GetPlatformSaveFileDir() - : saveDir); + : saveDir); // Add messages from the global sysid logger into the Log window. gLogger.SetLogger([](unsigned int level, const char* file, unsigned int line, diff --git a/tools/sysid/src/main/native/cpp/analysis/AnalysisManager.cpp b/tools/sysid/src/main/native/cpp/analysis/AnalysisManager.cpp index c4143009a3..9e5b1d1b04 100644 --- a/tools/sysid/src/main/native/cpp/analysis/AnalysisManager.cpp +++ b/tools/sysid/src/main/native/cpp/analysis/AnalysisManager.cpp @@ -37,7 +37,7 @@ static double Lerp(wpi::units::second_t time, const auto prev = next - 1; return wpi::util::Lerp(prev->measurement, next->measurement, - (time - prev->time) / (next->time - prev->time)); + (time - prev->time) / (next->time - prev->time)); } /** @@ -79,8 +79,8 @@ static std::vector ConvertToPrepared(const MotorData& data) { /** * To preserve a raw copy of the data, this method saves a raw version - * in the dataset wpi::util::StringMap where the key of the raw data starts with "raw-" - * before the name of the original data. + * in the dataset wpi::util::StringMap where the key of the raw data starts with + * "raw-" before the name of the original data. * * @tparam S The size of the array data that's being used * diff --git a/tools/sysid/src/main/native/cpp/analysis/ArmSim.cpp b/tools/sysid/src/main/native/cpp/analysis/ArmSim.cpp index 38eec15f1e..af6075e248 100644 --- a/tools/sysid/src/main/native/cpp/analysis/ArmSim.cpp +++ b/tools/sysid/src/main/native/cpp/analysis/ArmSim.cpp @@ -32,9 +32,9 @@ void ArmSim::Update(wpi::units::volt_t voltage, wpi::units::second_t dt) { auto f = [=, this]( const Eigen::Vector& x, const Eigen::Vector& u) -> Eigen::Vector { - return Eigen::Vector{ - x(1), (m_A * x.block<1, 1>(1, 0) + m_B * u + m_c * wpi::util::sgn(x(1)) + - m_d * std::cos(x(0) + m_offset))(0)}; + return Eigen::Vector{x(1), (m_A * x.block<1, 1>(1, 0) + m_B * u + + m_c * wpi::util::sgn(x(1)) + + m_d * std::cos(x(0) + m_offset))(0)}; }; // Max error is large because an accurate sim isn't as important as the sim @@ -56,7 +56,8 @@ double ArmSim::GetVelocity() const { double ArmSim::GetAcceleration(wpi::units::volt_t voltage) const { Eigen::Vector u{voltage.value()}; return (m_A * m_x.block<1, 1>(1, 0) + m_B * u + - m_c * wpi::util::sgn(GetVelocity()) + m_d * std::cos(m_x(0) + m_offset))(0); + m_c * wpi::util::sgn(GetVelocity()) + + m_d * std::cos(m_x(0) + m_offset))(0); } void ArmSim::Reset(double position, double velocity) { diff --git a/tools/sysid/src/main/native/cpp/analysis/ElevatorSim.cpp b/tools/sysid/src/main/native/cpp/analysis/ElevatorSim.cpp index f58d7d8fd2..0a673b2a74 100644 --- a/tools/sysid/src/main/native/cpp/analysis/ElevatorSim.cpp +++ b/tools/sysid/src/main/native/cpp/analysis/ElevatorSim.cpp @@ -28,8 +28,9 @@ void ElevatorSim::Update(wpi::units::volt_t voltage, wpi::units::second_t dt) { Eigen::Matrix Ad; Eigen::Matrix Bd; wpi::math::DiscretizeAB<2, 1>(m_A, m_B, dt, &Ad, &Bd); - m_x = Ad * m_x + Bd * u + - Bd * m_B.householderQr().solve(m_c * wpi::util::sgn(GetVelocity()) + m_d); + m_x = + Ad * m_x + Bd * u + + Bd * m_B.householderQr().solve(m_c * wpi::util::sgn(GetVelocity()) + m_d); } double ElevatorSim::GetPosition() const { diff --git a/tools/sysid/src/main/native/cpp/analysis/FeedbackAnalysis.cpp b/tools/sysid/src/main/native/cpp/analysis/FeedbackAnalysis.cpp index 6dc5edbf4d..3dcd9abc98 100644 --- a/tools/sysid/src/main/native/cpp/analysis/FeedbackAnalysis.cpp +++ b/tools/sysid/src/main/native/cpp/analysis/FeedbackAnalysis.cpp @@ -33,7 +33,7 @@ FeedbackGains sysid::CalculatePositionFeedbackGains( if (std::abs(Ka) < 1e-7) { // System has position state and velocity input wpi::math::LinearSystem<1, 1, 1> system{Matrix1d{0.0}, Matrix1d{1.0}, - Matrix1d{1.0}, Matrix1d{0.0}}; + Matrix1d{1.0}, Matrix1d{0.0}}; wpi::math::LinearQuadraticRegulator<1, 1> controller{ system, {params.qp}, {params.r}, preset.period}; @@ -43,16 +43,19 @@ FeedbackGains sysid::CalculatePositionFeedbackGains( return {Kv * controller.K(0, 0) * preset.outputConversionFactor, 0.0}; } - auto system = wpi::math::LinearSystemId::IdentifyPositionSystem( - Kv_t{Kv}, Ka_t{Ka}); + auto system = + wpi::math::LinearSystemId::IdentifyPositionSystem( + Kv_t{Kv}, Ka_t{Ka}); wpi::math::LinearQuadraticRegulator<2, 1> controller{ system, {params.qp, params.qv}, {params.r}, preset.period}; controller.LatencyCompensate(system, preset.period, preset.measurementDelay); - return {controller.K(0, 0) * preset.outputConversionFactor, - controller.K(0, 1) * preset.outputConversionFactor / - (preset.normalized ? 1 : wpi::units::second_t{preset.period}.value())}; + return { + controller.K(0, 0) * preset.outputConversionFactor, + controller.K(0, 1) * preset.outputConversionFactor / + (preset.normalized ? 1 + : wpi::units::second_t{preset.period}.value())}; } FeedbackGains sysid::CalculateVelocityFeedbackGains( @@ -69,8 +72,9 @@ FeedbackGains sysid::CalculateVelocityFeedbackGains( return {0.0, 0.0}; } - auto system = wpi::math::LinearSystemId::IdentifyVelocitySystem( - Kv_t{Kv}, Ka_t{Ka}); + auto system = + wpi::math::LinearSystemId::IdentifyVelocitySystem( + Kv_t{Kv}, Ka_t{Ka}); wpi::math::LinearQuadraticRegulator<1, 1> controller{ system, {params.qv}, {params.r}, preset.period}; controller.LatencyCompensate(system, preset.period, preset.measurementDelay); diff --git a/tools/sysid/src/main/native/cpp/analysis/FilteringUtils.cpp b/tools/sysid/src/main/native/cpp/analysis/FilteringUtils.cpp index c0d73662b2..cb30147b44 100644 --- a/tools/sysid/src/main/native/cpp/analysis/FilteringUtils.cpp +++ b/tools/sysid/src/main/native/cpp/analysis/FilteringUtils.cpp @@ -49,7 +49,8 @@ static void CheckSize(const std::vector& data, size_t window, * @return True, if the key corresponds to a raw dataset. */ static bool IsRaw(std::string_view key) { - return wpi::util::contains(key, "raw") && !wpi::util::contains(key, "original"); + return wpi::util::contains(key, "raw") && + !wpi::util::contains(key, "original"); } /** @@ -60,7 +61,8 @@ static bool IsRaw(std::string_view key) { * @return True, if the key corresponds to a filtered dataset. */ static bool IsFiltered(std::string_view key) { - return !wpi::util::contains(key, "raw") && !wpi::util::contains(key, "original"); + return !wpi::util::contains(key, "raw") && + !wpi::util::contains(key, "original"); } /** @@ -156,7 +158,8 @@ sysid::TrimStepVoltageData(std::vector* data, auto accelBegins = std::find_if( data->begin(), data->end(), [&maxAccel](const auto& measurement) { return wpi::util::sgn(measurement.velocity) * measurement.acceleration > - 0.8 * wpi::util::sgn(maxAccel->velocity) * maxAccel->acceleration; + 0.8 * wpi::util::sgn(maxAccel->velocity) * + maxAccel->acceleration; }); wpi::units::second_t velocityDelay; @@ -229,7 +232,8 @@ double sysid::GetMaxSpeed( return max; } -wpi::units::second_t sysid::GetMeanTimeDelta(const std::vector& data) { +wpi::units::second_t sysid::GetMeanTimeDelta( + const std::vector& data) { std::vector dts; for (const auto& pt : data) { @@ -342,8 +346,9 @@ void sysid::InitialTrimAndFilter( wpi::util::StringMap>* data, AnalysisManager::Settings* settings, std::vector& positionDelays, - std::vector& velocityDelays, wpi::units::second_t& minStepTime, - wpi::units::second_t& maxStepTime, std::string_view unit) { + std::vector& velocityDelays, + wpi::units::second_t& minStepTime, wpi::units::second_t& maxStepTime, + std::string_view unit) { auto& preparedData = *data; // Find the maximum Step Test Duration of the dynamic tests diff --git a/tools/sysid/src/main/native/cpp/analysis/SimpleMotorSim.cpp b/tools/sysid/src/main/native/cpp/analysis/SimpleMotorSim.cpp index 3265cea5cc..6891b9f3a5 100644 --- a/tools/sysid/src/main/native/cpp/analysis/SimpleMotorSim.cpp +++ b/tools/sysid/src/main/native/cpp/analysis/SimpleMotorSim.cpp @@ -17,7 +17,8 @@ SimpleMotorSim::SimpleMotorSim(double Ks, double Kv, double Ka, Reset(initialPosition, initialVelocity); } -void SimpleMotorSim::Update(wpi::units::volt_t voltage, wpi::units::second_t dt) { +void SimpleMotorSim::Update(wpi::units::volt_t voltage, + wpi::units::second_t dt) { Eigen::Vector u{voltage.value()}; // Given dx/dt = Ax + Bu + c sgn(x), diff --git a/tools/sysid/src/main/native/cpp/view/AnalyzerPlot.cpp b/tools/sysid/src/main/native/cpp/view/AnalyzerPlot.cpp index 1f5adcef6b..8ce2664c12 100644 --- a/tools/sysid/src/main/native/cpp/view/AnalyzerPlot.cpp +++ b/tools/sysid/src/main/native/cpp/view/AnalyzerPlot.cpp @@ -30,8 +30,8 @@ static ImPlotPoint Getter(int idx, void* data) { template static std::vector> PopulateTimeDomainSim( const std::vector& data, - const std::array& startTimes, size_t step, Model model, - double* simSquaredErrorSum, double* squaredVariationSum, + const std::array& startTimes, size_t step, + Model model, double* simSquaredErrorSum, double* squaredVariationSum, int* timeSeriesPoints) { // Create the vector of ImPlotPoints that will contain our simulated data. std::vector> pts; @@ -60,7 +60,8 @@ static std::vector> PopulateTimeDomainSim( continue; } - model.Update(wpi::units::volt_t{pre.voltage}, now.timestamp - pre.timestamp); + model.Update(wpi::units::volt_t{pre.voltage}, + now.timestamp - pre.timestamp); tmp.emplace_back((startTime + t).value(), model.GetVelocity()); *simSquaredErrorSum += std::pow(now.velocity - model.GetVelocity(), 2); *squaredVariationSum += std::pow(now.velocity, 2); @@ -128,11 +129,11 @@ void AnalyzerPlot::SetRawData(const Storage& data, std::string_view unit, SetRawTimeData(slow, fast, abort); } -void AnalyzerPlot::SetData(const Storage& rawData, const Storage& filteredData, - std::string_view unit, - const AnalysisManager::FeedforwardGains& ffGains, - const std::array& startTimes, - AnalysisType type, std::atomic& abort) { +void AnalyzerPlot::SetData( + const Storage& rawData, const Storage& filteredData, std::string_view unit, + const AnalysisManager::FeedforwardGains& ffGains, + const std::array& startTimes, AnalysisType type, + std::atomic& abort) { double simSquaredErrorSum = 0; double squaredVariationSum = 0; int timeSeriesPoints = 0; @@ -361,7 +362,8 @@ void AnalyzerPlot::SetData(const Storage& rawData, const Storage& filteredData, m_timestepData.fitLine[0] = ImPlotPoint{minTime.value(), wpi::units::millisecond_t{dtMean}.value()}; - auto maxTime = wpi::units::math::max(slow.back().timestamp, fast.back().timestamp); + auto maxTime = + wpi::units::math::max(slow.back().timestamp, fast.back().timestamp); m_timestepData.fitLine[1] = ImPlotPoint{maxTime.value(), wpi::units::millisecond_t{dtMean}.value()}; diff --git a/tools/sysid/src/main/native/cpp/view/DataSelector.cpp b/tools/sysid/src/main/native/cpp/view/DataSelector.cpp index c422bf26bb..bded4eb994 100644 --- a/tools/sysid/src/main/native/cpp/view/DataSelector.cpp +++ b/tools/sysid/src/main/native/cpp/view/DataSelector.cpp @@ -252,7 +252,8 @@ static void AddSamples(std::vector>& samples, [](const auto& datapoint, double val) { return datapoint.first < val; }); for (auto it = begin; it != end; ++it) { - samples.emplace_back(wpi::units::second_t{it->first * 1.0e-6}, T{it->second}); + samples.emplace_back(wpi::units::second_t{it->first * 1.0e-6}, + T{it->second}); } } diff --git a/tools/sysid/src/main/native/cpp/view/LogLoader.cpp b/tools/sysid/src/main/native/cpp/view/LogLoader.cpp index bbe3f35b09..40f400bfd8 100644 --- a/tools/sysid/src/main/native/cpp/view/LogLoader.cpp +++ b/tools/sysid/src/main/native/cpp/view/LogLoader.cpp @@ -130,7 +130,7 @@ void LogLoader::RebuildEntryTree() { parts.emplace_back(prefix); } wpi::util::split(mainpart, '/', -1, false, - [&](auto part) { parts.emplace_back(part); }); + [&](auto part) { parts.emplace_back(part); }); // ignore a raw "/" key if (parts.empty()) { @@ -139,7 +139,8 @@ void LogLoader::RebuildEntryTree() { // get to leaf auto nodes = &m_entryTree; - for (auto part : wpi::util::drop_back(std::span{parts.begin(), parts.end()})) { + for (auto part : + wpi::util::drop_back(std::span{parts.begin(), parts.end()})) { auto it = std::find_if(nodes->begin(), nodes->end(), [&](const auto& node) { return node.name == part; }); diff --git a/tools/sysid/src/main/native/include/wpi/sysid/analysis/FilteringUtils.hpp b/tools/sysid/src/main/native/include/wpi/sysid/analysis/FilteringUtils.hpp index a3ba5fa728..4b17dc4923 100644 --- a/tools/sysid/src/main/native/include/wpi/sysid/analysis/FilteringUtils.hpp +++ b/tools/sysid/src/main/native/include/wpi/sysid/analysis/FilteringUtils.hpp @@ -148,7 +148,8 @@ void ApplyMedianFilter(std::vector* data, int window); std::tuple TrimStepVoltageData(std::vector* data, AnalysisManager::Settings* settings, - wpi::units::second_t minStepTime, wpi::units::second_t maxStepTime); + wpi::units::second_t minStepTime, + wpi::units::second_t maxStepTime); /** * Compute the mean time delta of the given data. @@ -187,7 +188,8 @@ wpi::units::second_t GetMeanTimeDelta(const Storage& data); * @param period The period in seconds between samples taken by the user. */ template -wpi::math::LinearFilter CentralFiniteDifference(wpi::units::second_t period) { +wpi::math::LinearFilter CentralFiniteDifference( + wpi::units::second_t period) { static_assert(Samples % 2 != 0, "Number of samples must be odd."); // Generate stencil points from -(samples - 1)/2 to (samples - 1)/2 diff --git a/tools/sysid/src/main/native/include/wpi/sysid/view/Analyzer.hpp b/tools/sysid/src/main/native/include/wpi/sysid/view/Analyzer.hpp index 3f7676ed87..b00320657d 100644 --- a/tools/sysid/src/main/native/include/wpi/sysid/view/Analyzer.hpp +++ b/tools/sysid/src/main/native/include/wpi/sysid/view/Analyzer.hpp @@ -27,7 +27,7 @@ struct ImPlotPoint; namespace wpi::glass { class Storage; -} // namespace glass +} // namespace wpi::glass namespace sysid { /** diff --git a/tools/sysid/src/main/native/include/wpi/sysid/view/DataSelector.hpp b/tools/sysid/src/main/native/include/wpi/sysid/view/DataSelector.hpp index 4bbb44c989..af9aa92547 100644 --- a/tools/sysid/src/main/native/include/wpi/sysid/view/DataSelector.hpp +++ b/tools/sysid/src/main/native/include/wpi/sysid/view/DataSelector.hpp @@ -19,7 +19,7 @@ namespace wpi::glass { class Storage; -} // namespace glass +} // namespace wpi::glass namespace wpi { namespace log { @@ -27,7 +27,7 @@ class DataLogReaderEntry; } // namespace log namespace util { class Logger; -} +} // namespace util } // namespace wpi namespace sysid { diff --git a/tools/sysid/src/main/native/include/wpi/sysid/view/LogLoader.hpp b/tools/sysid/src/main/native/include/wpi/sysid/view/LogLoader.hpp index bc56267242..3246a3084b 100644 --- a/tools/sysid/src/main/native/include/wpi/sysid/view/LogLoader.hpp +++ b/tools/sysid/src/main/native/include/wpi/sysid/view/LogLoader.hpp @@ -14,7 +14,7 @@ namespace wpi::glass { class Storage; -} // namespace glass +} // namespace wpi::glass namespace pfd { class open_file; @@ -27,7 +27,7 @@ class DataLogReaderThread; } // namespace log namespace util { class Logger; -} +} // namespace util } // namespace wpi namespace sysid { diff --git a/tools/sysid/src/test/native/cpp/analysis/FilterTest.cpp b/tools/sysid/src/test/native/cpp/analysis/FilterTest.cpp index 18ac82f3cd..ce59564ece 100644 --- a/tools/sysid/src/test/native/cpp/analysis/FilterTest.cpp +++ b/tools/sysid/src/test/native/cpp/analysis/FilterTest.cpp @@ -136,8 +136,8 @@ TEST(FilterTest, StepTrim) { } template -void AssertCentralResults(F&& f, DfDx&& dfdx, wpi::units::second_t h, double min, - double max) { +void AssertCentralResults(F&& f, DfDx&& dfdx, wpi::units::second_t h, + double min, double max) { static_assert(Samples % 2 != 0, "Number of samples must be odd."); auto filter = sysid::CentralFiniteDifference(h); diff --git a/tools/wpical/src/main/native/cpp/fieldcalibration.cpp b/tools/wpical/src/main/native/cpp/fieldcalibration.cpp index 38e00c6b7e..e11405b426 100644 --- a/tools/wpical/src/main/native/cpp/fieldcalibration.cpp +++ b/tools/wpical/src/main/native/cpp/fieldcalibration.cpp @@ -150,7 +150,8 @@ inline cameracalibration::CameraModel load_camera_model(std::string path) { return camera_model; } -inline cameracalibration::CameraModel load_camera_model(wpi::util::json json_data) { +inline cameracalibration::CameraModel load_camera_model( + wpi::util::json json_data) { // Camera matrix Eigen::Matrix camera_matrix; diff --git a/upstream_utils/llvm.py b/upstream_utils/llvm.py index 6f7786c007..50787e2257 100755 --- a/upstream_utils/llvm.py +++ b/upstream_utils/llvm.py @@ -20,8 +20,12 @@ def run_global_replacements(wpiutil_llvm_files: list[Path]): content = content.replace('include "llvm/ADT', 'include "wpi/util') content = content.replace('include "llvm/Config', 'include "wpi/util') content = content.replace('include "llvm/Support', 'include "wpi/util') - content = content.replace('include "CountCopyAndMove.h"', 'include "CountCopyAndMove.hpp"') - content = content.replace('include "Windows/WindowsSupport.h"', 'include "Windows/WindowsSupport.hpp"') + content = content.replace( + 'include "CountCopyAndMove.h"', 'include "CountCopyAndMove.hpp"' + ) + content = content.replace( + 'include "Windows/WindowsSupport.h"', 'include "Windows/WindowsSupport.hpp"' + ) # Fix uses of span content = content.replace("span", "std::span") @@ -83,7 +87,9 @@ def run_global_replacements(wpiutil_llvm_files: list[Path]): content = content.replace("llvm_is_multithreaded()", "1") # Revert message in copyright header - content = content.replace("/// Defines the wpi::util::", "/// Defines the llvm::") + content = content.replace( + "/// Defines the wpi::util::", "/// Defines the llvm::" + ) content = content.replace("// end llvm namespace", "// end wpi::util namespace") content = content.replace("// end namespace llvm", "// end namespace wpi::util") content = content.replace("// End llvm namespace", "// End wpi::util namespace") @@ -91,7 +97,9 @@ def run_global_replacements(wpiutil_llvm_files: list[Path]): content = content.replace("fs::openFileForRead", "fs::OpenFileForRead") # Handle move from .h -> .hpp - content = re.sub('#include "wpi/util/(.*).h"', r'#include "wpi/util/\1.hpp"', content) + content = re.sub( + '#include "wpi/util/(.*).h"', r'#include "wpi/util/\1.hpp"', content + ) with open(wpi_file, "w") as f: f.write(content) @@ -137,7 +145,7 @@ def overwrite_files(wpiutil_files: list[Path], llvm_files: dict[str, Path]): wpi_base_name = wpi_file.name if wpi_file.suffix == ".hpp": wpi_base_name = wpi_file.with_suffix(".h").name - + if wpi_base_name in llvm_files: if wpi_file.suffix == ".h": shutil.copyfile(llvm_files[wpi_base_name], wpi_file.with_suffix(".hpp")) diff --git a/wpilibc/src/main/native/cpp/ExpansionHub.cpp b/wpilibc/src/main/native/cpp/ExpansionHub.cpp index d737713f8c..386ebf8c9c 100644 --- a/wpilibc/src/main/native/cpp/ExpansionHub.cpp +++ b/wpilibc/src/main/native/cpp/ExpansionHub.cpp @@ -44,7 +44,7 @@ class ExpansionHub::DataStore { std::shared_ptr ExpansionHub::GetForUsbId(int usbId) { WPILIB_AssertMessage(usbId >= 0 && usbId < NumUsbPorts, "USB {} out of range", - usbId); + usbId); std::scoped_lock lock{m_handleLock}; std::weak_ptr& weakStore = m_storeMap[usbId]; auto strongStore = weakStore.lock(); diff --git a/wpilibc/src/main/native/cpp/ExpansionHubMotor.cpp b/wpilibc/src/main/native/cpp/ExpansionHubMotor.cpp index 2a21df3182..11f68aeaab 100644 --- a/wpilibc/src/main/native/cpp/ExpansionHubMotor.cpp +++ b/wpilibc/src/main/native/cpp/ExpansionHubMotor.cpp @@ -21,10 +21,11 @@ ExpansionHubMotor::ExpansionHubMotor(int usbId, int channel) m_velocityPidConstants{usbId, channel, true}, m_positionPidConstants{usbId, channel, false} { WPILIB_AssertMessage(channel >= 0 && channel < ExpansionHub::NumMotorPorts, - "ExHub Motor Channel {} out of range", channel); + "ExHub Motor Channel {} out of range", channel); if (!m_hub.CheckAndReserveMotor(channel)) { - throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", channel); + throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", + channel); } m_hub.ReportUsage(fmt::format("ExHubServo[{}]", channel), "ExHubServo"); @@ -154,7 +155,7 @@ ExpansionHubPidConstants& ExpansionHubMotor::GetPositionPidConstants() { void ExpansionHubMotor::Follow(const ExpansionHubMotor& leader) { if (m_hub.GetUsbId() != leader.m_hub.GetUsbId()) { throw WPILIB_MakeError(err::InvalidParameter, - "Cannot follow motor on different hub"); + "Cannot follow motor on different hub"); } m_modePublisher.Set(kFollowerMode); m_setpointPublisher.Set(leader.m_channel); diff --git a/wpilibc/src/main/native/cpp/ExpansionHubServo.cpp b/wpilibc/src/main/native/cpp/ExpansionHubServo.cpp index 04ea224303..2e9fbc46d5 100644 --- a/wpilibc/src/main/native/cpp/ExpansionHubServo.cpp +++ b/wpilibc/src/main/native/cpp/ExpansionHubServo.cpp @@ -12,10 +12,11 @@ using namespace wpi; ExpansionHubServo::ExpansionHubServo(int usbId, int channel) : m_hub{usbId}, m_channel{channel} { WPILIB_AssertMessage(channel >= 0 && channel < ExpansionHub::NumServoPorts, - "ExHub Servo Channel {} out of range", channel); + "ExHub Servo Channel {} out of range", channel); if (!m_hub.CheckAndReserveServo(channel)) { - throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", channel); + throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", + channel); } m_hub.ReportUsage(fmt::format("ExHubServo[{}]", channel), "ExHubServo"); @@ -98,7 +99,7 @@ void ExpansionHubServo::SetPWMRange(wpi::units::microsecond_t minPwm, wpi::units::microsecond_t maxPwm) { if (maxPwm <= minPwm) { throw WPILIB_MakeError(err::ParameterOutOfRange, - "Max PWM must be greater than Min PWM"); + "Max PWM must be greater than Min PWM"); } m_minPwm = minPwm; m_maxPwm = maxPwm; @@ -110,7 +111,7 @@ void ExpansionHubServo::SetAngleRange(wpi::units::degree_t minAngle, wpi::units::degree_t maxAngle) { if (maxAngle <= minAngle) { throw WPILIB_MakeError(err::ParameterOutOfRange, - "Max angle must be greater than Min angle"); + "Max angle must be greater than Min angle"); } m_minServoAngle = minAngle; m_maxServoAngle = maxAngle; diff --git a/wpilibc/src/main/native/cpp/counter/Tachometer.cpp b/wpilibc/src/main/native/cpp/counter/Tachometer.cpp index 75dc55e50b..f41c2d1abe 100644 --- a/wpilibc/src/main/native/cpp/counter/Tachometer.cpp +++ b/wpilibc/src/main/native/cpp/counter/Tachometer.cpp @@ -69,7 +69,8 @@ wpi::units::turns_per_second_t Tachometer::GetRevolutionsPerSecond() const { return wpi::units::turns_per_second_t{rotationHz.value()}; } -wpi::units::revolutions_per_minute_t Tachometer::GetRevolutionsPerMinute() const { +wpi::units::revolutions_per_minute_t Tachometer::GetRevolutionsPerMinute() + const { return wpi::units::revolutions_per_minute_t{GetRevolutionsPerSecond()}; } diff --git a/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp b/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp index 93711c60a0..db0710fdb2 100644 --- a/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/MecanumDrive.cpp @@ -49,7 +49,8 @@ MecanumDrive::MecanumDrive(std::function frontLeftMotor, } void MecanumDrive::DriveCartesian(double xSpeed, double ySpeed, - double zRotation, wpi::math::Rotation2d gyroAngle) { + double zRotation, + wpi::math::Rotation2d gyroAngle) { if (!reported) { HAL_ReportUsage("RobotDrive", "MecanumCartesian"); reported = true; @@ -99,17 +100,17 @@ void MecanumDrive::StopMotor() { Feed(); } -MecanumDrive::WheelSpeeds MecanumDrive::DriveCartesianIK(double xSpeed, - double ySpeed, - double zRotation, - wpi::math::Rotation2d gyroAngle) { +MecanumDrive::WheelSpeeds MecanumDrive::DriveCartesianIK( + double xSpeed, double ySpeed, double zRotation, + wpi::math::Rotation2d gyroAngle) { xSpeed = std::clamp(xSpeed, -1.0, 1.0); ySpeed = std::clamp(ySpeed, -1.0, 1.0); // Compensate for gyro angle. - auto input = - wpi::math::Translation2d{wpi::units::meter_t{xSpeed}, wpi::units::meter_t{ySpeed}}.RotateBy( - -gyroAngle); + auto input = wpi::math::Translation2d{ + wpi::units::meter_t{xSpeed}, + wpi::units::meter_t{ + ySpeed}}.RotateBy(-gyroAngle); double wheelSpeeds[4]; wheelSpeeds[kFrontLeft] = input.X().value() + input.Y().value() + zRotation; diff --git a/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp b/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp index 26fcec7993..e03c97a150 100644 --- a/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/DriverStation.cpp @@ -45,10 +45,10 @@ namespace { template class MatchDataSenderEntry { public: - MatchDataSenderEntry(const std::shared_ptr& table, - std::string_view key, - typename Topic::ParamType initialVal, - wpi::util::json topicProperties = wpi::util::json::object()) + MatchDataSenderEntry( + const std::shared_ptr& table, std::string_view key, + typename Topic::ParamType initialVal, + wpi::util::json topicProperties = wpi::util::json::object()) : publisher{Topic{table->GetTopic(key)}.PublishEx(Topic::kTypeString, topicProperties)}, prevVal{initialVal} { @@ -80,13 +80,17 @@ struct MatchDataSender { MatchDataSenderEntry gameSpecificMessage{ table, "GameSpecificMessage", ""}; MatchDataSenderEntry eventName{table, "EventName", ""}; - MatchDataSenderEntry matchNumber{table, "MatchNumber", 0}; - MatchDataSenderEntry replayNumber{table, "ReplayNumber", 0}; + MatchDataSenderEntry matchNumber{table, "MatchNumber", + 0}; + MatchDataSenderEntry replayNumber{table, + "ReplayNumber", 0}; MatchDataSenderEntry matchType{table, "MatchType", 0}; - MatchDataSenderEntry alliance{table, "IsRedAlliance", true}; - MatchDataSenderEntry station{table, "StationNumber", 1}; - MatchDataSenderEntry controlWord{table, "FMSControlData", - 0}; + MatchDataSenderEntry alliance{table, "IsRedAlliance", + true}; + MatchDataSenderEntry station{table, "StationNumber", + 1}; + MatchDataSenderEntry controlWord{table, + "FMSControlData", 0}; }; class JoystickLogSender { @@ -206,7 +210,8 @@ bool DriverStation::GetStickButton(int stick, int button) { return false; } if (button < 0 || button >= 64) { - WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", button); + WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", + button); return false; } @@ -234,7 +239,8 @@ std::optional DriverStation::GetStickButtonIfAvailable(int stick, return false; } if (button < 0 || button >= 64) { - WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", button); + WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", + button); return false; } @@ -256,7 +262,8 @@ bool DriverStation::GetStickButtonPressed(int stick, int button) { return false; } if (button < 0 || button >= 64) { - WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", button); + WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", + button); return false; } @@ -289,7 +296,8 @@ bool DriverStation::GetStickButtonReleased(int stick, int button) { return false; } if (button < 0 || button >= 64) { - WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", button); + WPILIB_ReportError(warn::BadJoystickIndex, "button {} out of range", + button); return false; } diff --git a/wpilibc/src/main/native/cpp/driverstation/GenericHID.cpp b/wpilibc/src/main/native/cpp/driverstation/GenericHID.cpp index e73bc9dbf4..1a6c1b10b2 100644 --- a/wpilibc/src/main/native/cpp/driverstation/GenericHID.cpp +++ b/wpilibc/src/main/native/cpp/driverstation/GenericHID.cpp @@ -15,7 +15,8 @@ using namespace wpi; GenericHID::GenericHID(int port) { if (port < 0 || port >= DriverStation::kJoystickPorts) { - throw WPILIB_MakeError(warn::BadJoystickIndex, "port {} out of range", port); + throw WPILIB_MakeError(warn::BadJoystickIndex, "port {} out of range", + port); } m_port = port; } diff --git a/wpilibc/src/main/native/cpp/event/EventLoop.cpp b/wpilibc/src/main/native/cpp/event/EventLoop.cpp index 90df5a66d3..4281239a42 100644 --- a/wpilibc/src/main/native/cpp/event/EventLoop.cpp +++ b/wpilibc/src/main/native/cpp/event/EventLoop.cpp @@ -25,7 +25,7 @@ EventLoop::EventLoop() {} void EventLoop::Bind(wpi::util::unique_function action) { if (m_running) { throw WPILIB_MakeError(err::Error, - "Cannot bind EventLoop while it is running"); + "Cannot bind EventLoop while it is running"); } m_bindings.emplace_back(std::move(action)); } @@ -40,7 +40,7 @@ void EventLoop::Poll() { void EventLoop::Clear() { if (m_running) { throw WPILIB_MakeError(err::Error, - "Cannot clear EventLoop while it is running"); + "Cannot clear EventLoop while it is running"); } m_bindings.clear(); } diff --git a/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp b/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp index e4a12a94c5..65875661b2 100644 --- a/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp +++ b/wpilibc/src/main/native/cpp/hardware/accelerometer/ADXL345_I2C.cpp @@ -15,9 +15,9 @@ ADXL345_I2C::ADXL345_I2C(I2C::Port port, Range range, int deviceAddress) : m_i2c(port, deviceAddress), m_simDevice("Accel:ADXL345_I2C", port, deviceAddress) { if (m_simDevice) { - m_simRange = m_simDevice.CreateEnumDouble("range", wpi::hal::SimDevice::kOutput, - {"2G", "4G", "8G", "16G"}, - {2.0, 4.0, 8.0, 16.0}, 0); + m_simRange = m_simDevice.CreateEnumDouble( + "range", wpi::hal::SimDevice::kOutput, {"2G", "4G", "8G", "16G"}, + {2.0, 4.0, 8.0, 16.0}, 0); m_simX = m_simDevice.CreateDouble("x", wpi::hal::SimDevice::kInput, 0.0); m_simY = m_simDevice.CreateDouble("y", wpi::hal::SimDevice::kInput, 0.0); m_simZ = m_simDevice.CreateDouble("z", wpi::hal::SimDevice::kInput, 0.0); diff --git a/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp b/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp index 05024d7d2a..66742492a0 100644 --- a/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp +++ b/wpilibc/src/main/native/cpp/hardware/accelerometer/AnalogAccelerometer.cpp @@ -55,5 +55,5 @@ void AnalogAccelerometer::InitAccelerometer() { HAL_ReportUsage("IO", m_analogInput->GetChannel(), "Accelerometer"); wpi::util::SendableRegistry::Add(this, "Accelerometer", - m_analogInput->GetChannel()); + m_analogInput->GetChannel()); } diff --git a/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp b/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp index 09cde472cd..0ef8f374cb 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/CAN.cpp @@ -23,7 +23,7 @@ CAN::CAN(int busId, int deviceId, int deviceManufacturer, int deviceType) { busId, static_cast(deviceManufacturer), deviceId, static_cast(deviceType), &status); WPILIB_CheckErrorStatus(status, "device id {} mfg {} type {}", deviceId, - deviceManufacturer, deviceType); + deviceManufacturer, deviceType); HAL_ReportUsage( fmt::format("CAN[{}][{}][{}]", deviceType, deviceManufacturer, deviceId), diff --git a/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp b/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp index 7bf4b3d82c..50f5e23fd8 100644 --- a/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp +++ b/wpilibc/src/main/native/cpp/hardware/bus/SerialPort.cpp @@ -25,10 +25,11 @@ SerialPort::SerialPort(int baudRate, Port port, int dataBits, HAL_SetSerialDataBits(m_portHandle, dataBits, &status); WPILIB_CheckErrorStatus(status, "SetSerialDataBits {}", dataBits); HAL_SetSerialParity(m_portHandle, parity, &status); - WPILIB_CheckErrorStatus(status, "SetSerialParity {}", static_cast(parity)); + WPILIB_CheckErrorStatus(status, "SetSerialParity {}", + static_cast(parity)); HAL_SetSerialStopBits(m_portHandle, stopBits, &status); WPILIB_CheckErrorStatus(status, "SetSerialStopBits {}", - static_cast(stopBits)); + static_cast(stopBits)); // Set the default timeout to 5 seconds. SetTimeout(5_s); @@ -55,10 +56,11 @@ SerialPort::SerialPort(int baudRate, std::string_view portName, Port port, HAL_SetSerialDataBits(m_portHandle, dataBits, &status); WPILIB_CheckErrorStatus(status, "SetSerialDataBits {}", dataBits); HAL_SetSerialParity(m_portHandle, parity, &status); - WPILIB_CheckErrorStatus(status, "SetSerialParity {}", static_cast(parity)); + WPILIB_CheckErrorStatus(status, "SetSerialParity {}", + static_cast(parity)); HAL_SetSerialStopBits(m_portHandle, stopBits, &status); WPILIB_CheckErrorStatus(status, "SetSerialStopBits {}", - static_cast(stopBits)); + static_cast(stopBits)); // Set the default timeout to 5 seconds. SetTimeout(5_s); @@ -75,7 +77,7 @@ void SerialPort::SetFlowControl(SerialPort::FlowControl flowControl) { int32_t status = 0; HAL_SetSerialFlowControl(m_portHandle, flowControl, &status); WPILIB_CheckErrorStatus(status, "SetFlowControl {}", - static_cast(flowControl)); + static_cast(flowControl)); } void SerialPort::EnableTermination(char terminator) { @@ -137,7 +139,8 @@ void SerialPort::SetWriteBufferSize(int size) { void SerialPort::SetWriteBufferMode(SerialPort::WriteBufferMode mode) { int32_t status = 0; HAL_SetSerialWriteMode(m_portHandle, mode, &status); - WPILIB_CheckErrorStatus(status, "SetWriteBufferMode {}", static_cast(mode)); + WPILIB_CheckErrorStatus(status, "SetWriteBufferMode {}", + static_cast(mode)); } void SerialPort::Flush() { diff --git a/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp b/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp index 0c9c5d42dc..3f36791860 100644 --- a/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp +++ b/wpilibc/src/main/native/cpp/hardware/discrete/PWM.cpp @@ -82,7 +82,7 @@ void PWM::SetOutputPeriod(OutputPeriod mult) { break; default: throw WPILIB_MakeError(err::InvalidParameter, "OutputPeriod value {}", - static_cast(mult)); + static_cast(mult)); } WPILIB_CheckErrorStatus(status, "Channel {}", m_channel); @@ -101,5 +101,7 @@ void PWM::InitSendable(wpi::util::SendableBuilder& builder) { builder.SetActuator(true); builder.AddDoubleProperty( "Value", [=, this] { return GetPulseTime().value(); }, - [=, this](double value) { SetPulseTime(wpi::units::millisecond_t{value}); }); + [=, this](double value) { + SetPulseTime(wpi::units::millisecond_t{value}); + }); } diff --git a/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp b/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp index cbc04f621c..c4b05d5ecb 100644 --- a/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp +++ b/wpilibc/src/main/native/cpp/hardware/led/LEDPattern.cpp @@ -55,7 +55,7 @@ LEDPattern LEDPattern::Reversed() { LEDPattern LEDPattern::OffsetBy(int offset) { return MapIndex([offset](size_t bufLen, size_t i) { return wpi::math::FloorMod(static_cast(i) + offset, - static_cast(bufLen)); + static_cast(bufLen)); }); } @@ -74,7 +74,7 @@ LEDPattern LEDPattern::ScrollAtRelativeSpeed(wpi::units::hertz_t velocity) { int offset = static_cast(std::floor(t * bufLen)); return wpi::math::FloorMod(static_cast(i) + offset, - static_cast(bufLen)); + static_cast(bufLen)); }); } @@ -95,11 +95,12 @@ LEDPattern LEDPattern::ScrollAtAbsoluteSpeed( auto offset = static_cast(now) / microsPerLed; return wpi::math::FloorMod(static_cast(i) + offset, - static_cast(bufLen)); + static_cast(bufLen)); }); } -LEDPattern LEDPattern::Blink(wpi::units::second_t onTime, wpi::units::second_t offTime) { +LEDPattern LEDPattern::Blink(wpi::units::second_t onTime, + wpi::units::second_t offTime) { auto totalMicros = wpi::units::microsecond_t{onTime + offTime}.to(); auto onMicros = wpi::units::microsecond_t{onTime}.to(); diff --git a/wpilibc/src/main/native/cpp/hardware/motor/MotorSafety.cpp b/wpilibc/src/main/native/cpp/hardware/motor/MotorSafety.cpp index 93c21dc790..70b5226752 100644 --- a/wpilibc/src/main/native/cpp/hardware/motor/MotorSafety.cpp +++ b/wpilibc/src/main/native/cpp/hardware/motor/MotorSafety.cpp @@ -158,18 +158,20 @@ void MotorSafety::Check() { } if (stopTime < Timer::GetFPGATimestamp()) { - WPILIB_ReportError(err::Timeout, - "{}... Output not updated often enough. See " - "https://docs.wpilib.org/motorsafety for more information.", - GetDescription()); + WPILIB_ReportError( + err::Timeout, + "{}... Output not updated often enough. See " + "https://docs.wpilib.org/motorsafety for more information.", + GetDescription()); try { StopMotor(); } catch (wpi::RuntimeError& e) { e.Report(); } catch (std::exception& e) { - WPILIB_ReportError(err::Error, "{} StopMotor threw unexpected exception: {}", - GetDescription(), e.what()); + WPILIB_ReportError(err::Error, + "{} StopMotor threw unexpected exception: {}", + GetDescription(), e.what()); } } } diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/Compressor.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/Compressor.cpp index a71800de39..8044f4f97e 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/Compressor.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/Compressor.cpp @@ -63,13 +63,15 @@ void Compressor::EnableDigital() { m_module->EnableCompressorDigital(); } -void Compressor::EnableAnalog(wpi::units::pounds_per_square_inch_t minPressure, - wpi::units::pounds_per_square_inch_t maxPressure) { +void Compressor::EnableAnalog( + wpi::units::pounds_per_square_inch_t minPressure, + wpi::units::pounds_per_square_inch_t maxPressure) { m_module->EnableCompressorAnalog(minPressure, maxPressure); } -void Compressor::EnableHybrid(wpi::units::pounds_per_square_inch_t minPressure, - wpi::units::pounds_per_square_inch_t maxPressure) { +void Compressor::EnableHybrid( + wpi::units::pounds_per_square_inch_t minPressure, + wpi::units::pounds_per_square_inch_t maxPressure) { m_module->EnableCompressorHybrid(minPressure, maxPressure); } diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/DoubleSolenoid.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/DoubleSolenoid.cpp index 008a0763d9..5f335a9732 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/DoubleSolenoid.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/DoubleSolenoid.cpp @@ -23,11 +23,11 @@ DoubleSolenoid::DoubleSolenoid(int busId, int module, m_reverseChannel{reverseChannel} { if (!m_module->CheckSolenoidChannel(m_forwardChannel)) { throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "Channel {}", - m_forwardChannel); + m_forwardChannel); } if (!m_module->CheckSolenoidChannel(m_reverseChannel)) { throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "Channel {}", - m_reverseChannel); + m_reverseChannel); } m_forwardMask = 1 << forwardChannel; @@ -37,14 +37,15 @@ DoubleSolenoid::DoubleSolenoid(int busId, int module, int allocMask = m_module->CheckAndReserveSolenoids(m_mask); if (allocMask != 0) { if (allocMask == m_mask) { - throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channels {} and {}", - m_forwardChannel, m_reverseChannel); + throw WPILIB_MakeError(err::ResourceAlreadyAllocated, + "Channels {} and {}", m_forwardChannel, + m_reverseChannel); } else if (allocMask == m_forwardMask) { throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", - m_forwardChannel); + m_forwardChannel); } else { throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", - m_reverseChannel); + m_reverseChannel); } } @@ -52,8 +53,8 @@ DoubleSolenoid::DoubleSolenoid(int busId, int module, fmt::format("Solenoid[{},{}]", m_forwardChannel, m_reverseChannel), "DoubleSolenoid"); - wpi::util::SendableRegistry::Add(this, "DoubleSolenoid", - m_module->GetModuleNumber(), m_forwardChannel); + wpi::util::SendableRegistry::Add( + this, "DoubleSolenoid", m_module->GetModuleNumber(), m_forwardChannel); } DoubleSolenoid::DoubleSolenoid(int busId, PneumaticsModuleType moduleType, diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp index caf0009d36..2adce3e2b5 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticHub.cpp @@ -26,21 +26,22 @@ using namespace wpi; /** Converts volts to PSI per the REV Analog Pressure Sensor datasheet. */ -wpi::units::pounds_per_square_inch_t VoltsToPSI(wpi::units::volt_t sensorVoltage, - wpi::units::volt_t supplyVoltage) { +wpi::units::pounds_per_square_inch_t VoltsToPSI( + wpi::units::volt_t sensorVoltage, wpi::units::volt_t supplyVoltage) { return wpi::units::pounds_per_square_inch_t{ 250 * (sensorVoltage.value() / supplyVoltage.value()) - 25}; } /** Converts PSI to volts per the REV Analog Pressure Sensor datasheet. */ wpi::units::volt_t PSIToVolts(wpi::units::pounds_per_square_inch_t pressure, - wpi::units::volt_t supplyVoltage) { + wpi::units::volt_t supplyVoltage) { return wpi::units::volt_t{supplyVoltage.value() * - (0.004 * pressure.value() + 0.1)}; + (0.004 * pressure.value() + 0.1)}; } wpi::util::mutex PneumaticHub::m_handleLock; -std::unique_ptr>[]> +std::unique_ptr< + wpi::util::DenseMap>[]> PneumaticHub::m_handleMaps = nullptr; // Always called under lock, so we can avoid the double lock from the magic @@ -49,10 +50,11 @@ std::weak_ptr& PneumaticHub::GetDataStore(int busId, int module) { int32_t numBuses = HAL_GetNumCanBuses(); WPILIB_AssertMessage(busId >= 0 && busId < numBuses, - "Bus {} out of range. Must be [0-{}).", busId, numBuses); + "Bus {} out of range. Must be [0-{}).", busId, numBuses); if (!m_handleMaps) { m_handleMaps = std::make_unique< - wpi::util::DenseMap>[]>(numBuses); + wpi::util::DenseMap>[]>( + numBuses); } return m_handleMaps[busId][module]; } @@ -138,17 +140,17 @@ void PneumaticHub::EnableCompressorAnalog( wpi::units::pounds_per_square_inch_t maxPressure) { if (minPressure >= maxPressure) { throw WPILIB_MakeError(err::InvalidParameter, - "maxPressure must be greater than minPressure"); + "maxPressure must be greater than minPressure"); } if (minPressure < 0_psi || minPressure > 120_psi) { throw WPILIB_MakeError(err::ParameterOutOfRange, - "minPressure must be between 0 and 120 PSI, got {}", - minPressure); + "minPressure must be between 0 and 120 PSI, got {}", + minPressure); } if (maxPressure < 0_psi || maxPressure > 120_psi) { throw WPILIB_MakeError(err::ParameterOutOfRange, - "maxPressure must be between 0 and 120 PSI, got {}", - maxPressure); + "maxPressure must be between 0 and 120 PSI, got {}", + maxPressure); } // Send the voltage as it would be if the 5V rail was at exactly 5V. @@ -168,17 +170,17 @@ void PneumaticHub::EnableCompressorHybrid( wpi::units::pounds_per_square_inch_t maxPressure) { if (minPressure >= maxPressure) { throw WPILIB_MakeError(err::InvalidParameter, - "maxPressure must be greater than minPressure"); + "maxPressure must be greater than minPressure"); } if (minPressure < 0_psi || minPressure > 120_psi) { throw WPILIB_MakeError(err::ParameterOutOfRange, - "minPressure must be between 0 and 120 PSI, got {}", - minPressure); + "minPressure must be between 0 and 120 PSI, got {}", + minPressure); } if (maxPressure < 0_psi || maxPressure > 120_psi) { throw WPILIB_MakeError(err::ParameterOutOfRange, - "maxPressure must be between 0 and 120 PSI, got {}", - maxPressure); + "maxPressure must be between 0 and 120 PSI, got {}", + maxPressure); } // Send the voltage as it would be if the 5V rail was at exactly 5V. @@ -245,7 +247,8 @@ void PneumaticHub::FireOneShot(int index) { WPILIB_ReportError(status, "Module {}", m_module); } -void PneumaticHub::SetOneShotDuration(int index, wpi::units::second_t duration) { +void PneumaticHub::SetOneShotDuration(int index, + wpi::units::second_t duration) { m_dataStore->m_oneShotDurMs[index] = duration; } @@ -360,7 +363,7 @@ bool PneumaticHub::Faults::GetChannelFault(int channel) const { return Channel15Fault != 0; default: throw WPILIB_MakeError(err::ChannelIndexOutOfRange, - "Pneumatics fault channel out of bounds!"); + "Pneumatics fault channel out of bounds!"); } } @@ -405,13 +408,15 @@ wpi::units::volt_t PneumaticHub::GetAnalogVoltage(int channel) const { return wpi::units::volt_t{voltage}; } -wpi::units::pounds_per_square_inch_t PneumaticHub::GetPressure(int channel) const { +wpi::units::pounds_per_square_inch_t PneumaticHub::GetPressure( + int channel) const { int32_t status = 0; auto sensorVoltage = HAL_GetREVPHAnalogVoltage(m_handle, channel, &status); WPILIB_ReportError(status, "Module {}", m_module); auto supplyVoltage = HAL_GetREVPH5VVoltage(m_handle, &status); WPILIB_ReportError(status, "Module {}", m_module); - return VoltsToPSI(wpi::units::volt_t{sensorVoltage}, wpi::units::volt_t{supplyVoltage}); + return VoltsToPSI(wpi::units::volt_t{sensorVoltage}, + wpi::units::volt_t{supplyVoltage}); } Solenoid PneumaticHub::MakeSolenoid(int channel) { diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsBase.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsBase.cpp index b094293799..f733f8383b 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsBase.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsBase.cpp @@ -35,7 +35,7 @@ std::shared_ptr PneumaticsBase::GetForType( return PneumaticHub::GetForModule(busId, module); } throw WPILIB_MakeError(err::InvalidParameter, "{}", - static_cast(moduleType)); + static_cast(moduleType)); } int PneumaticsBase::GetDefaultForType(PneumaticsModuleType moduleType) { @@ -45,5 +45,5 @@ int PneumaticsBase::GetDefaultForType(PneumaticsModuleType moduleType) { return SensorUtil::GetDefaultREVPHModule(); } throw WPILIB_MakeError(err::InvalidParameter, "{}", - static_cast(moduleType)); + static_cast(moduleType)); } diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp index d4027c5f33..94f56a10cc 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/PneumaticsControlModule.cpp @@ -23,8 +23,8 @@ using namespace wpi; wpi::util::mutex PneumaticsControlModule::m_handleLock; -std::unique_ptr< - wpi::util::DenseMap>[]> +std::unique_ptr>[]> PneumaticsControlModule::m_handleMaps = nullptr; // Always called under lock, so we can avoid the double lock from the magic @@ -33,7 +33,7 @@ std::weak_ptr& PneumaticsControlModule::GetDataStore(int busId, int module) { int32_t numBuses = HAL_GetNumCanBuses(); WPILIB_AssertMessage(busId >= 0 && busId < numBuses, - "Bus {} out of range. Must be [0-{}).", busId, numBuses); + "Bus {} out of range. Must be [0-{}).", busId, numBuses); if (!m_handleMaps) { m_handleMaps = std::make_unique>[]>(numBuses); @@ -234,8 +234,8 @@ void PneumaticsControlModule::FireOneShot(int index) { WPILIB_ReportError(status, "Module {}", m_module); } -void PneumaticsControlModule::SetOneShotDuration(int index, - wpi::units::second_t duration) { +void PneumaticsControlModule::SetOneShotDuration( + int index, wpi::units::second_t duration) { int32_t status = 0; wpi::units::millisecond_t millis = duration; HAL_SetCTREPCMOneShotDuration(m_handle, index, millis.to(), &status); @@ -275,7 +275,8 @@ void PneumaticsControlModule::UnreserveCompressor() { m_dataStore->m_compressorReserved = false; } -wpi::units::volt_t PneumaticsControlModule::GetAnalogVoltage(int channel) const { +wpi::units::volt_t PneumaticsControlModule::GetAnalogVoltage( + int channel) const { return 0_V; } diff --git a/wpilibc/src/main/native/cpp/hardware/pneumatic/Solenoid.cpp b/wpilibc/src/main/native/cpp/hardware/pneumatic/Solenoid.cpp index 7dd8b3d162..b4baca011c 100644 --- a/wpilibc/src/main/native/cpp/hardware/pneumatic/Solenoid.cpp +++ b/wpilibc/src/main/native/cpp/hardware/pneumatic/Solenoid.cpp @@ -19,17 +19,19 @@ Solenoid::Solenoid(int busId, int module, PneumaticsModuleType moduleType, : m_module{PneumaticsBase::GetForType(busId, module, moduleType)}, m_channel{channel} { if (!m_module->CheckSolenoidChannel(m_channel)) { - throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "Channel {}", m_channel); + throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "Channel {}", + m_channel); } m_mask = 1 << channel; if (m_module->CheckAndReserveSolenoids(m_mask) != 0) { - throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", m_channel); + throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}", + m_channel); } m_module->ReportUsage(fmt::format("Solenoid[{}]", m_channel), "Solenoid"); - wpi::util::SendableRegistry::Add(this, "Solenoid", m_module->GetModuleNumber(), - m_channel); + wpi::util::SendableRegistry::Add(this, "Solenoid", + m_module->GetModuleNumber(), m_channel); } Solenoid::Solenoid(int busId, PneumaticsModuleType moduleType, int channel) diff --git a/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp b/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp index 7ed631beb2..fcdc176f3f 100644 --- a/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp +++ b/wpilibc/src/main/native/cpp/hardware/power/PowerDistribution.cpp @@ -246,7 +246,7 @@ bool PowerDistribution::Faults::GetBreakerFault(int channel) const { return Channel23BreakerFault != 0; default: throw WPILIB_MakeError(err::ChannelIndexOutOfRange, - "Power distribution fault channel out of bounds!"); + "Power distribution fault channel out of bounds!"); } } @@ -302,7 +302,7 @@ bool PowerDistribution::StickyFaults::GetBreakerFault(int channel) const { return Channel23BreakerFault != 0; default: throw WPILIB_MakeError(err::ChannelIndexOutOfRange, - "Power distribution fault channel out of bounds!"); + "Power distribution fault channel out of bounds!"); } } diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp index 1185afe8c3..610d1d586c 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/AnalogEncoder.cpp @@ -58,7 +58,8 @@ AnalogEncoder::AnalogEncoder(std::shared_ptr analogInput, } void AnalogEncoder::Init(double fullRange, double expectedZero) { - m_simDevice = wpi::hal::SimDevice{"AnalogEncoder", m_analogInput->GetChannel()}; + m_simDevice = + wpi::hal::SimDevice{"AnalogEncoder", m_analogInput->GetChannel()}; if (m_simDevice) { m_simPosition = m_simDevice.CreateDouble("Position", false, 0.0); @@ -70,7 +71,7 @@ void AnalogEncoder::Init(double fullRange, double expectedZero) { HAL_ReportUsage("IO", m_analogInput->GetChannel(), "AnalogEncoder"); wpi::util::SendableRegistry::Add(this, "Analog Encoder", - m_analogInput->GetChannel()); + m_analogInput->GetChannel()); } double AnalogEncoder::Get() const { diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/AnalogPotentiometer.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/AnalogPotentiometer.cpp index e3e28bf78c..24b5c8e85d 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/AnalogPotentiometer.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/AnalogPotentiometer.cpp @@ -23,9 +23,9 @@ AnalogPotentiometer::AnalogPotentiometer(int channel, double fullRange, AnalogPotentiometer::AnalogPotentiometer(AnalogInput* input, double fullRange, double offset) - : AnalogPotentiometer( - std::shared_ptr(input, wpi::util::NullDeleter()), - fullRange, offset) {} + : AnalogPotentiometer(std::shared_ptr( + input, wpi::util::NullDeleter()), + fullRange, offset) {} AnalogPotentiometer::AnalogPotentiometer(std::shared_ptr input, double fullRange, double offset) @@ -33,7 +33,7 @@ AnalogPotentiometer::AnalogPotentiometer(std::shared_ptr input, m_fullRange(fullRange), m_offset(offset) { wpi::util::SendableRegistry::Add(this, "AnalogPotentiometer", - m_analog_input->GetChannel()); + m_analog_input->GetChannel()); } double AnalogPotentiometer::Get() const { diff --git a/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycleEncoder.cpp b/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycleEncoder.cpp index 46e3351f4c..1dacd45b22 100644 --- a/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycleEncoder.cpp +++ b/wpilibc/src/main/native/cpp/hardware/rotation/DutyCycleEncoder.cpp @@ -61,19 +61,19 @@ DutyCycleEncoder::DutyCycleEncoder(std::shared_ptr dutyCycle, void DutyCycleEncoder::Init(double fullRange, double expectedZero) { m_simDevice = wpi::hal::SimDevice{"DutyCycle:DutyCycleEncoder", - m_dutyCycle->GetSourceChannel()}; + m_dutyCycle->GetSourceChannel()}; if (m_simDevice) { m_simPosition = m_simDevice.CreateDouble("Position", false, 0.0); - m_simIsConnected = - m_simDevice.CreateBoolean("Connected", wpi::hal::SimDevice::kInput, true); + m_simIsConnected = m_simDevice.CreateBoolean( + "Connected", wpi::hal::SimDevice::kInput, true); } m_fullRange = fullRange; m_expectedZero = expectedZero; wpi::util::SendableRegistry::Add(this, "DutyCycle Encoder", - m_dutyCycle->GetSourceChannel()); + m_dutyCycle->GetSourceChannel()); } double DutyCycleEncoder::Get() const { diff --git a/wpilibc/src/main/native/cpp/opmode/IterativeRobotBase.cpp b/wpilibc/src/main/native/cpp/opmode/IterativeRobotBase.cpp index 90adb95ded..06d9a91b80 100644 --- a/wpilibc/src/main/native/cpp/opmode/IterativeRobotBase.cpp +++ b/wpilibc/src/main/native/cpp/opmode/IterativeRobotBase.cpp @@ -193,7 +193,8 @@ void IterativeRobotBase::LoopFunc() { } void IterativeRobotBase::PrintLoopOverrunMessage() { - WPILIB_ReportError(err::Error, "Loop time of {:.6f}s overrun", m_period.value()); + WPILIB_ReportError(err::Error, "Loop time of {:.6f}s overrun", + m_period.value()); } void IterativeRobotBase::PrintWatchdogEpochs() { diff --git a/wpilibc/src/main/native/cpp/opmode/TimedRobot.cpp b/wpilibc/src/main/native/cpp/opmode/TimedRobot.cpp index 6880582710..74def619f1 100644 --- a/wpilibc/src/main/native/cpp/opmode/TimedRobot.cpp +++ b/wpilibc/src/main/native/cpp/opmode/TimedRobot.cpp @@ -75,7 +75,8 @@ void TimedRobot::EndCompetition() { HAL_StopNotifier(m_notifier, &status); } -TimedRobot::TimedRobot(wpi::units::second_t period) : IterativeRobotBase(period) { +TimedRobot::TimedRobot(wpi::units::second_t period) + : IterativeRobotBase(period) { m_startTime = std::chrono::microseconds{RobotController::GetFPGATime()}; AddPeriodic([=, this] { LoopFunc(); }, period); @@ -87,7 +88,8 @@ TimedRobot::TimedRobot(wpi::units::second_t period) : IterativeRobotBase(period) HAL_ReportUsage("Framework", "TimedRobot"); } -TimedRobot::TimedRobot(wpi::units::hertz_t frequency) : TimedRobot{1 / frequency} {} +TimedRobot::TimedRobot(wpi::units::hertz_t frequency) + : TimedRobot{1 / frequency} {} TimedRobot::~TimedRobot() { if (m_notifier != HAL_kInvalidHandle) { @@ -102,7 +104,8 @@ uint64_t TimedRobot::GetLoopStartTime() { } void TimedRobot::AddPeriodic(std::function callback, - wpi::units::second_t period, wpi::units::second_t offset) { + wpi::units::second_t period, + wpi::units::second_t offset) { m_callbacks.emplace( callback, m_startTime, std::chrono::microseconds{static_cast(period.value() * 1e6)}, diff --git a/wpilibc/src/main/native/cpp/opmode/TimesliceRobot.cpp b/wpilibc/src/main/native/cpp/opmode/TimesliceRobot.cpp index 9594993db1..578b63d55c 100644 --- a/wpilibc/src/main/native/cpp/opmode/TimesliceRobot.cpp +++ b/wpilibc/src/main/native/cpp/opmode/TimesliceRobot.cpp @@ -17,9 +17,9 @@ void TimesliceRobot::Schedule(std::function func, wpi::units::second_t allocation) { if (m_nextOffset + allocation > m_controllerPeriod) { throw WPILIB_MakeError(err::Error, - "Function scheduled at offset {} with allocation {} " - "exceeded controller period of {}\n", - m_nextOffset, allocation, m_controllerPeriod); + "Function scheduled at offset {} with allocation {} " + "exceeded controller period of {}\n", + m_nextOffset, allocation, m_controllerPeriod); } AddPeriodic(func, m_controllerPeriod, m_nextOffset); diff --git a/wpilibc/src/main/native/cpp/simulation/DCMotorSim.cpp b/wpilibc/src/main/native/cpp/simulation/DCMotorSim.cpp index d7b14fc3f7..3485487e6b 100644 --- a/wpilibc/src/main/native/cpp/simulation/DCMotorSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/DCMotorSim.cpp @@ -58,13 +58,15 @@ wpi::units::radians_per_second_t DCMotorSim::GetAngularVelocity() const { return wpi::units::radians_per_second_t{GetOutput(1)}; } -wpi::units::radians_per_second_squared_t DCMotorSim::GetAngularAcceleration() const { +wpi::units::radians_per_second_squared_t DCMotorSim::GetAngularAcceleration() + const { return wpi::units::radians_per_second_squared_t{ (m_plant.A() * m_x + m_plant.B() * m_u)(1, 0)}; } wpi::units::newton_meter_t DCMotorSim::GetTorque() const { - return wpi::units::newton_meter_t{GetAngularAcceleration().value() * m_j.value()}; + return wpi::units::newton_meter_t{GetAngularAcceleration().value() * + m_j.value()}; } wpi::units::ampere_t DCMotorSim::GetCurrentDraw() const { diff --git a/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp b/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp index e9000db1d0..e70c3fca0c 100644 --- a/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/DifferentialDrivetrainSim.cpp @@ -16,8 +16,9 @@ using namespace wpi; using namespace wpi::sim; DifferentialDrivetrainSim::DifferentialDrivetrainSim( - wpi::math::LinearSystem<2, 2, 2> plant, wpi::units::meter_t trackwidth, wpi::math::DCMotor driveMotor, - double gearRatio, wpi::units::meter_t wheelRadius, + wpi::math::LinearSystem<2, 2, 2> plant, wpi::units::meter_t trackwidth, + wpi::math::DCMotor driveMotor, double gearRatio, + wpi::units::meter_t wheelRadius, const std::array& measurementStdDevs) : m_plant(std::move(plant)), m_rb(trackwidth / 2.0), @@ -32,9 +33,10 @@ DifferentialDrivetrainSim::DifferentialDrivetrainSim( } DifferentialDrivetrainSim::DifferentialDrivetrainSim( - wpi::math::DCMotor driveMotor, double gearing, wpi::units::kilogram_square_meter_t J, - wpi::units::kilogram_t mass, wpi::units::meter_t wheelRadius, - wpi::units::meter_t trackwidth, const std::array& measurementStdDevs) + wpi::math::DCMotor driveMotor, double gearing, + wpi::units::kilogram_square_meter_t J, wpi::units::kilogram_t mass, + wpi::units::meter_t wheelRadius, wpi::units::meter_t trackwidth, + const std::array& measurementStdDevs) : DifferentialDrivetrainSim( wpi::math::LinearSystemId::DrivetrainVelocitySystem( driveMotor, mass, wheelRadius, trackwidth / 2.0, J, gearing), @@ -42,8 +44,8 @@ DifferentialDrivetrainSim::DifferentialDrivetrainSim( Eigen::Vector2d DifferentialDrivetrainSim::ClampInput( const Eigen::Vector2d& u) { - return wpi::math::DesaturateInputVector<2>(u, - wpi::RobotController::GetInputVoltage()); + return wpi::math::DesaturateInputVector<2>( + u, wpi::RobotController::GetInputVoltage()); } void DifferentialDrivetrainSim::SetInputs(wpi::units::volt_t leftVoltage, @@ -57,7 +59,8 @@ void DifferentialDrivetrainSim::SetGearing(double newGearing) { } void DifferentialDrivetrainSim::Update(wpi::units::second_t dt) { - m_x = wpi::math::RKDP([this](auto& x, auto& u) { return Dynamics(x, u); }, m_x, m_u, dt); + m_x = wpi::math::RKDP([this](auto& x, auto& u) { return Dynamics(x, u); }, + m_x, m_u, dt); m_y = m_x + wpi::math::MakeWhiteNoiseVector<7>(m_measurementStdDevs); } @@ -87,22 +90,24 @@ wpi::math::Rotation2d DifferentialDrivetrainSim::GetHeading() const { wpi::math::Pose2d DifferentialDrivetrainSim::GetPose() const { return wpi::math::Pose2d{wpi::units::meter_t{GetOutput(State::kX)}, - wpi::units::meter_t{GetOutput(State::kY)}, GetHeading()}; + wpi::units::meter_t{GetOutput(State::kY)}, + GetHeading()}; } wpi::units::ampere_t DifferentialDrivetrainSim::GetLeftCurrentDraw() const { - return m_motor.Current(wpi::units::radians_per_second_t{m_x(State::kLeftVelocity) * - m_currentGearing / - m_wheelRadius.value()}, - wpi::units::volt_t{m_u(0)}) * + return m_motor.Current( + wpi::units::radians_per_second_t{m_x(State::kLeftVelocity) * + m_currentGearing / + m_wheelRadius.value()}, + wpi::units::volt_t{m_u(0)}) * wpi::util::sgn(m_u(0)); } wpi::units::ampere_t DifferentialDrivetrainSim::GetRightCurrentDraw() const { return m_motor.Current( wpi::units::radians_per_second_t{m_x(State::kRightVelocity) * - m_currentGearing / - m_wheelRadius.value()}, + m_currentGearing / + m_wheelRadius.value()}, wpi::units::volt_t{m_u(1)}) * wpi::util::sgn(m_u(1)); } @@ -123,8 +128,8 @@ void DifferentialDrivetrainSim::SetPose(const wpi::math::Pose2d& pose) { m_x(State::kRightPosition) = 0; } -wpi::math::Vectord<7> DifferentialDrivetrainSim::Dynamics(const wpi::math::Vectord<7>& x, - const Eigen::Vector2d& u) { +wpi::math::Vectord<7> DifferentialDrivetrainSim::Dynamics( + const wpi::math::Vectord<7>& x, const Eigen::Vector2d& u) { // Because G² can be factored out of A, we can divide by the old ratio // squared and multiply by the new ratio squared to get a new drivetrain // model. diff --git a/wpilibc/src/main/native/cpp/simulation/ElevatorSim.cpp b/wpilibc/src/main/native/cpp/simulation/ElevatorSim.cpp index aab83e05c3..614f0abd36 100644 --- a/wpilibc/src/main/native/cpp/simulation/ElevatorSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/ElevatorSim.cpp @@ -13,7 +13,8 @@ using namespace wpi; using namespace wpi::sim; ElevatorSim::ElevatorSim(const wpi::math::LinearSystem<2, 1, 2>& plant, - const wpi::math::DCMotor& gearbox, wpi::units::meter_t minHeight, + const wpi::math::DCMotor& gearbox, + wpi::units::meter_t minHeight, wpi::units::meter_t maxHeight, bool simulateGravity, wpi::units::meter_t startingHeight, const std::array& measurementStdDevs) @@ -27,12 +28,13 @@ ElevatorSim::ElevatorSim(const wpi::math::LinearSystem<2, 1, 2>& plant, ElevatorSim::ElevatorSim(const wpi::math::DCMotor& gearbox, double gearing, wpi::units::kilogram_t carriageMass, - wpi::units::meter_t drumRadius, wpi::units::meter_t minHeight, + wpi::units::meter_t drumRadius, + wpi::units::meter_t minHeight, wpi::units::meter_t maxHeight, bool simulateGravity, wpi::units::meter_t startingHeight, const std::array& measurementStdDevs) - : ElevatorSim(wpi::math::LinearSystemId::ElevatorSystem(gearbox, carriageMass, - drumRadius, gearing), + : ElevatorSim(wpi::math::LinearSystemId::ElevatorSystem( + gearbox, carriageMass, drumRadius, gearing), gearbox, minHeight, maxHeight, simulateGravity, startingHeight, measurementStdDevs) {} @@ -41,18 +43,19 @@ template std::same_as ElevatorSim::ElevatorSim(decltype(1_V / Velocity_t(1)) kV, decltype(1_V / Acceleration_t(1)) kA, - const wpi::math::DCMotor& gearbox, wpi::units::meter_t minHeight, + const wpi::math::DCMotor& gearbox, + wpi::units::meter_t minHeight, wpi::units::meter_t maxHeight, bool simulateGravity, wpi::units::meter_t startingHeight, const std::array& measurementStdDevs) - : ElevatorSim(wpi::math::LinearSystemId::IdentifyPositionSystem(kV, kA), gearbox, - minHeight, maxHeight, simulateGravity, startingHeight, - measurementStdDevs) {} + : ElevatorSim(wpi::math::LinearSystemId::IdentifyPositionSystem(kV, kA), + gearbox, minHeight, maxHeight, simulateGravity, + startingHeight, measurementStdDevs) {} void ElevatorSim::SetState(wpi::units::meter_t position, wpi::units::meters_per_second_t velocity) { - SetState( - wpi::math::Vectord<2>{std::clamp(position, m_minHeight, m_maxHeight), velocity}); + SetState(wpi::math::Vectord<2>{std::clamp(position, m_minHeight, m_maxHeight), + velocity}); } bool ElevatorSim::WouldHitLowerLimit(wpi::units::meter_t elevatorHeight) const { @@ -101,10 +104,12 @@ void ElevatorSim::SetInputVoltage(wpi::units::volt_t voltage) { ClampInput(wpi::RobotController::GetBatteryVoltage().value()); } -wpi::math::Vectord<2> ElevatorSim::UpdateX(const wpi::math::Vectord<2>& currentXhat, - const wpi::math::Vectord<1>& u, wpi::units::second_t dt) { +wpi::math::Vectord<2> ElevatorSim::UpdateX( + const wpi::math::Vectord<2>& currentXhat, const wpi::math::Vectord<1>& u, + wpi::units::second_t dt) { auto updatedXhat = wpi::math::RKDP( - [&](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<1>& u_) -> wpi::math::Vectord<2> { + [&](const wpi::math::Vectord<2>& x, + const wpi::math::Vectord<1>& u_) -> wpi::math::Vectord<2> { wpi::math::Vectord<2> xdot = m_plant.A() * x + m_plant.B() * u; if (m_simulateGravity) { diff --git a/wpilibc/src/main/native/cpp/simulation/FlywheelSim.cpp b/wpilibc/src/main/native/cpp/simulation/FlywheelSim.cpp index 9327501b53..25f893a5c5 100644 --- a/wpilibc/src/main/native/cpp/simulation/FlywheelSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/FlywheelSim.cpp @@ -51,7 +51,8 @@ wpi::units::radians_per_second_squared_t FlywheelSim::GetAngularAcceleration() } wpi::units::newton_meter_t FlywheelSim::GetTorque() const { - return wpi::units::newton_meter_t{GetAngularAcceleration().value() * m_j.value()}; + return wpi::units::newton_meter_t{GetAngularAcceleration().value() * + m_j.value()}; } wpi::units::ampere_t FlywheelSim::GetCurrentDraw() const { diff --git a/wpilibc/src/main/native/cpp/simulation/PneumaticsBaseSim.cpp b/wpilibc/src/main/native/cpp/simulation/PneumaticsBaseSim.cpp index 097865d32b..667a901f18 100644 --- a/wpilibc/src/main/native/cpp/simulation/PneumaticsBaseSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/PneumaticsBaseSim.cpp @@ -25,7 +25,7 @@ std::shared_ptr PneumaticsBaseSim::GetForType( default: throw WPILIB_MakeError(err::InvalidParameter, "{}", - static_cast(module)); + static_cast(module)); } } diff --git a/wpilibc/src/main/native/cpp/simulation/SingleJointedArmSim.cpp b/wpilibc/src/main/native/cpp/simulation/SingleJointedArmSim.cpp index abcf18b32f..d22ba2dacf 100644 --- a/wpilibc/src/main/native/cpp/simulation/SingleJointedArmSim.cpp +++ b/wpilibc/src/main/native/cpp/simulation/SingleJointedArmSim.cpp @@ -16,7 +16,8 @@ using namespace wpi; using namespace wpi::sim; SingleJointedArmSim::SingleJointedArmSim( - const wpi::math::LinearSystem<2, 1, 2>& system, const wpi::math::DCMotor& gearbox, double gearing, + const wpi::math::LinearSystem<2, 1, 2>& system, + const wpi::math::DCMotor& gearbox, double gearing, wpi::units::meter_t armLength, wpi::units::radian_t minAngle, wpi::units::radian_t maxAngle, bool simulateGravity, wpi::units::radian_t startingAngle, @@ -32,26 +33,29 @@ SingleJointedArmSim::SingleJointedArmSim( } SingleJointedArmSim::SingleJointedArmSim( - const wpi::math::DCMotor& gearbox, double gearing, wpi::units::kilogram_square_meter_t moi, - wpi::units::meter_t armLength, wpi::units::radian_t minAngle, - wpi::units::radian_t maxAngle, bool simulateGravity, - wpi::units::radian_t startingAngle, + const wpi::math::DCMotor& gearbox, double gearing, + wpi::units::kilogram_square_meter_t moi, wpi::units::meter_t armLength, + wpi::units::radian_t minAngle, wpi::units::radian_t maxAngle, + bool simulateGravity, wpi::units::radian_t startingAngle, const std::array& measurementStdDevs) - : SingleJointedArmSim( - wpi::math::LinearSystemId::SingleJointedArmSystem(gearbox, moi, gearing), - gearbox, gearing, armLength, minAngle, maxAngle, simulateGravity, - startingAngle, measurementStdDevs) {} + : SingleJointedArmSim(wpi::math::LinearSystemId::SingleJointedArmSystem( + gearbox, moi, gearing), + gearbox, gearing, armLength, minAngle, maxAngle, + simulateGravity, startingAngle, measurementStdDevs) {} void SingleJointedArmSim::SetState(wpi::units::radian_t angle, wpi::units::radians_per_second_t velocity) { - SetState(wpi::math::Vectord<2>{std::clamp(angle, m_minAngle, m_maxAngle), velocity}); + SetState(wpi::math::Vectord<2>{std::clamp(angle, m_minAngle, m_maxAngle), + velocity}); } -bool SingleJointedArmSim::WouldHitLowerLimit(wpi::units::radian_t armAngle) const { +bool SingleJointedArmSim::WouldHitLowerLimit( + wpi::units::radian_t armAngle) const { return armAngle <= m_minAngle; } -bool SingleJointedArmSim::WouldHitUpperLimit(wpi::units::radian_t armAngle) const { +bool SingleJointedArmSim::WouldHitUpperLimit( + wpi::units::radian_t armAngle) const { return armAngle >= m_maxAngle; } @@ -84,9 +88,9 @@ void SingleJointedArmSim::SetInputVoltage(wpi::units::volt_t voltage) { ClampInput(wpi::RobotController::GetBatteryVoltage().value()); } -wpi::math::Vectord<2> SingleJointedArmSim::UpdateX(const wpi::math::Vectord<2>& currentXhat, - const wpi::math::Vectord<1>& u, - wpi::units::second_t dt) { +wpi::math::Vectord<2> SingleJointedArmSim::UpdateX( + const wpi::math::Vectord<2>& currentXhat, const wpi::math::Vectord<1>& u, + wpi::units::second_t dt) { // The torque on the arm is given by τ = F⋅r, where F is the force applied by // gravity and r the distance from pivot to center of mass. Recall from // dynamics that the sum of torques for a rigid body is τ = J⋅α, were τ is diff --git a/wpilibc/src/main/native/cpp/smartdashboard/FieldObject2d.cpp b/wpilibc/src/main/native/cpp/smartdashboard/FieldObject2d.cpp index 00fd89319e..cb060bdf97 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/FieldObject2d.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/FieldObject2d.cpp @@ -106,8 +106,8 @@ void FieldObject2d::UpdateFromEntry() const { } m_poses.resize(size / 3); for (size_t i = 0; i < size / 3; ++i) { - m_poses[i] = - wpi::math::Pose2d{wpi::units::meter_t{arr[i * 3 + 0]}, wpi::units::meter_t{arr[i * 3 + 1]}, - wpi::units::degree_t{arr[i * 3 + 2]}}; + m_poses[i] = wpi::math::Pose2d{wpi::units::meter_t{arr[i * 3 + 0]}, + wpi::units::meter_t{arr[i * 3 + 1]}, + wpi::units::degree_t{arr[i * 3 + 2]}}; } } diff --git a/wpilibc/src/main/native/cpp/smartdashboard/MechanismLigament2d.cpp b/wpilibc/src/main/native/cpp/smartdashboard/MechanismLigament2d.cpp index f44b664b89..56ed27b834 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/MechanismLigament2d.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/MechanismLigament2d.cpp @@ -28,7 +28,8 @@ MechanismLigament2d::MechanismLigament2d(std::string_view name, double length, void MechanismLigament2d::UpdateEntries( std::shared_ptr table) { m_typePub = table->GetStringTopic(".type").PublishEx( - wpi::nt::StringTopic::kTypeString, {{"SmartDashboard", kSmartDashboardType}}); + wpi::nt::StringTopic::kTypeString, + {{"SmartDashboard", kSmartDashboardType}}); m_typePub.Set(kSmartDashboardType); m_colorEntry = table->GetStringTopic("color").GetEntry(""); @@ -45,7 +46,7 @@ void MechanismLigament2d::SetColor(const Color8Bit& color) { std::scoped_lock lock(m_mutex); wpi::util::format_to_n_c_str(m_color, sizeof(m_color), "#{:02X}{:02X}{:02X}", - color.red, color.green, color.blue); + color.red, color.green, color.blue); if (m_colorEntry) { m_colorEntry.Set(m_color); diff --git a/wpilibc/src/main/native/cpp/smartdashboard/MechanismRoot2d.cpp b/wpilibc/src/main/native/cpp/smartdashboard/MechanismRoot2d.cpp index 806f7c60f9..6d8fc3a905 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/MechanismRoot2d.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/MechanismRoot2d.cpp @@ -4,10 +4,10 @@ #include "wpi/smartdashboard/MechanismRoot2d.hpp" -#include "wpi/util/Color8Bit.hpp" - #include +#include "wpi/util/Color8Bit.hpp" + using namespace wpi; MechanismRoot2d::MechanismRoot2d(std::string_view name, double x, double y, @@ -21,7 +21,8 @@ void MechanismRoot2d::SetPosition(double x, double y) { Flush(); } -void MechanismRoot2d::UpdateEntries(std::shared_ptr table) { +void MechanismRoot2d::UpdateEntries( + std::shared_ptr table) { m_xPub = table->GetDoubleTopic("x").Publish(); m_yPub = table->GetDoubleTopic("y").Publish(); Flush(); diff --git a/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp b/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp index 48d26592b5..91debf14f3 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp @@ -35,7 +35,8 @@ void SendableBuilderImpl::PropertyImpl::Update(bool controllable, } } -void SendableBuilderImpl::SetTable(std::shared_ptr table) { +void SendableBuilderImpl::SetTable( + std::shared_ptr table) { m_table = table; m_controllablePublisher = table->GetBooleanTopic(".controllable").Publish(); m_controllablePublisher.SetDefault(false); @@ -97,7 +98,8 @@ void SendableBuilderImpl::SetActuator(bool value) { m_actuator = value; } -void SendableBuilderImpl::SetUpdateTable(wpi::util::unique_function func) { +void SendableBuilderImpl::SetUpdateTable( + wpi::util::unique_function func) { m_updateTables.emplace_back(std::move(func)); } @@ -314,7 +316,8 @@ void SendableBuilderImpl::AddSmallPropertyImpl(Topic topic, Getter getter, void SendableBuilderImpl::AddSmallStringProperty( std::string_view key, - std::function& buf)> getter, + std::function& buf)> + getter, std::function setter) { AddSmallPropertyImpl(m_table->GetStringTopic(key), std::move(getter), std::move(setter)); @@ -322,7 +325,8 @@ void SendableBuilderImpl::AddSmallStringProperty( void SendableBuilderImpl::AddSmallBooleanArrayProperty( std::string_view key, - std::function(wpi::util::SmallVectorImpl& buf)> getter, + std::function(wpi::util::SmallVectorImpl& buf)> + getter, std::function)> setter) { AddSmallPropertyImpl(m_table->GetBooleanArrayTopic(key), std::move(getter), std::move(setter)); @@ -330,7 +334,8 @@ void SendableBuilderImpl::AddSmallBooleanArrayProperty( void SendableBuilderImpl::AddSmallIntegerArrayProperty( std::string_view key, - std::function(wpi::util::SmallVectorImpl& buf)> + std::function< + std::span(wpi::util::SmallVectorImpl& buf)> getter, std::function)> setter) { AddSmallPropertyImpl(m_table->GetIntegerArrayTopic(key), @@ -339,7 +344,8 @@ void SendableBuilderImpl::AddSmallIntegerArrayProperty( void SendableBuilderImpl::AddSmallFloatArrayProperty( std::string_view key, - std::function(wpi::util::SmallVectorImpl& buf)> + std::function< + std::span(wpi::util::SmallVectorImpl& buf)> getter, std::function)> setter) { AddSmallPropertyImpl(m_table->GetFloatArrayTopic(key), @@ -348,7 +354,8 @@ void SendableBuilderImpl::AddSmallFloatArrayProperty( void SendableBuilderImpl::AddSmallDoubleArrayProperty( std::string_view key, - std::function(wpi::util::SmallVectorImpl& buf)> + std::function< + std::span(wpi::util::SmallVectorImpl& buf)> getter, std::function)> setter) { AddSmallPropertyImpl(m_table->GetDoubleArrayTopic(key), @@ -357,8 +364,8 @@ void SendableBuilderImpl::AddSmallDoubleArrayProperty( void SendableBuilderImpl::AddSmallStringArrayProperty( std::string_view key, - std::function< - std::span(wpi::util::SmallVectorImpl& buf)> + std::function( + wpi::util::SmallVectorImpl& buf)> getter, std::function)> setter) { AddSmallPropertyImpl(m_table->GetStringArrayTopic(key), diff --git a/wpilibc/src/main/native/cpp/system/DataLogManager.cpp b/wpilibc/src/main/native/cpp/system/DataLogManager.cpp index 38014595d2..73a315c038 100644 --- a/wpilibc/src/main/native/cpp/system/DataLogManager.cpp +++ b/wpilibc/src/main/native/cpp/system/DataLogManager.cpp @@ -133,8 +133,8 @@ void Thread::Main() { freeSpace = UINTMAX_MAX; } if (freeSpace < kFreeSpaceThreshold) { - // Delete oldest WPILIB_*.wpilog files (ignore WPILIB_TBD_*.wpilog as we just - // created one) + // Delete oldest WPILIB_*.wpilog files (ignore WPILIB_TBD_*.wpilog as we + // just created one) std::vector entries; for (auto&& entry : fs::directory_iterator{m_logDir, ec}) { auto stem = entry.path().stem().string(); @@ -158,14 +158,14 @@ void Thread::Main() { auto size = entry.file_size(); if (fs::remove(entry.path(), ec)) { WPILIB_ReportWarning("DataLogManager: Deleted {}", - entry.path().string()); + entry.path().string()); freeSpace += size; if (freeSpace >= kFreeSpaceThreshold) { break; } } else { wpi::util::print(stderr, "DataLogManager: could not delete {}\n", - entry.path().string()); + entry.path().string()); } } } else if (freeSpace < 2 * kFreeSpaceThreshold) { @@ -330,7 +330,7 @@ Instance::Instance(std::string_view dir, std::string_view filename, entry.path().extension() == ".wpilog") { if (!fs::remove(entry, ec)) { wpi::util::print(stderr, "DataLogManager: could not delete {}\n", - entry.path().string()); + entry.path().string()); } } } diff --git a/wpilibc/src/main/native/cpp/system/Watchdog.cpp b/wpilibc/src/main/native/cpp/system/Watchdog.cpp index 2375df0eff..73a6fc5352 100644 --- a/wpilibc/src/main/native/cpp/system/Watchdog.cpp +++ b/wpilibc/src/main/native/cpp/system/Watchdog.cpp @@ -34,7 +34,7 @@ class Watchdog::Impl { wpi::util::mutex m_mutex; std::atomic m_notifier; wpi::util::priority_queue, - DerefGreater> + DerefGreater> m_watchdogs; void UpdateAlarm(); @@ -115,7 +115,7 @@ void Watchdog::Impl::Main() { watchdog->m_lastTimeoutPrintTime = now; if (!watchdog->m_suppressTimeoutMessage) { WPILIB_ReportWarning("Watchdog not fed within {:.6f}s", - watchdog->m_timeout.value()); + watchdog->m_timeout.value()); } } diff --git a/wpilibc/src/main/native/cpp/util/Alert.cpp b/wpilibc/src/main/native/cpp/util/Alert.cpp index 9b3cad111e..87e85f8d1c 100644 --- a/wpilibc/src/main/native/cpp/util/Alert.cpp +++ b/wpilibc/src/main/native/cpp/util/Alert.cpp @@ -71,7 +71,7 @@ class Alert::SendableAlerts : public wpi::nt::NTSendable, return m_alerts[static_cast(type)]; default: throw WPILIB_MakeError(wpi::err::InvalidParameter, - "Invalid Alert Type: {}", type); + "Invalid Alert Type: {}", type); } } diff --git a/wpilibc/src/main/native/cpp/util/Preferences.cpp b/wpilibc/src/main/native/cpp/util/Preferences.cpp index 2d78a02ed8..4122b8929e 100644 --- a/wpilibc/src/main/native/cpp/util/Preferences.cpp +++ b/wpilibc/src/main/native/cpp/util/Preferences.cpp @@ -29,10 +29,13 @@ struct Instance { std::shared_ptr table{ wpi::nt::NetworkTableInstance::GetDefault().GetTable(kTableName)}; - wpi::nt::StringPublisher typePublisher{table->GetStringTopic(".type").PublishEx( - wpi::nt::StringTopic::kTypeString, {{"SmartDashboard", kSmartDashboardType}})}; - wpi::nt::MultiSubscriber tableSubscriber{wpi::nt::NetworkTableInstance::GetDefault(), - {{fmt::format("{}/", table->GetPath())}}}; + wpi::nt::StringPublisher typePublisher{ + table->GetStringTopic(".type").PublishEx( + wpi::nt::StringTopic::kTypeString, + {{"SmartDashboard", kSmartDashboardType}})}; + wpi::nt::MultiSubscriber tableSubscriber{ + wpi::nt::NetworkTableInstance::GetDefault(), + {{fmt::format("{}/", table->GetPath())}}}; wpi::nt::NetworkTableListener listener; }; } // namespace diff --git a/wpilibc/src/main/native/cppcs/RobotBase.cpp b/wpilibc/src/main/native/cppcs/RobotBase.cpp index 7892b5ed36..e1644aad49 100644 --- a/wpilibc/src/main/native/cppcs/RobotBase.cpp +++ b/wpilibc/src/main/native/cppcs/RobotBase.cpp @@ -202,7 +202,8 @@ RobotBase::RobotBase() { std::this_thread::sleep_for(10ms); ++count; if (count > 100) { - wpi::util::print(stderr, "timed out while waiting for NT server to start\n"); + wpi::util::print(stderr, + "timed out while waiting for NT server to start\n"); break; } } diff --git a/wpilibc/src/main/native/include/wpi/ExpansionHubServo.hpp b/wpilibc/src/main/native/include/wpi/ExpansionHubServo.hpp index 7c955d4928..2b6b278f14 100644 --- a/wpilibc/src/main/native/include/wpi/ExpansionHubServo.hpp +++ b/wpilibc/src/main/native/include/wpi/ExpansionHubServo.hpp @@ -84,7 +84,8 @@ class ExpansionHubServo { * @param minAngle Minimum angle * @param maxAngle Maximum angle */ - void SetAngleRange(wpi::units::degree_t minAngle, wpi::units::degree_t maxAngle); + void SetAngleRange(wpi::units::degree_t minAngle, + wpi::units::degree_t maxAngle); /** * Sets the PWM range for the servo. @@ -95,7 +96,8 @@ class ExpansionHubServo { * @param minPwm Minimum PWM * @param maxPwm Maximum PWM */ - void SetPWMRange(wpi::units::microsecond_t minPwm, wpi::units::microsecond_t maxPwm); + void SetPWMRange(wpi::units::microsecond_t minPwm, + wpi::units::microsecond_t maxPwm); /** * Sets whether the servo is reversed. diff --git a/wpilibc/src/main/native/include/wpi/drive/MecanumDrive.hpp b/wpilibc/src/main/native/include/wpi/drive/MecanumDrive.hpp index 104246db7e..1c7c92f040 100644 --- a/wpilibc/src/main/native/include/wpi/drive/MecanumDrive.hpp +++ b/wpilibc/src/main/native/include/wpi/drive/MecanumDrive.hpp @@ -139,7 +139,8 @@ class MecanumDrive : public RobotDriveBase, * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. * Counterclockwise is positive. */ - void DrivePolar(double magnitude, wpi::math::Rotation2d angle, double zRotation); + void DrivePolar(double magnitude, wpi::math::Rotation2d angle, + double zRotation); /** * Cartesian inverse kinematics for Mecanum platform. diff --git a/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp b/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp index fb4579f6c2..14571c5554 100644 --- a/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp +++ b/wpilibc/src/main/native/include/wpi/driverstation/DriverStation.hpp @@ -79,7 +79,8 @@ class DriverStation final { * @return The angle clockwise from straight up, or std::nullopt if the * POVDirection is kCenter. */ - static constexpr std::optional GetAngle(POVDirection angle) { + static constexpr std::optional GetAngle( + POVDirection angle) { switch (angle) { case kCenter: return std::nullopt; diff --git a/wpilibc/src/main/native/include/wpi/event/NetworkBooleanEvent.hpp b/wpilibc/src/main/native/include/wpi/event/NetworkBooleanEvent.hpp index 268b947d91..5543dc27ca 100644 --- a/wpilibc/src/main/native/include/wpi/event/NetworkBooleanEvent.hpp +++ b/wpilibc/src/main/native/include/wpi/event/NetworkBooleanEvent.hpp @@ -14,7 +14,7 @@ class BooleanSubscriber; class BooleanTopic; class NetworkTable; class NetworkTableInstance; -} // namespace nt +} // namespace wpi::nt namespace wpi { /** @@ -50,7 +50,8 @@ class NetworkBooleanEvent : public BooleanEvent { * @param table The NetworkTable that contains the topic * @param topicName The topic name within the table that contains the value */ - NetworkBooleanEvent(EventLoop* loop, std::shared_ptr table, + NetworkBooleanEvent(EventLoop* loop, + std::shared_ptr table, std::string_view topicName); /** diff --git a/wpilibc/src/main/native/include/wpi/hardware/accelerometer/AnalogAccelerometer.hpp b/wpilibc/src/main/native/include/wpi/hardware/accelerometer/AnalogAccelerometer.hpp index 2c0f59b06e..28a3f690e5 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/accelerometer/AnalogAccelerometer.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/accelerometer/AnalogAccelerometer.hpp @@ -19,8 +19,9 @@ namespace wpi { * sensors have multiple axis and can be treated as multiple devices. Each is * calibrated by finding the center value over a period of time. */ -class AnalogAccelerometer : public wpi::util::Sendable, - public wpi::util::SendableHelper { +class AnalogAccelerometer + : public wpi::util::Sendable, + public wpi::util::SendableHelper { public: /** * Create a new instance of an accelerometer. diff --git a/wpilibc/src/main/native/include/wpi/hardware/led/LEDPattern.hpp b/wpilibc/src/main/native/include/wpi/hardware/led/LEDPattern.hpp index f898802b79..6385fa5945 100644 --- a/wpilibc/src/main/native/include/wpi/hardware/led/LEDPattern.hpp +++ b/wpilibc/src/main/native/include/wpi/hardware/led/LEDPattern.hpp @@ -131,7 +131,8 @@ class LEDPattern { * *
    *   // LEDs per meter, a known value taken from the spec sheet of our
-   * particular LED strip wpi::units::meter_t LED_SPACING = wpi::units::meter_t{1 /60.0};
+   * particular LED strip wpi::units::meter_t LED_SPACING =
+   * wpi::units::meter_t{1 /60.0};
    *
    *   wpi::LEDPattern rainbow = wpi::LEDPattern::Rainbow();
    *   wpi::LEDPattern scrollingRainbow =
diff --git a/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp b/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp
index 6f8eeac7cf..a8961125d5 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/motor/PWMMotorController.hpp
@@ -28,10 +28,11 @@ WPI_IGNORE_DEPRECATED
 /**
  * Common base class for all PWM Motor Controllers.
  */
-class PWMMotorController : public MotorController,
-                           public MotorSafety,
-                           public wpi::util::Sendable,
-                           public wpi::util::SendableHelper {
+class PWMMotorController
+    : public MotorController,
+      public MotorSafety,
+      public wpi::util::Sendable,
+      public wpi::util::SendableHelper {
  public:
   PWMMotorController(PWMMotorController&&) = default;
   PWMMotorController& operator=(PWMMotorController&&) = default;
diff --git a/wpilibc/src/main/native/include/wpi/hardware/pneumatic/PneumaticsBase.hpp b/wpilibc/src/main/native/include/wpi/hardware/pneumatic/PneumaticsBase.hpp
index 00a0e638f3..3c5cf36a17 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/pneumatic/PneumaticsBase.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/pneumatic/PneumaticsBase.hpp
@@ -228,7 +228,8 @@ class PneumaticsBase {
    * @return The pressure read by an analog pressure sensor on the
    * specified analog input channel.
    */
-  virtual wpi::units::pounds_per_square_inch_t GetPressure(int channel) const = 0;
+  virtual wpi::units::pounds_per_square_inch_t GetPressure(
+      int channel) const = 0;
 
   /**
    * Create a solenoid object for the specified channel.
diff --git a/wpilibc/src/main/native/include/wpi/hardware/pneumatic/Solenoid.hpp b/wpilibc/src/main/native/include/wpi/hardware/pneumatic/Solenoid.hpp
index 1dec147af9..0075de2623 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/pneumatic/Solenoid.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/pneumatic/Solenoid.hpp
@@ -22,7 +22,8 @@ namespace wpi {
  * The Solenoid class is typically used for pneumatics solenoids, but could be
  * used for any device within the current spec of the module.
  */
-class Solenoid : public wpi::util::Sendable, public wpi::util::SendableHelper {
+class Solenoid : public wpi::util::Sendable,
+                 public wpi::util::SendableHelper {
  public:
   /**
    * Constructs a solenoid for a specified module and type.
diff --git a/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp b/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp
index f6f704860b..a1af45fc84 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/power/PowerDistribution.hpp
@@ -346,7 +346,8 @@ class PowerDistribution : public wpi::util::Sendable,
   void InitSendable(wpi::util::SendableBuilder& builder) override;
 
  private:
-  wpi::hal::Handle m_handle;
+  wpi::hal::Handle
+      m_handle;
   int m_module;
 };
 
diff --git a/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp b/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp
index 972a048c36..5f550bf3d6 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/range/SharpIR.hpp
@@ -12,7 +12,8 @@
 
 namespace wpi {
 
-class SharpIR : public wpi::util::Sendable, public wpi::util::SendableHelper {
+class SharpIR : public wpi::util::Sendable,
+                public wpi::util::SendableHelper {
  public:
   /**
    * Sharp GP2Y0A02YK0F is an analog IR sensor capable of measuring
diff --git a/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogPotentiometer.hpp b/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogPotentiometer.hpp
index 5421f664d8..7577601582 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogPotentiometer.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/rotation/AnalogPotentiometer.hpp
@@ -18,8 +18,9 @@ namespace wpi {
  * units you choose, by way of the scaling and offset constants passed to the
  * constructor.
  */
-class AnalogPotentiometer : public wpi::util::Sendable,
-                            public wpi::util::SendableHelper {
+class AnalogPotentiometer
+    : public wpi::util::Sendable,
+      public wpi::util::SendableHelper {
  public:
   /**
    * Construct an Analog Potentiometer object from a channel number.
diff --git a/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp b/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp
index 7707e45c40..da1823b673 100644
--- a/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp
+++ b/wpilibc/src/main/native/include/wpi/hardware/rotation/DutyCycle.hpp
@@ -21,7 +21,8 @@ namespace wpi {
  * low in that frequency. These can be attached to any SmartIO.
  *
  */
-class DutyCycle : public wpi::util::Sendable, public wpi::util::SendableHelper {
+class DutyCycle : public wpi::util::Sendable,
+                  public wpi::util::SendableHelper {
  public:
   /**
    * Constructs a DutyCycle input from a smartio channel.
diff --git a/wpilibc/src/main/native/include/wpi/opmode/TimedRobot.hpp b/wpilibc/src/main/native/include/wpi/opmode/TimedRobot.hpp
index b3e570ed36..80f4ff4312 100644
--- a/wpilibc/src/main/native/include/wpi/opmode/TimedRobot.hpp
+++ b/wpilibc/src/main/native/include/wpi/opmode/TimedRobot.hpp
@@ -123,7 +123,8 @@ class TimedRobot : public IterativeRobotBase {
   std::chrono::microseconds m_startTime;
   uint64_t m_loopStartTimeUs = 0;
 
-  wpi::util::priority_queue, std::greater>
+  wpi::util::priority_queue,
+                            std::greater>
       m_callbacks;
 };
 
diff --git a/wpilibc/src/main/native/include/wpi/simulation/BatterySim.hpp b/wpilibc/src/main/native/include/wpi/simulation/BatterySim.hpp
index 8341d9c34d..65175b2139 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/BatterySim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/BatterySim.hpp
@@ -31,9 +31,9 @@ class BatterySim {
    * @param currents       The currents drawn from the battery.
    * @return The battery's voltage under load.
    */
-  static wpi::units::volt_t Calculate(wpi::units::volt_t nominalVoltage,
-                                 wpi::units::ohm_t resistance,
-                                 std::span currents) {
+  static wpi::units::volt_t Calculate(
+      wpi::units::volt_t nominalVoltage, wpi::units::ohm_t resistance,
+      std::span currents) {
     return std::max(0_V, nominalVoltage - std::accumulate(currents.begin(),
                                                           currents.end(), 0_A) *
                                               resistance);
@@ -69,7 +69,8 @@ class BatterySim {
    * @param currents The currents drawn from the battery.
    * @return The battery's voltage under load.
    */
-  static wpi::units::volt_t Calculate(std::span currents) {
+  static wpi::units::volt_t Calculate(
+      std::span currents) {
     return Calculate(12_V, 0.02_Ohm, currents);
   }
 
diff --git a/wpilibc/src/main/native/include/wpi/simulation/DCMotorSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/DCMotorSim.hpp
index 23568f03b8..91c512e212 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/DCMotorSim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/DCMotorSim.hpp
@@ -24,13 +24,14 @@ class DCMotorSim : public LinearSystemSim<2, 1, 2> {
    *
    * @param plant              The linear system representing the DC motor. This
    * system can be created with wpi::math::LinearSystemId::DCMotorSystem(). If
-   * wpi::math::LinearSystemId::DCMotorSystem(kV, kA) is used, the distance unit must be
-   * radians.
+   * wpi::math::LinearSystemId::DCMotorSystem(kV, kA) is used, the distance unit
+   * must be radians.
    * @param gearbox            The type of and number of motors in the DC motor
    * gearbox.
    * @param measurementStdDevs The standard deviation of the measurement noise.
    */
-  DCMotorSim(const wpi::math::LinearSystem<2, 1, 2>& plant, const wpi::math::DCMotor& gearbox,
+  DCMotorSim(const wpi::math::LinearSystem<2, 1, 2>& plant,
+             const wpi::math::DCMotor& gearbox,
              const std::array& measurementStdDevs = {0.0, 0.0});
 
   using LinearSystemSim::SetState;
diff --git a/wpilibc/src/main/native/include/wpi/simulation/DifferentialDrivetrainSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/DifferentialDrivetrainSim.hpp
index 8ef8388dcf..64927e7cca 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/DifferentialDrivetrainSim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/DifferentialDrivetrainSim.hpp
@@ -20,12 +20,13 @@ class DifferentialDrivetrainSim {
   /**
    * Creates a simulated differential drivetrain.
    *
-   * @param plant The wpi::math::LinearSystem representing the robot's drivetrain. This
-   *              system can be created with
+   * @param plant The wpi::math::LinearSystem representing the robot's
+   * drivetrain. This system can be created with
    *              wpi::math::LinearSystemId::DrivetrainVelocitySystem() or
    *              wpi::math::LinearSystemId::IdentifyDrivetrainSystem().
    * @param trackwidth   The robot's trackwidth.
-   * @param driveMotor   A wpi::math::DCMotor representing the left side of the drivetrain.
+   * @param driveMotor   A wpi::math::DCMotor representing the left side of the
+   * drivetrain.
    * @param gearingRatio The gearingRatio ratio of the left side, as output over
    *                     input. This must be the same ratio as the ratio used to
    *                     identify or create the plant.
@@ -41,13 +42,15 @@ class DifferentialDrivetrainSim {
    */
   DifferentialDrivetrainSim(
       wpi::math::LinearSystem<2, 2, 2> plant, wpi::units::meter_t trackwidth,
-      wpi::math::DCMotor driveMotor, double gearingRatio, wpi::units::meter_t wheelRadius,
+      wpi::math::DCMotor driveMotor, double gearingRatio,
+      wpi::units::meter_t wheelRadius,
       const std::array& measurementStdDevs = {});
 
   /**
    * Creates a simulated differential drivetrain.
    *
-   * @param driveMotor  A wpi::math::DCMotor representing the left side of the drivetrain.
+   * @param driveMotor  A wpi::math::DCMotor representing the left side of the
+   * drivetrain.
    * @param gearing     The gearing on the drive between motor and wheel, as
    *                    output over input. This must be the same ratio as the
    *                    ratio used to identify or create the plant.
@@ -67,9 +70,9 @@ class DifferentialDrivetrainSim {
    *                           starting point.
    */
   DifferentialDrivetrainSim(
-      wpi::math::DCMotor driveMotor, double gearing, wpi::units::kilogram_square_meter_t J,
-      wpi::units::kilogram_t mass, wpi::units::meter_t wheelRadius,
-      wpi::units::meter_t trackwidth,
+      wpi::math::DCMotor driveMotor, double gearing,
+      wpi::units::kilogram_square_meter_t J, wpi::units::kilogram_t mass,
+      wpi::units::meter_t wheelRadius, wpi::units::meter_t trackwidth,
       const std::array& measurementStdDevs = {});
 
   /**
@@ -88,7 +91,8 @@ class DifferentialDrivetrainSim {
    * @param leftVoltage  The left voltage.
    * @param rightVoltage The right voltage.
    */
-  void SetInputs(wpi::units::volt_t leftVoltage, wpi::units::volt_t rightVoltage);
+  void SetInputs(wpi::units::volt_t leftVoltage,
+                 wpi::units::volt_t rightVoltage);
 
   /**
    * Sets the gearing reduction on the drivetrain. This is commonly used for
@@ -101,8 +105,8 @@ class DifferentialDrivetrainSim {
   /**
    * Updates the simulation.
    *
-   * @param dt The time that's passed since the last Update(wpi::units::second_t)
-   *           call.
+   * @param dt The time that's passed since the last
+   * Update(wpi::units::second_t) call.
    */
   void Update(wpi::units::second_t dt);
 
@@ -193,7 +197,8 @@ class DifferentialDrivetrainSim {
    * @param u The input.
    * @return The state derivative with respect to time.
    */
-  wpi::math::Vectord<7> Dynamics(const wpi::math::Vectord<7>& x, const Eigen::Vector2d& u);
+  wpi::math::Vectord<7> Dynamics(const wpi::math::Vectord<7>& x,
+                                 const Eigen::Vector2d& u);
 
   class State {
    public:
@@ -234,14 +239,17 @@ class DifferentialDrivetrainSim {
   class KitbotMotor {
    public:
     /// One CIM motor per drive side.
-    static constexpr wpi::math::DCMotor SingleCIMPerSide = wpi::math::DCMotor::CIM(1);
+    static constexpr wpi::math::DCMotor SingleCIMPerSide =
+        wpi::math::DCMotor::CIM(1);
     /// Two CIM motors per drive side.
-    static constexpr wpi::math::DCMotor DualCIMPerSide = wpi::math::DCMotor::CIM(2);
+    static constexpr wpi::math::DCMotor DualCIMPerSide =
+        wpi::math::DCMotor::CIM(2);
     /// One Mini CIM motor per drive side.
     static constexpr wpi::math::DCMotor SingleMiniCIMPerSide =
         wpi::math::DCMotor::MiniCIM(1);
     /// Two Mini CIM motors per drive side.
-    static constexpr wpi::math::DCMotor DualMiniCIMPerSide = wpi::math::DCMotor::MiniCIM(2);
+    static constexpr wpi::math::DCMotor DualMiniCIMPerSide =
+        wpi::math::DCMotor::MiniCIM(2);
     /// One Falcon 500 motor per drive side.
     static constexpr wpi::math::DCMotor SingleFalcon500PerSide =
         wpi::math::DCMotor::Falcon500(1);
@@ -249,9 +257,11 @@ class DifferentialDrivetrainSim {
     static constexpr wpi::math::DCMotor DualFalcon500PerSide =
         wpi::math::DCMotor::Falcon500(2);
     /// One NEO motor per drive side.
-    static constexpr wpi::math::DCMotor SingleNEOPerSide = wpi::math::DCMotor::NEO(1);
+    static constexpr wpi::math::DCMotor SingleNEOPerSide =
+        wpi::math::DCMotor::NEO(1);
     /// Two NEO motors per drive side.
-    static constexpr wpi::math::DCMotor DualNEOPerSide = wpi::math::DCMotor::NEO(2);
+    static constexpr wpi::math::DCMotor DualNEOPerSide =
+        wpi::math::DCMotor::NEO(2);
   };
 
   /**
@@ -285,9 +295,9 @@ class DifferentialDrivetrainSim {
       const std::array& measurementStdDevs = {}) {
     // MOI estimation -- note that I = mr² for point masses
     wpi::units::kilogram_square_meter_t batteryMoi = 12.5_lb * 10_in * 10_in;
-    wpi::units::kilogram_square_meter_t gearboxMoi = (2.8_lb + 2.0_lb) *
-                                                2  // CIM plus toughbox per side
-                                                * (26_in / 2) * (26_in / 2);
+    wpi::units::kilogram_square_meter_t gearboxMoi =
+        (2.8_lb + 2.0_lb) * 2  // CIM plus toughbox per side
+        * (26_in / 2) * (26_in / 2);
 
     return DifferentialDrivetrainSim{
         motor,           gearing, batteryMoi + gearboxMoi, 60_lb,
diff --git a/wpilibc/src/main/native/include/wpi/simulation/ElevatorSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/ElevatorSim.hpp
index 43d246de08..b04894152e 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/ElevatorSim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/ElevatorSim.hpp
@@ -19,12 +19,13 @@ namespace wpi::sim {
 class ElevatorSim : public LinearSystemSim<2, 1, 2> {
  public:
   template 
-  using Velocity_t = wpi::units::unit_t<
-      wpi::units::compound_unit>>;
+  using Velocity_t = wpi::units::unit_t>>;
 
   template 
   using Acceleration_t = wpi::units::unit_t>,
+      wpi::units::compound_unit>,
       wpi::units::inverse>>;
 
   /**
@@ -41,9 +42,10 @@ class ElevatorSim : public LinearSystemSim<2, 1, 2> {
    * @param startingHeight     The starting height of the elevator.
    * @param measurementStdDevs The standard deviation of the measurements.
    */
-  ElevatorSim(const wpi::math::LinearSystem<2, 1, 2>& plant, const wpi::math::DCMotor& gearbox,
-              wpi::units::meter_t minHeight, wpi::units::meter_t maxHeight,
-              bool simulateGravity, wpi::units::meter_t startingHeight,
+  ElevatorSim(const wpi::math::LinearSystem<2, 1, 2>& plant,
+              const wpi::math::DCMotor& gearbox, wpi::units::meter_t minHeight,
+              wpi::units::meter_t maxHeight, bool simulateGravity,
+              wpi::units::meter_t startingHeight,
               const std::array& measurementStdDevs = {0.0, 0.0});
 
   /**
@@ -63,9 +65,10 @@ class ElevatorSim : public LinearSystemSim<2, 1, 2> {
    * @param measurementStdDevs The standard deviation of the measurements.
    */
   ElevatorSim(const wpi::math::DCMotor& gearbox, double gearing,
-              wpi::units::kilogram_t carriageMass, wpi::units::meter_t drumRadius,
-              wpi::units::meter_t minHeight, wpi::units::meter_t maxHeight,
-              bool simulateGravity, wpi::units::meter_t startingHeight,
+              wpi::units::kilogram_t carriageMass,
+              wpi::units::meter_t drumRadius, wpi::units::meter_t minHeight,
+              wpi::units::meter_t maxHeight, bool simulateGravity,
+              wpi::units::meter_t startingHeight,
               const std::array& measurementStdDevs = {0.0, 0.0});
 
   /**
@@ -98,7 +101,8 @@ class ElevatorSim : public LinearSystemSim<2, 1, 2> {
    * @param position The new position
    * @param velocity The new velocity
    */
-  void SetState(wpi::units::meter_t position, wpi::units::meters_per_second_t velocity);
+  void SetState(wpi::units::meter_t position,
+                wpi::units::meters_per_second_t velocity);
 
   /**
    * Returns whether the elevator would hit the lower limit.
@@ -166,8 +170,9 @@ class ElevatorSim : public LinearSystemSim<2, 1, 2> {
    * @param u           The system inputs (voltage).
    * @param dt          The time difference between controller updates.
    */
-  wpi::math::Vectord<2> UpdateX(const wpi::math::Vectord<2>& currentXhat, const wpi::math::Vectord<1>& u,
-                     wpi::units::second_t dt) override;
+  wpi::math::Vectord<2> UpdateX(const wpi::math::Vectord<2>& currentXhat,
+                                const wpi::math::Vectord<1>& u,
+                                wpi::units::second_t dt) override;
 
  private:
   wpi::math::DCMotor m_gearbox;
diff --git a/wpilibc/src/main/native/include/wpi/simulation/FlywheelSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/FlywheelSim.hpp
index 54a2aa7326..07a684fdac 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/FlywheelSim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/FlywheelSim.hpp
@@ -29,7 +29,8 @@ class FlywheelSim : public LinearSystemSim<1, 1, 1> {
    *                           gearbox.
    * @param measurementStdDevs The standard deviation of the measurement noise.
    */
-  FlywheelSim(const wpi::math::LinearSystem<1, 1, 1>& plant, const wpi::math::DCMotor& gearbox,
+  FlywheelSim(const wpi::math::LinearSystem<1, 1, 1>& plant,
+              const wpi::math::DCMotor& gearbox,
               const std::array& measurementStdDevs = {0.0});
 
   using LinearSystemSim::SetState;
diff --git a/wpilibc/src/main/native/include/wpi/simulation/LinearSystemSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/LinearSystemSim.hpp
index 550c5d640f..69708cbb88 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/LinearSystemSim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/LinearSystemSim.hpp
@@ -131,9 +131,9 @@ class LinearSystemSim {
    * @param u           The system inputs (usually voltage).
    * @param dt          The time difference between controller updates.
    */
-  virtual wpi::math::Vectord UpdateX(const wpi::math::Vectord& currentXhat,
-                                  const wpi::math::Vectord& u,
-                                  wpi::units::second_t dt) {
+  virtual wpi::math::Vectord UpdateX(
+      const wpi::math::Vectord& currentXhat,
+      const wpi::math::Vectord& u, wpi::units::second_t dt) {
     return m_plant.CalculateX(currentXhat, u, dt);
   }
 
diff --git a/wpilibc/src/main/native/include/wpi/simulation/SingleJointedArmSim.hpp b/wpilibc/src/main/native/include/wpi/simulation/SingleJointedArmSim.hpp
index 52caea5801..a7be6f6137 100644
--- a/wpilibc/src/main/native/include/wpi/simulation/SingleJointedArmSim.hpp
+++ b/wpilibc/src/main/native/include/wpi/simulation/SingleJointedArmSim.hpp
@@ -37,7 +37,8 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> {
    */
   SingleJointedArmSim(const wpi::math::LinearSystem<2, 1, 2>& system,
                       const wpi::math::DCMotor& gearbox, double gearing,
-                      wpi::units::meter_t armLength, wpi::units::radian_t minAngle,
+                      wpi::units::meter_t armLength,
+                      wpi::units::radian_t minAngle,
                       wpi::units::radian_t maxAngle, bool simulateGravity,
                       wpi::units::radian_t startingAngle,
                       const std::array& measurementStdDevs = {0.0,
@@ -57,13 +58,12 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> {
    * @param startingAngle      The initial position of the arm.
    * @param measurementStdDevs The standard deviation of the measurement noise.
    */
-  SingleJointedArmSim(const wpi::math::DCMotor& gearbox, double gearing,
-                      wpi::units::kilogram_square_meter_t moi,
-                      wpi::units::meter_t armLength, wpi::units::radian_t minAngle,
-                      wpi::units::radian_t maxAngle, bool simulateGravity,
-                      wpi::units::radian_t startingAngle,
-                      const std::array& measurementStdDevs = {0.0,
-                                                                         0.0});
+  SingleJointedArmSim(
+      const wpi::math::DCMotor& gearbox, double gearing,
+      wpi::units::kilogram_square_meter_t moi, wpi::units::meter_t armLength,
+      wpi::units::radian_t minAngle, wpi::units::radian_t maxAngle,
+      bool simulateGravity, wpi::units::radian_t startingAngle,
+      const std::array& measurementStdDevs = {0.0, 0.0});
 
   using LinearSystemSim::SetState;
 
@@ -74,7 +74,8 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> {
    * @param angle The new angle.
    * @param velocity The new angular velocity.
    */
-  void SetState(wpi::units::radian_t angle, wpi::units::radians_per_second_t velocity);
+  void SetState(wpi::units::radian_t angle,
+                wpi::units::radians_per_second_t velocity);
 
   /**
    * Returns whether the arm would hit the lower limit.
@@ -156,8 +157,9 @@ class SingleJointedArmSim : public LinearSystemSim<2, 1, 2> {
    * @param u           The system inputs (voltage).
    * @param dt          The time difference between controller updates.
    */
-  wpi::math::Vectord<2> UpdateX(const wpi::math::Vectord<2>& currentXhat, const wpi::math::Vectord<1>& u,
-                     wpi::units::second_t dt) override;
+  wpi::math::Vectord<2> UpdateX(const wpi::math::Vectord<2>& currentXhat,
+                                const wpi::math::Vectord<1>& u,
+                                wpi::units::second_t dt) override;
 
  private:
   wpi::units::meter_t m_armLen;
diff --git a/wpilibc/src/main/native/include/wpi/smartdashboard/Field2d.hpp b/wpilibc/src/main/native/include/wpi/smartdashboard/Field2d.hpp
index ecd564b109..0e9e3a5696 100644
--- a/wpilibc/src/main/native/include/wpi/smartdashboard/Field2d.hpp
+++ b/wpilibc/src/main/native/include/wpi/smartdashboard/Field2d.hpp
@@ -38,7 +38,8 @@ namespace wpi {
  * also be shown by using the GetObject() function.  Other objects can
  * also have multiple poses (which will show the object at multiple locations).
  */
-class Field2d : public wpi::nt::NTSendable, public wpi::util::SendableHelper {
+class Field2d : public wpi::nt::NTSendable,
+                public wpi::util::SendableHelper {
  public:
   using Entry = size_t;
 
@@ -61,7 +62,8 @@ class Field2d : public wpi::nt::NTSendable, public wpi::util::SendableHelper GetPoses(wpi::util::SmallVectorImpl& out) const;
+  std::span GetPoses(
+      wpi::util::SmallVectorImpl& out) const;
 
  private:
   void UpdateEntry(bool setDefault = false);
diff --git a/wpilibc/src/main/native/include/wpi/smartdashboard/SendableBuilderImpl.hpp b/wpilibc/src/main/native/include/wpi/smartdashboard/SendableBuilderImpl.hpp
index 7d913498af..50518f4f42 100644
--- a/wpilibc/src/main/native/include/wpi/smartdashboard/SendableBuilderImpl.hpp
+++ b/wpilibc/src/main/native/include/wpi/smartdashboard/SendableBuilderImpl.hpp
@@ -155,7 +155,8 @@ class SendableBuilderImpl : public wpi::nt::NTSendableBuilder {
 
   void AddSmallStringProperty(
       std::string_view key,
-      std::function& buf)> getter,
+      std::function& buf)>
+          getter,
       std::function setter) override;
 
   void AddSmallBooleanArrayProperty(
@@ -173,26 +174,29 @@ class SendableBuilderImpl : public wpi::nt::NTSendableBuilder {
 
   void AddSmallFloatArrayProperty(
       std::string_view key,
-      std::function(wpi::util::SmallVectorImpl& buf)>
+      std::function<
+          std::span(wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) override;
 
   void AddSmallDoubleArrayProperty(
       std::string_view key,
-      std::function(wpi::util::SmallVectorImpl& buf)>
+      std::function<
+          std::span(wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) override;
 
   void AddSmallStringArrayProperty(
       std::string_view key,
-      std::function<
-          std::span(wpi::util::SmallVectorImpl& buf)>
+      std::function(
+          wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) override;
 
   void AddSmallRawProperty(
       std::string_view key, std::string_view typeString,
-      std::function(wpi::util::SmallVectorImpl& buf)>
+      std::function<
+          std::span(wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) override;
 
diff --git a/wpilibc/src/main/native/include/wpi/smartdashboard/SendableChooserBase.hpp b/wpilibc/src/main/native/include/wpi/smartdashboard/SendableChooserBase.hpp
index 292634847e..0824870094 100644
--- a/wpilibc/src/main/native/include/wpi/smartdashboard/SendableChooserBase.hpp
+++ b/wpilibc/src/main/native/include/wpi/smartdashboard/SendableChooserBase.hpp
@@ -19,8 +19,9 @@ namespace wpi {
  * It contains static, non-templated variables to avoid their duplication in the
  * template class.
  */
-class SendableChooserBase : public wpi::util::Sendable,
-                            public wpi::util::SendableHelper {
+class SendableChooserBase
+    : public wpi::util::Sendable,
+      public wpi::util::SendableHelper {
  public:
   SendableChooserBase();
   ~SendableChooserBase() override = default;
diff --git a/wpilibc/src/main/native/include/wpi/smartdashboard/SmartDashboard.hpp b/wpilibc/src/main/native/include/wpi/smartdashboard/SmartDashboard.hpp
index 07ffb78f4e..ed5c68e581 100644
--- a/wpilibc/src/main/native/include/wpi/smartdashboard/SmartDashboard.hpp
+++ b/wpilibc/src/main/native/include/wpi/smartdashboard/SmartDashboard.hpp
@@ -16,7 +16,7 @@
 
 namespace wpi::util {
 class Sendable;
-}  // namespace wpi
+}  // namespace wpi::util
 
 namespace wpi {
 
diff --git a/wpilibc/src/main/native/include/wpi/sysid/SysIdRoutineLog.hpp b/wpilibc/src/main/native/include/wpi/sysid/SysIdRoutineLog.hpp
index 9456ee607e..23b2801dd2 100644
--- a/wpilibc/src/main/native/include/wpi/sysid/SysIdRoutineLog.hpp
+++ b/wpilibc/src/main/native/include/wpi/sysid/SysIdRoutineLog.hpp
@@ -116,7 +116,8 @@ class SysIdRoutineLog {
      * @param acceleration The linear acceleration to record.
      * @return The motor log (for call chaining).
      */
-    MotorLog& acceleration(wpi::units::meters_per_second_squared_t acceleration) {
+    MotorLog& acceleration(
+        wpi::units::meters_per_second_squared_t acceleration) {
       return value("acceleration", acceleration.value(), acceleration.name());
     }
 
@@ -128,7 +129,8 @@ class SysIdRoutineLog {
      * @param acceleration The angular acceleration to record.
      * @return The motor log (for call chaining).
      */
-    MotorLog& acceleration(wpi::units::turns_per_second_squared_t acceleration) {
+    MotorLog& acceleration(
+        wpi::units::turns_per_second_squared_t acceleration) {
       return value("acceleration", acceleration.value(), acceleration.name());
     }
 
diff --git a/wpilibc/src/main/native/include/wpi/system/DataLogManager.hpp b/wpilibc/src/main/native/include/wpi/system/DataLogManager.hpp
index e3bc7d6a28..db3880e9c3 100644
--- a/wpilibc/src/main/native/include/wpi/system/DataLogManager.hpp
+++ b/wpilibc/src/main/native/include/wpi/system/DataLogManager.hpp
@@ -26,9 +26,9 @@ namespace wpi {
  * connected and provides a match number, the log file is renamed to
  * "WPILIB_yyyyMMdd_HHmmss_{event}_{match}.wpilog".
  *
- * On startup, all existing WPILIB_TBD log files are deleted. If there is less than
- * 50 MB of free space on the target storage, WPILIB_ log files are deleted (oldest
- * to newest) until there is 50 MB free OR there are 10 files remaining.
+ * On startup, all existing WPILIB_TBD log files are deleted. If there is less
+ * than 50 MB of free space on the target storage, WPILIB_ log files are deleted
+ * (oldest to newest) until there is 50 MB free OR there are 10 files remaining.
  *
  * By default, all NetworkTables value changes are stored to the data log.
  */
diff --git a/wpilibc/src/main/native/include/wpi/system/Errors.hpp b/wpilibc/src/main/native/include/wpi/system/Errors.hpp
index 6464fe7698..6e271b2505 100644
--- a/wpilibc/src/main/native/include/wpi/system/Errors.hpp
+++ b/wpilibc/src/main/native/include/wpi/system/Errors.hpp
@@ -134,7 +134,7 @@ namespace warn {
  * @param[out] status error code
  * @param[in]  format error message format
  */
-#define WPILIB_ReportError(status, format, ...)                       \
+#define WPILIB_ReportError(status, format, ...)                    \
   do {                                                             \
     if ((status) != 0) {                                           \
       ::wpi::ReportError(status, __FILE__, __LINE__, __FUNCTION__, \
@@ -147,7 +147,7 @@ namespace warn {
  *
  * @param[in]  format error message format
  */
-#define WPILIB_ReportWarning(format, ...)                                         \
+#define WPILIB_ReportWarning(format, ...)                                      \
   do {                                                                         \
     ::wpi::ReportError(::wpi::warn::Warning, __FILE__, __LINE__, __FUNCTION__, \
                        format __VA_OPT__(, ) __VA_ARGS__);                     \
@@ -161,7 +161,7 @@ namespace warn {
  * @param[in]  format error message format
  * @return runtime error object
  */
-#define WPILIB_MakeError(status, format, ...)                   \
+#define WPILIB_MakeError(status, format, ...)                \
   ::wpi::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
                    format __VA_OPT__(, ) __VA_ARGS__)
 
@@ -172,7 +172,7 @@ namespace warn {
  * @param[out] status error code
  * @param[in]  format error message format
  */
-#define WPILIB_CheckErrorStatus(status, format, ...)                      \
+#define WPILIB_CheckErrorStatus(status, format, ...)                   \
   do {                                                                 \
     if ((status) < 0) {                                                \
       throw ::wpi::MakeError(status, __FILE__, __LINE__, __FUNCTION__, \
@@ -183,7 +183,7 @@ namespace warn {
     }                                                                  \
   } while (0)
 
-#define WPILIB_AssertMessage(condition, format, ...)                              \
+#define WPILIB_AssertMessage(condition, format, ...)                           \
   do {                                                                         \
     if (!(condition)) {                                                        \
       throw ::wpi::MakeError(::wpi::err::AssertionFailure, __FILE__, __LINE__, \
diff --git a/wpilibc/src/main/native/include/wpi/system/ScopedTracer.hpp b/wpilibc/src/main/native/include/wpi/system/ScopedTracer.hpp
index 18dfac3a94..36d360bdd5 100644
--- a/wpilibc/src/main/native/include/wpi/system/ScopedTracer.hpp
+++ b/wpilibc/src/main/native/include/wpi/system/ScopedTracer.hpp
@@ -11,7 +11,7 @@
 
 namespace wpi::util {
 class raw_ostream;
-}  // namespace wpi
+}  // namespace wpi::util
 
 namespace wpi {
 /**
diff --git a/wpilibc/src/main/native/include/wpi/system/Tracer.hpp b/wpilibc/src/main/native/include/wpi/system/Tracer.hpp
index be139a289e..d452a3afc9 100644
--- a/wpilibc/src/main/native/include/wpi/system/Tracer.hpp
+++ b/wpilibc/src/main/native/include/wpi/system/Tracer.hpp
@@ -12,7 +12,7 @@
 
 namespace wpi::util {
 class raw_ostream;
-}  // namespace wpi
+}  // namespace wpi::util
 
 namespace wpi {
 /**
@@ -66,7 +66,8 @@ class Tracer {
   static constexpr std::chrono::milliseconds kMinPrintPeriod{1000};
 
   wpi::hal::fpga_clock::time_point m_startTime;
-  wpi::hal::fpga_clock::time_point m_lastEpochsPrintTime = wpi::hal::fpga_clock::epoch();
+  wpi::hal::fpga_clock::time_point m_lastEpochsPrintTime =
+      wpi::hal::fpga_clock::epoch();
 
   wpi::util::StringMap m_epochs;
 };
diff --git a/wpilibc/src/main/native/include/wpi/system/Watchdog.hpp b/wpilibc/src/main/native/include/wpi/system/Watchdog.hpp
index bd27ad2f9d..c64968c3ac 100644
--- a/wpilibc/src/main/native/include/wpi/system/Watchdog.hpp
+++ b/wpilibc/src/main/native/include/wpi/system/Watchdog.hpp
@@ -34,7 +34,8 @@ class Watchdog {
   Watchdog(wpi::units::second_t timeout, std::function callback);
 
   template 
-  Watchdog(wpi::units::second_t timeout, Callable&& f, Arg&& arg, Args&&... args)
+  Watchdog(wpi::units::second_t timeout, Callable&& f, Arg&& arg,
+           Args&&... args)
       : Watchdog(timeout,
                  std::bind(std::forward(f), std::forward(arg),
                            std::forward(args)...)) {}
diff --git a/wpilibc/src/main/native/include/wpi/util/Color.hpp b/wpilibc/src/main/native/include/wpi/util/Color.hpp
index f1ea0f5ded..4e75c55ad0 100644
--- a/wpilibc/src/main/native/include/wpi/util/Color.hpp
+++ b/wpilibc/src/main/native/include/wpi/util/Color.hpp
@@ -782,9 +782,12 @@ class Color {
    */
   explicit constexpr Color(std::string_view hexString) {
     if (hexString.length() != 7 || !hexString.starts_with("#") ||
-        !wpi::util::isHexDigit(hexString[1]) || !wpi::util::isHexDigit(hexString[2]) ||
-        !wpi::util::isHexDigit(hexString[3]) || !wpi::util::isHexDigit(hexString[4]) ||
-        !wpi::util::isHexDigit(hexString[5]) || !wpi::util::isHexDigit(hexString[6])) {
+        !wpi::util::isHexDigit(hexString[1]) ||
+        !wpi::util::isHexDigit(hexString[2]) ||
+        !wpi::util::isHexDigit(hexString[3]) ||
+        !wpi::util::isHexDigit(hexString[4]) ||
+        !wpi::util::isHexDigit(hexString[5]) ||
+        !wpi::util::isHexDigit(hexString[6])) {
       throw std::invalid_argument(
           fmt::format("Invalid hex string for Color \"{}\"", hexString));
     }
@@ -861,8 +864,8 @@ class Color {
 
     return wpi::util::ct_string, 7>{
         {'#', wpi::util::hexdigit(r / 16), wpi::util::hexdigit(r % 16),
-         wpi::util::hexdigit(g / 16), wpi::util::hexdigit(g % 16), wpi::util::hexdigit(b / 16),
-         wpi::util::hexdigit(b % 16)}};
+         wpi::util::hexdigit(g / 16), wpi::util::hexdigit(g % 16),
+         wpi::util::hexdigit(b / 16), wpi::util::hexdigit(b % 16)}};
   }
 
   /// Red component (0-1).
diff --git a/wpilibc/src/main/native/include/wpi/util/Color8Bit.hpp b/wpilibc/src/main/native/include/wpi/util/Color8Bit.hpp
index 09a856ea9c..6be64a9252 100644
--- a/wpilibc/src/main/native/include/wpi/util/Color8Bit.hpp
+++ b/wpilibc/src/main/native/include/wpi/util/Color8Bit.hpp
@@ -57,9 +57,12 @@ class Color8Bit {
    */
   explicit constexpr Color8Bit(std::string_view hexString) {
     if (hexString.length() != 7 || !hexString.starts_with("#") ||
-        !wpi::util::isHexDigit(hexString[1]) || !wpi::util::isHexDigit(hexString[2]) ||
-        !wpi::util::isHexDigit(hexString[3]) || !wpi::util::isHexDigit(hexString[4]) ||
-        !wpi::util::isHexDigit(hexString[5]) || !wpi::util::isHexDigit(hexString[6])) {
+        !wpi::util::isHexDigit(hexString[1]) ||
+        !wpi::util::isHexDigit(hexString[2]) ||
+        !wpi::util::isHexDigit(hexString[3]) ||
+        !wpi::util::isHexDigit(hexString[4]) ||
+        !wpi::util::isHexDigit(hexString[5]) ||
+        !wpi::util::isHexDigit(hexString[6])) {
       throw std::invalid_argument(
           fmt::format("Invalid hex string for Color \"{}\"", hexString));
     }
@@ -87,9 +90,12 @@ class Color8Bit {
    */
   static constexpr Color8Bit FromHexString(std::string_view hexString) {
     if (hexString.length() != 7 || !hexString.starts_with("#") ||
-        !wpi::util::isHexDigit(hexString[1]) || !wpi::util::isHexDigit(hexString[2]) ||
-        !wpi::util::isHexDigit(hexString[3]) || !wpi::util::isHexDigit(hexString[4]) ||
-        !wpi::util::isHexDigit(hexString[5]) || !wpi::util::isHexDigit(hexString[6])) {
+        !wpi::util::isHexDigit(hexString[1]) ||
+        !wpi::util::isHexDigit(hexString[2]) ||
+        !wpi::util::isHexDigit(hexString[3]) ||
+        !wpi::util::isHexDigit(hexString[4]) ||
+        !wpi::util::isHexDigit(hexString[5]) ||
+        !wpi::util::isHexDigit(hexString[6])) {
       throw std::invalid_argument(
           fmt::format("Invalid hex string for Color \"{}\"", hexString));
     }
diff --git a/wpilibc/src/test/native/cpp/AlertTest.cpp b/wpilibc/src/test/native/cpp/AlertTest.cpp
index 0af76e3db6..f3bec9227c 100644
--- a/wpilibc/src/test/native/cpp/AlertTest.cpp
+++ b/wpilibc/src/test/native/cpp/AlertTest.cpp
@@ -68,7 +68,8 @@ class AlertsTest : public ::testing::Test {
     }
   }
 
-  const wpi::nt::StringArraySubscriber GetSubscriberForType(Alert::AlertType type) {
+  const wpi::nt::StringArraySubscriber GetSubscriberForType(
+      Alert::AlertType type) {
     return wpi::nt::NetworkTableInstance::GetDefault()
         .GetStringArrayTopic(fmt::format("/SmartDashboard/{}/{}",
                                          GetGroupName(), GetSubtableName(type)))
diff --git a/wpilibc/src/test/native/cpp/LEDPatternTest.cpp b/wpilibc/src/test/native/cpp/LEDPatternTest.cpp
index 4057e2c774..42f0a88194 100644
--- a/wpilibc/src/test/native/cpp/LEDPatternTest.cpp
+++ b/wpilibc/src/test/native/cpp/LEDPatternTest.cpp
@@ -1037,7 +1037,8 @@ void AssertIndexColor(std::span data, int index,
 }
 
 Color LerpColors(Color a, Color b, double t) {
-  return Color{wpi::util::Lerp(a.red, b.red, t), wpi::util::Lerp(a.green, b.green, t),
+  return Color{wpi::util::Lerp(a.red, b.red, t),
+               wpi::util::Lerp(a.green, b.green, t),
                wpi::util::Lerp(a.blue, b.blue, t)};
 }
 }  // namespace wpi
diff --git a/wpilibc/src/test/native/cpp/UnitNetworkTablesTest.cpp b/wpilibc/src/test/native/cpp/UnitNetworkTablesTest.cpp
index bcac069008..6b6f5afc1f 100644
--- a/wpilibc/src/test/native/cpp/UnitNetworkTablesTest.cpp
+++ b/wpilibc/src/test/native/cpp/UnitNetworkTablesTest.cpp
@@ -12,12 +12,15 @@
 class UnitNetworkTablesTest : public ::testing::Test {
  public:
   UnitNetworkTablesTest() : inst{wpi::nt::NetworkTableInstance::Create()} {}
-  ~UnitNetworkTablesTest() override { wpi::nt::NetworkTableInstance::Destroy(inst); }
+  ~UnitNetworkTablesTest() override {
+    wpi::nt::NetworkTableInstance::Destroy(inst);
+  }
   wpi::nt::NetworkTableInstance inst;
 };
 
 TEST_F(UnitNetworkTablesTest, Publish) {
-  auto topic = wpi::nt::UnitTopic{inst.GetTopic("meterTest")};
+  auto topic =
+      wpi::nt::UnitTopic{inst.GetTopic("meterTest")};
   auto pub = topic.Publish();
   pub.Set(2_m);
   ASSERT_EQ(topic.GetProperty("unit"), "meter");
@@ -25,7 +28,8 @@ TEST_F(UnitNetworkTablesTest, Publish) {
 }
 
 TEST_F(UnitNetworkTablesTest, SubscribeDouble) {
-  auto topic = wpi::nt::UnitTopic{inst.GetTopic("meterTest")};
+  auto topic =
+      wpi::nt::UnitTopic{inst.GetTopic("meterTest")};
   auto pub = topic.Publish();
   auto sub = inst.GetDoubleTopic("meterTest").Subscribe(0);
   ASSERT_EQ(sub.Get(), 0);
@@ -35,7 +39,8 @@ TEST_F(UnitNetworkTablesTest, SubscribeDouble) {
 }
 
 TEST_F(UnitNetworkTablesTest, SubscribeUnit) {
-  auto topic = wpi::nt::UnitTopic{inst.GetTopic("meterTest")};
+  auto topic =
+      wpi::nt::UnitTopic{inst.GetTopic("meterTest")};
   auto pub = topic.Publish();
   auto sub = topic.Subscribe(0_m);
   ASSERT_EQ(sub.Get(), 0_m);
diff --git a/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp
index ec67dfdbe0..1ce8052fae 100644
--- a/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp
+++ b/wpilibc/src/test/native/cpp/simulation/DCMotorSimTest.cpp
@@ -17,7 +17,8 @@
 TEST(DCMotorSimTest, VoltageSteadyState) {
   wpi::math::DCMotor gearbox = wpi::math::DCMotor::NEO(1);
   auto plant = wpi::math::LinearSystemId::DCMotorSystem(
-      wpi::math::DCMotor::NEO(1), wpi::units::kilogram_square_meter_t{0.0005}, 1.0);
+      wpi::math::DCMotor::NEO(1), wpi::units::kilogram_square_meter_t{0.0005},
+      1.0);
   wpi::sim::DCMotorSim sim{plant, gearbox};
 
   wpi::Encoder encoder{0, 1};
@@ -63,7 +64,8 @@ TEST(DCMotorSimTest, VoltageSteadyState) {
 TEST(DCMotorSimTest, PositionFeedbackControl) {
   wpi::math::DCMotor gearbox = wpi::math::DCMotor::NEO(1);
   auto plant = wpi::math::LinearSystemId::DCMotorSystem(
-      wpi::math::DCMotor::NEO(1), wpi::units::kilogram_square_meter_t{0.0005}, 1.0);
+      wpi::math::DCMotor::NEO(1), wpi::units::kilogram_square_meter_t{0.0005},
+      1.0);
   wpi::sim::DCMotorSim sim{plant, gearbox};
 
   wpi::math::PIDController controller{0.04, 0.0, 0.001};
diff --git a/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp
index 2567378170..fde18bfaa2 100644
--- a/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp
+++ b/wpilibc/src/test/native/cpp/simulation/DifferentialDrivetrainSimTest.cpp
@@ -51,7 +51,8 @@ TEST(DifferentialDrivetrainSimTest, Convergence) {
         feedforward.Calculate(wpi::math::Vectord<2>{l.value(), r.value()});
 
     // Sim periodic code.
-    sim.SetInputs(wpi::units::volt_t{voltages(0, 0)}, wpi::units::volt_t{voltages(1, 0)});
+    sim.SetInputs(wpi::units::volt_t{voltages(0, 0)},
+                  wpi::units::volt_t{voltages(1, 0)});
     sim.Update(20_ms);
 
     // Update ground truth.
diff --git a/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp
index d1d7b382f5..bfc64766d9 100644
--- a/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp
+++ b/wpilibc/src/test/native/cpp/simulation/ElevatorSimTest.cpp
@@ -20,8 +20,8 @@
   EXPECT_LE(wpi::units::math::abs(val1 - val2), eps)
 
 TEST(ElevatorSimTest, StateSpaceSim) {
-  wpi::sim::ElevatorSim sim(wpi::math::DCMotor::Vex775Pro(4), 14.67, 8_kg, 0.75_in,
-                            0_m, 3_m, true, 0_m, {0.01});
+  wpi::sim::ElevatorSim sim(wpi::math::DCMotor::Vex775Pro(4), 14.67, 8_kg,
+                            0.75_in, 0_m, 3_m, true, 0_m, {0.01});
   wpi::math::PIDController controller(10, 0.0, 0.0);
 
   wpi::PWMVictorSPX motor(0);
@@ -33,7 +33,8 @@ TEST(ElevatorSimTest, StateSpaceSim) {
     auto nextVoltage = controller.Calculate(encoderSim.GetDistance());
     motor.Set(nextVoltage / wpi::RobotController::GetInputVoltage());
 
-    wpi::math::Vectord<1> u{motor.Get() * wpi::RobotController::GetInputVoltage()};
+    wpi::math::Vectord<1> u{motor.Get() *
+                            wpi::RobotController::GetInputVoltage()};
     sim.SetInput(u);
     sim.Update(20_ms);
 
@@ -46,16 +47,16 @@ TEST(ElevatorSimTest, StateSpaceSim) {
 
 TEST(ElevatorSimTest, InitialState) {
   constexpr auto startingHeight = 0.5_m;
-  wpi::sim::ElevatorSim sim(wpi::math::DCMotor::KrakenX60(2), 20, 8_kg, 0.1_m, 0_m,
-                            1_m, true, startingHeight, {0.01, 0.0});
+  wpi::sim::ElevatorSim sim(wpi::math::DCMotor::KrakenX60(2), 20, 8_kg, 0.1_m,
+                            0_m, 1_m, true, startingHeight, {0.01, 0.0});
 
   EXPECT_DOUBLE_EQ(startingHeight.value(), sim.GetPosition().value());
   EXPECT_DOUBLE_EQ(0, sim.GetVelocity().value());
 }
 
 TEST(ElevatorSimTest, MinMax) {
-  wpi::sim::ElevatorSim sim(wpi::math::DCMotor::Vex775Pro(4), 14.67, 8_kg, 0.75_in,
-                            0_m, 1_m, true, 0_m, {0.01});
+  wpi::sim::ElevatorSim sim(wpi::math::DCMotor::Vex775Pro(4), 14.67, 8_kg,
+                            0.75_in, 0_m, 1_m, true, 0_m, {0.01});
   for (size_t i = 0; i < 100; ++i) {
     sim.SetInput(wpi::math::Vectord<1>{0.0});
     sim.Update(20_ms);
@@ -74,8 +75,14 @@ TEST(ElevatorSimTest, MinMax) {
 }
 
 TEST(ElevatorSimTest, Stability) {
-  wpi::sim::ElevatorSim sim{
-      wpi::math::DCMotor::Vex775Pro(4), 100, 4_kg, 0.5_in, 0_m, 10_m, false, 0_m};
+  wpi::sim::ElevatorSim sim{wpi::math::DCMotor::Vex775Pro(4),
+                            100,
+                            4_kg,
+                            0.5_in,
+                            0_m,
+                            10_m,
+                            false,
+                            0_m};
 
   sim.SetState(wpi::math::Vectord<2>{0.0, 0.0});
   sim.SetInput(wpi::math::Vectord<1>{12.0});
@@ -84,11 +91,11 @@ TEST(ElevatorSimTest, Stability) {
   }
 
   wpi::math::LinearSystem<2, 1, 1> system =
-      wpi::math::LinearSystemId::ElevatorSystem(wpi::math::DCMotor::Vex775Pro(4), 4_kg,
-                                          0.5_in, 100)
+      wpi::math::LinearSystemId::ElevatorSystem(
+          wpi::math::DCMotor::Vex775Pro(4), 4_kg, 0.5_in, 100)
           .Slice(0);
-  EXPECT_NEAR_UNITS(
-      wpi::units::meter_t{system.CalculateX(wpi::math::Vectord<2>{0.0, 0.0},
-                                       wpi::math::Vectord<1>{12.0}, 20_ms * 50)(0)},
-      sim.GetPosition(), 1_cm);
+  EXPECT_NEAR_UNITS(wpi::units::meter_t{system.CalculateX(
+                        wpi::math::Vectord<2>{0.0, 0.0},
+                        wpi::math::Vectord<1>{12.0}, 20_ms * 50)(0)},
+                    sim.GetPosition(), 1_cm);
 }
diff --git a/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp
index 29749a8290..25e6a3af65 100644
--- a/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp
+++ b/wpilibc/src/test/native/cpp/simulation/SingleJointedArmSimTest.cpp
@@ -9,8 +9,9 @@
 #include "wpi/simulation/SingleJointedArmSim.hpp"
 
 TEST(SingleJointedArmTest, Disabled) {
-  wpi::sim::SingleJointedArmSim sim(wpi::math::DCMotor::Vex775Pro(2), 300, 3_kg_sq_m,
-                                    30_in, -180_deg, 0_deg, true, 90_deg);
+  wpi::sim::SingleJointedArmSim sim(wpi::math::DCMotor::Vex775Pro(2), 300,
+                                    3_kg_sq_m, 30_in, -180_deg, 0_deg, true,
+                                    90_deg);
   sim.SetState(wpi::math::Vectord<2>{0.0, 0.0});
 
   for (size_t i = 0; i < 12 / 0.02; ++i) {
@@ -24,8 +25,9 @@ TEST(SingleJointedArmTest, Disabled) {
 
 TEST(SingleJointedArmTest, InitialState) {
   constexpr auto startingAngle = 45_deg;
-  wpi::sim::SingleJointedArmSim sim(wpi::math::DCMotor::KrakenX60(2), 125, 3_kg_sq_m,
-                                    30_in, 0_deg, 90_deg, true, startingAngle);
+  wpi::sim::SingleJointedArmSim sim(wpi::math::DCMotor::KrakenX60(2), 125,
+                                    3_kg_sq_m, 30_in, 0_deg, 90_deg, true,
+                                    startingAngle);
 
   EXPECT_EQ(startingAngle, sim.GetAngle());
   EXPECT_DOUBLE_EQ(0, sim.GetVelocity().value());
diff --git a/wpilibc/src/test/native/cpp/simulation/StateSpaceSimTest.cpp b/wpilibc/src/test/native/cpp/simulation/StateSpaceSimTest.cpp
index 2bc7ffa1d1..110d51e2d5 100644
--- a/wpilibc/src/test/native/cpp/simulation/StateSpaceSimTest.cpp
+++ b/wpilibc/src/test/native/cpp/simulation/StateSpaceSimTest.cpp
@@ -45,8 +45,8 @@ TEST(StateSpaceSimTest, FlywheelSim) {
     // Then, SimulationPeriodic runs
     wpi::sim::RoboRioSim::SetVInVoltage(
         wpi::sim::BatterySim::Calculate({sim.GetCurrentDraw()}));
-    sim.SetInput(
-        wpi::math::Vectord<1>{motor.Get() * wpi::RobotController::GetInputVoltage()});
+    sim.SetInput(wpi::math::Vectord<1>{
+        motor.Get() * wpi::RobotController::GetInputVoltage()});
     sim.Update(20_ms);
     encoderSim.SetRate(sim.GetAngularVelocity().value());
   }
diff --git a/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp b/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp
index 7d764cd55d..3d2713d2dd 100644
--- a/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp
+++ b/wpilibc/src/test/native/cpp/smartdashboard/Mechanism2dTest.cpp
@@ -58,7 +58,8 @@ TEST(Mechanism2dTest, Ligament) {
       "/SmartDashboard/mechanism/root/ligament/weight");
   wpi::MechanismRoot2d* root = mechanism.GetRoot("root", 1, 2);
   wpi::MechanismLigament2d* ligament = root->Append(
-      "ligament", 3, wpi::units::degree_t{90}, 1, wpi::Color8Bit{255, 255, 255});
+      "ligament", 3, wpi::units::degree_t{90}, 1,
+      wpi::Color8Bit{255, 255, 255});
   wpi::SmartDashboard::PutData("mechanism", &mechanism);
   EXPECT_EQ(ligament->GetAngle(), angleEntry.GetDouble(0.0));
   EXPECT_EQ(ligament->GetColor().HexString(), colorEntry.GetString(""));
diff --git a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp
index 4369e0aabd..b8c5aad1c6 100644
--- a/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp
+++ b/wpilibcExamples/src/main/cpp/commands/instantcommand/ReplaceMeInstantCommand2.hpp
@@ -12,7 +12,7 @@
 // https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
 class ReplaceMeInstantCommand2
     : public wpi::cmd::CommandHelper {
+                                     ReplaceMeInstantCommand2> {
  public:
   ReplaceMeInstantCommand2();
 
diff --git a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp
index 4405659dd1..b97973c357 100644
--- a/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp
+++ b/wpilibcExamples/src/main/cpp/commands/parallelcommandgroup/ReplaceMeParallelCommandGroup.hpp
@@ -12,7 +12,7 @@
 // https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
 class ReplaceMeParallelCommandGroup
     : public wpi::cmd::CommandHelper {
+                                     ReplaceMeParallelCommandGroup> {
  public:
   ReplaceMeParallelCommandGroup();
 };
diff --git a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp
index 6ed5c7d21a..0883a1f110 100644
--- a/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp
+++ b/wpilibcExamples/src/main/cpp/commands/paralleldeadlinegroup/ReplaceMeParallelDeadlineGroup.hpp
@@ -12,7 +12,7 @@
 // https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
 class ReplaceMeParallelDeadlineGroup
     : public wpi::cmd::CommandHelper {
+                                     ReplaceMeParallelDeadlineGroup> {
  public:
   ReplaceMeParallelDeadlineGroup();
 };
diff --git a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp
index 866e2916d2..c621890b73 100644
--- a/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp
+++ b/wpilibcExamples/src/main/cpp/commands/parallelracegroup/ReplaceMeParallelRaceGroup.hpp
@@ -12,7 +12,7 @@
 // https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
 class ReplaceMeParallelRaceGroup
     : public wpi::cmd::CommandHelper {
+                                     ReplaceMeParallelRaceGroup> {
  public:
   ReplaceMeParallelRaceGroup();
 };
diff --git a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp
index d15902cdd4..1cde0fb438 100644
--- a/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp
+++ b/wpilibcExamples/src/main/cpp/commands/sequentialcommandgroup/ReplaceMeSequentialCommandGroup.hpp
@@ -12,7 +12,7 @@
 // https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
 class ReplaceMeSequentialCommandGroup
     : public wpi::cmd::CommandHelper {
+                                     ReplaceMeSequentialCommandGroup> {
  public:
   ReplaceMeSequentialCommandGroup();
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp
index bfce06083a..b2b85d7085 100644
--- a/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/AprilTagsVision/cpp/Robot.cpp
@@ -118,14 +118,17 @@ class Robot : public wpi::TimedRobot {
         // draw lines around the tag
         for (int i = 0; i <= 3; i++) {
           int j = (i + 1) % 4;
-          const wpi::apriltag::AprilTagDetection::Point pti = detection->GetCorner(i);
-          const wpi::apriltag::AprilTagDetection::Point ptj = detection->GetCorner(j);
+          const wpi::apriltag::AprilTagDetection::Point pti =
+              detection->GetCorner(i);
+          const wpi::apriltag::AprilTagDetection::Point ptj =
+              detection->GetCorner(j);
           line(mat, cv::Point(pti.x, pti.y), cv::Point(ptj.x, ptj.y),
                outlineColor, 2);
         }
 
         // mark the center of the tag
-        const wpi::apriltag::AprilTagDetection::Point c = detection->GetCenter();
+        const wpi::apriltag::AprilTagDetection::Point c =
+            detection->GetCenter();
         int ll = 10;
         line(mat, cv::Point(c.x - ll, c.y), cv::Point(c.x + ll, c.y),
              crossColor, 2);
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 b443e5159b..15f0927b97 100644
--- a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/subsystems/Arm.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/subsystems/Arm.cpp
@@ -24,8 +24,8 @@ Arm::Arm() {
 void Arm::SimulationPeriodic() {
   // In this method, we update our simulation of what our arm is doing
   // First, we set our "inputs" (voltages)
-  m_armSim.SetInput(
-      wpi::math::Vectord<1>{m_motor.Get() * wpi::RobotController::GetInputVoltage()});
+  m_armSim.SetInput(wpi::math::Vectord<1>{
+      m_motor.Get() * wpi::RobotController::GetInputVoltage()});
 
   // Next, we update it. The standard loop time is 20ms.
   m_armSim.Update(20_ms);
diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Drivetrain.cpp
index 86a9a96b20..a684bd93ca 100644
--- a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Drivetrain.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/cpp/Drivetrain.cpp
@@ -4,7 +4,8 @@
 
 #include "Drivetrain.hpp"
 
-void Drivetrain::SetSpeeds(const wpi::math::DifferentialDriveWheelSpeeds& speeds) {
+void Drivetrain::SetSpeeds(
+    const wpi::math::DifferentialDriveWheelSpeeds& speeds) {
   const auto leftFeedforward = m_feedforward.Calculate(speeds.left);
   const auto rightFeedforward = m_feedforward.Calculate(speeds.right);
   const double leftOutput = m_leftPIDController.Calculate(
diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp
index 6487ac102b..c338175fcd 100644
--- a/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDriveBot/include/Drivetrain.hpp
@@ -80,5 +80,6 @@ class Drivetrain {
 
   // Gains are for example purposes only - must be determined for your own
   // robot!
-  wpi::math::SimpleMotorFeedforward m_feedforward{1_V, 3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_feedforward{
+      1_V, 3_V / 1_mps};
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Drivetrain.cpp
index a18e8dd08a..ddf0bd99bc 100644
--- a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Drivetrain.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/cpp/Drivetrain.cpp
@@ -32,7 +32,8 @@ Drivetrain::Drivetrain() {
   wpi::SmartDashboard::PutData("Approximation", &m_fieldApproximation);
 }
 
-void Drivetrain::SetSpeeds(const wpi::math::DifferentialDriveWheelSpeeds& speeds) {
+void Drivetrain::SetSpeeds(
+    const wpi::math::DifferentialDriveWheelSpeeds& speeds) {
   const auto leftFeedforward = m_feedforward.Calculate(speeds.left);
   const auto rightFeedforward = m_feedforward.Calculate(speeds.right);
   const double leftOutput = m_leftPIDController.Calculate(
@@ -75,12 +76,15 @@ wpi::math::Pose3d Drivetrain::ObjectToRobotPose(
   std::vector val{cameraToObjectEntry.Get()};
 
   // Reconstruct cameraToObject Transform3D from networktables.
-  wpi::math::Translation3d translation{wpi::units::meter_t{val[0]}, wpi::units::meter_t{val[1]},
-                                 wpi::units::meter_t{val[2]}};
-  wpi::math::Rotation3d rotation{wpi::math::Quaternion{val[3], val[4], val[5], val[6]}};
+  wpi::math::Translation3d translation{wpi::units::meter_t{val[0]},
+                                       wpi::units::meter_t{val[1]},
+                                       wpi::units::meter_t{val[2]}};
+  wpi::math::Rotation3d rotation{
+      wpi::math::Quaternion{val[3], val[4], val[5], val[6]}};
   wpi::math::Transform3d cameraToObject{translation, rotation};
 
-  return wpi::math::ObjectToRobotPose(objectInField, cameraToObject, robotToCamera);
+  return wpi::math::ObjectToRobotPose(objectInField, cameraToObject,
+                                      robotToCamera);
 }
 
 void Drivetrain::UpdateOdometry() {
@@ -98,8 +102,8 @@ void Drivetrain::UpdateOdometry() {
   wpi::math::Pose3d visionMeasurement3d = ObjectToRobotPose(
       m_objectInField, m_robotToCamera, m_cameraToObjectEntryRef);
 
-  // Convert robot's pose from wpi::math::Pose3d to wpi::math::Pose2d needed to apply vision
-  // measurements.
+  // Convert robot's pose from wpi::math::Pose3d to wpi::math::Pose2d needed to
+  // apply vision measurements.
   wpi::math::Pose2d visionMeasurement2d = visionMeasurement3d.ToPose2d();
 
   // Apply vision measurements. For simulation purposes only, we don't input a
diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp
index 5d1453f7db..efbb5b0519 100644
--- a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/Drivetrain.hpp
@@ -106,9 +106,9 @@ class Drivetrain {
    * @param cameraToObjectEntry The networktables entry publishing and querying
    * example computer vision measurements.
    */
-  wpi::math::Pose3d ObjectToRobotPose(wpi::math::Pose3d objectInField,
-                                wpi::math::Transform3d robotToCamera,
-                                wpi::nt::DoubleArrayEntry& cameraToObjectEntry);
+  wpi::math::Pose3d ObjectToRobotPose(
+      wpi::math::Pose3d objectInField, wpi::math::Transform3d robotToCamera,
+      wpi::nt::DoubleArrayEntry& cameraToObjectEntry);
 
  private:
   static constexpr wpi::units::meter_t kTrackwidth = 0.381_m * 2;
@@ -120,9 +120,11 @@ class Drivetrain {
 
   wpi::math::Transform3d m_robotToCamera{
       wpi::math::Translation3d{1_m, 1_m, 1_m},
-      wpi::math::Rotation3d{0_rad, 0_rad, wpi::units::radian_t{std::numbers::pi / 2}}};
+      wpi::math::Rotation3d{0_rad, 0_rad,
+                            wpi::units::radian_t{std::numbers::pi / 2}}};
 
-  wpi::nt::NetworkTableInstance m_inst{wpi::nt::NetworkTableInstance::GetDefault()};
+  wpi::nt::NetworkTableInstance m_inst{
+      wpi::nt::NetworkTableInstance::GetDefault()};
   wpi::nt::DoubleArrayTopic m_cameraToObjectTopic{
       m_inst.GetDoubleArrayTopic("m_cameraToObjectTopic")};
   wpi::nt::DoubleArrayEntry m_cameraToObjectEntry =
@@ -130,8 +132,10 @@ class Drivetrain {
   wpi::nt::DoubleArrayEntry& m_cameraToObjectEntryRef = m_cameraToObjectEntry;
 
   wpi::apriltag::AprilTagFieldLayout m_aprilTagFieldLayout{
-      wpi::apriltag::AprilTagFieldLayout::LoadField(wpi::apriltag::AprilTagField::k2024Crescendo)};
-  wpi::math::Pose3d m_objectInField{m_aprilTagFieldLayout.GetTagPose(0).value()};
+      wpi::apriltag::AprilTagFieldLayout::LoadField(
+          wpi::apriltag::AprilTagField::k2024Crescendo)};
+  wpi::math::Pose3d m_objectInField{
+      m_aprilTagFieldLayout.GetTagPose(0).value()};
 
   wpi::PWMSparkMax m_leftLeader{1};
   wpi::PWMSparkMax m_leftFollower{2};
@@ -161,7 +165,8 @@ class Drivetrain {
 
   // Gains are for example purposes only - must be determined for your own
   // robot!
-  wpi::math::SimpleMotorFeedforward m_feedforward{1_V, 3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_feedforward{
+      1_V, 3_V / 1_mps};
 
   // Simulation classes
   wpi::sim::EncoderSim m_leftEncoderSim{m_leftEncoder};
diff --git a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
index 16f4123f08..cb2f85b4c7 100644
--- a/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/DifferentialDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
@@ -16,9 +16,10 @@ class ExampleGlobalMeasurementSensor {
   static wpi::math::Pose2d GetEstimatedGlobalPose(
       const wpi::math::Pose2d& estimatedRobotPose) {
     auto randVec = wpi::math::MakeWhiteNoiseVector(0.1, 0.1, 0.1);
-    return wpi::math::Pose2d{estimatedRobotPose.X() + wpi::units::meter_t{randVec(0)},
-                       estimatedRobotPose.Y() + wpi::units::meter_t{randVec(1)},
-                       estimatedRobotPose.Rotation() +
-                           wpi::math::Rotation2d{wpi::units::radian_t{randVec(2)}}};
+    return wpi::math::Pose2d{
+        estimatedRobotPose.X() + wpi::units::meter_t{randVec(0)},
+        estimatedRobotPose.Y() + wpi::units::meter_t{randVec(1)},
+        estimatedRobotPose.Rotation() +
+            wpi::math::Rotation2d{wpi::units::radian_t{randVec(2)}}};
   }
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp
index 85875e2ec3..b5dae18f8e 100644
--- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp
@@ -38,7 +38,8 @@ void Robot::AutonomousInit() {
   m_autonomousCommand = m_container.GetAutonomousCommand();
 
   if (m_autonomousCommand) {
-    wpi::cmd::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
+    wpi::cmd::CommandScheduler::GetInstance().Schedule(
+        m_autonomousCommand.value());
   }
 }
 
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 cb0b2e31ca..3bc7dd3139 100644
--- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/include/subsystems/DriveSubsystem.hpp
@@ -35,10 +35,11 @@ class DriveSubsystem : public wpi::cmd::SubsystemBase {
    * @param nextLeft The next left wheel state.
    * @param nextRight The next right wheel state.
    */
-  void SetDriveStates(wpi::math::TrapezoidProfile::State currentLeft,
-                      wpi::math::TrapezoidProfile::State currentRight,
-                      wpi::math::TrapezoidProfile::State nextLeft,
-                      wpi::math::TrapezoidProfile::State nextRight);
+  void SetDriveStates(
+      wpi::math::TrapezoidProfile::State currentLeft,
+      wpi::math::TrapezoidProfile::State currentRight,
+      wpi::math::TrapezoidProfile::State nextLeft,
+      wpi::math::TrapezoidProfile::State nextRight);
 
   /**
    * Drives the robot using arcade controls.
@@ -91,7 +92,8 @@ class DriveSubsystem : public wpi::cmd::SubsystemBase {
    * @param distance The distance to drive forward.
    * @return A command.
    */
-  wpi::cmd::CommandPtr DynamicProfiledDriveDistance(wpi::units::meter_t distance);
+  wpi::cmd::CommandPtr DynamicProfiledDriveDistance(
+      wpi::units::meter_t distance);
 
  private:
   wpi::math::TrapezoidProfile m_profile{
diff --git a/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp
index a9ea1d0cc2..aa23c180cd 100644
--- a/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/DutyCycleEncoder/cpp/Robot.cpp
@@ -57,7 +57,7 @@ class Robot : public wpi::TimedRobot {
     // to be changed.
     double percentOfRange = fullRange * 0.1;
     double shiftedOutput = wpi::math::InputModulus(output, 0 - percentOfRange,
-                                             fullRange - percentOfRange);
+                                                   fullRange - percentOfRange);
 
     wpi::SmartDashboard::PutBoolean("Connected", connected);
     wpi::SmartDashboard::PutNumber("Frequency", frequency.value());
diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp
index 694ef86691..475e0e7b9d 100644
--- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialProfile/cpp/Robot.cpp
@@ -54,10 +54,12 @@ class Robot : public wpi::TimedRobot {
 
   // Create a motion profile with the given maximum velocity and maximum
   // acceleration constraints for the next setpoint.
-  wpi::math::ExponentialProfile m_profile{
-      {10_V, 1_V / 1_mps, 1_V / 1_mps_sq}};
-  wpi::math::ExponentialProfile::State m_goal;
-  wpi::math::ExponentialProfile::State m_setpoint;
+  wpi::math::ExponentialProfile
+      m_profile{{10_V, 1_V / 1_mps, 1_V / 1_mps_sq}};
+  wpi::math::ExponentialProfile::State
+      m_goal;
+  wpi::math::ExponentialProfile::State
+      m_setpoint;
 };
 
 #ifndef RUNNING_WPILIB_TESTS
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 a9d785fb9c..28fc2eca2d 100644
--- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/cpp/subsystems/Elevator.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/cpp/subsystems/Elevator.cpp
@@ -40,8 +40,8 @@ void Elevator::UpdateTelemetry() {
 }
 
 void Elevator::ReachGoal(wpi::units::meter_t goal) {
-  wpi::math::ExponentialProfile::State goalState{goal,
-                                                                        0_mps};
+  wpi::math::ExponentialProfile::State
+      goalState{goal, 0_mps};
 
   auto next = m_profile.Calculate(20_ms, m_setpoint, goalState);
 
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 db2869077e..1ac418a5a6 100644
--- a/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/subsystems/Elevator.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/ElevatorExponentialSimulation/include/subsystems/Elevator.hpp
@@ -35,11 +35,13 @@ class Elevator {
   wpi::math::DCMotor m_elevatorGearbox = wpi::math::DCMotor::NEO(2);
 
   // Standard classes for controlling our elevator
-  wpi::math::ExponentialProfile::Constraints
-      m_constraints{Constants::kElevatorMaxV, Constants::kElevatorkV,
-                    Constants::kElevatorkA};
-  wpi::math::ExponentialProfile m_profile{m_constraints};
-  wpi::math::ExponentialProfile::State m_setpoint;
+  wpi::math::ExponentialProfile::Constraints m_constraints{
+      Constants::kElevatorMaxV, Constants::kElevatorkV, Constants::kElevatorkA};
+  wpi::math::ExponentialProfile
+      m_profile{m_constraints};
+  wpi::math::ExponentialProfile::State
+      m_setpoint;
 
   wpi::math::PIDController m_controller{
       Constants::kElevatorKp, Constants::kElevatorKi, Constants::kElevatorKd};
diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp
index 45de8d4eed..0b061f7876 100644
--- a/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/ElevatorProfiledPID/cpp/Robot.cpp
@@ -34,8 +34,8 @@ class Robot : public wpi::TimedRobot {
 
     // Run controller and update motor output
     m_motor.SetVoltage(
-        wpi::units::volt_t{
-            m_controller.Calculate(wpi::units::meter_t{m_encoder.GetDistance()})} +
+        wpi::units::volt_t{m_controller.Calculate(
+            wpi::units::meter_t{m_encoder.GetDistance()})} +
         m_feedforward.Calculate(m_controller.GetSetpoint().velocity));
   }
 
@@ -58,8 +58,8 @@ class Robot : public wpi::TimedRobot {
   // velocity and acceleration constraints.
   wpi::math::TrapezoidProfile::Constraints m_constraints{
       kMaxVelocity, kMaxAcceleration};
-  wpi::math::ProfiledPIDController m_controller{kP, kI, kD,
-                                                         m_constraints, kDt};
+  wpi::math::ProfiledPIDController m_controller{
+      kP, kI, kD, m_constraints, kDt};
   wpi::math::ElevatorFeedforward m_feedforward{kS, kG, kV};
 };
 
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 64f1591c4b..0107320df0 100644
--- a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/subsystems/Elevator.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/include/subsystems/Elevator.hpp
@@ -34,8 +34,8 @@ class Elevator {
   wpi::math::DCMotor m_elevatorGearbox = wpi::math::DCMotor::Vex775Pro(4);
 
   // Standard classes for controlling our elevator
-  wpi::math::TrapezoidProfile::Constraints m_constraints{2.45_mps,
-                                                                  2.45_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints m_constraints{
+      2.45_mps, 2.45_mps_sq};
   wpi::math::ProfiledPIDController m_controller{
       Constants::kElevatorKp, Constants::kElevatorKi, Constants::kElevatorKd,
       m_constraints};
diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp
index eb5057c36f..d5586f6026 100644
--- a/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/ElevatorTrapezoidProfile/cpp/Robot.cpp
@@ -51,7 +51,8 @@ class Robot : public wpi::TimedRobot {
 
   // Create a motion profile with the given maximum velocity and maximum
   // acceleration constraints for the next setpoint.
-  wpi::math::TrapezoidProfile m_profile{{1.75_mps, 0.75_mps_sq}};
+  wpi::math::TrapezoidProfile m_profile{
+      {1.75_mps, 0.75_mps_sq}};
   wpi::math::TrapezoidProfile::State m_goal;
   wpi::math::TrapezoidProfile::State m_setpoint;
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp
index 97ca016408..9f6174e860 100644
--- a/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/EventLoop/cpp/Robot.cpp
@@ -55,7 +55,7 @@ class Robot : public wpi::TimedRobot {
                  &encoder = m_shooterEncoder] {
           shooter.SetVoltage(
               wpi::units::volt_t{controller.Calculate(encoder.GetRate(),
-                                                 SHOT_VELOCITY.value())} +
+                                                      SHOT_VELOCITY.value())} +
               ff.Calculate(wpi::units::radians_per_second_t{SHOT_VELOCITY}));
         });
     // if not, stop
@@ -84,7 +84,8 @@ class Robot : public wpi::TimedRobot {
   wpi::PWMSparkMax m_shooter{0};
   wpi::Encoder m_shooterEncoder{0, 1};
   wpi::math::PIDController m_controller{0.3, 0, 0};
-  wpi::math::SimpleMotorFeedforward m_ff{0.1_V, 0.065_V / 1_rpm};
+  wpi::math::SimpleMotorFeedforward m_ff{0.1_V,
+                                                              0.065_V / 1_rpm};
 
   wpi::PWMSparkMax m_kicker{1};
 
diff --git a/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp
index 888add7dfd..feaeea3510 100644
--- a/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/FlywheelBangBangController/cpp/Robot.cpp
@@ -15,8 +15,8 @@
 #include 
 
 /**
- * This is a sample program to demonstrate the use of a wpi::math::BangBangController with
- * a flywheel to control speed.
+ * This is a sample program to demonstrate the use of a
+ * wpi::math::BangBangController with a flywheel to control speed.
  */
 class Robot : public wpi::TimedRobot {
  public:
@@ -25,8 +25,8 @@ class Robot : public wpi::TimedRobot {
    */
   void TeleopPeriodic() override {
     // Scale setpoint value between 0 and maxSetpointValue
-    wpi::units::radians_per_second_t setpoint =
-        wpi::units::math::max(0_rpm, m_joystick.GetRawAxis(0) * kMaxSetpointValue);
+    wpi::units::radians_per_second_t setpoint = wpi::units::math::max(
+        0_rpm, m_joystick.GetRawAxis(0) * kMaxSetpointValue);
 
     // Set setpoint and measurement of the bang-bang controller
     wpi::units::volt_t bangOutput =
@@ -64,7 +64,8 @@ class Robot : public wpi::TimedRobot {
   static constexpr int kEncoderBChannel = 1;
 
   // Max setpoint for joystick control
-  static constexpr wpi::units::radians_per_second_t kMaxSetpointValue = 6000_rpm;
+  static constexpr wpi::units::radians_per_second_t kMaxSetpointValue =
+      6000_rpm;
 
   // Joystick to control setpoint
   wpi::Joystick m_joystick{0};
@@ -90,12 +91,13 @@ class Robot : public wpi::TimedRobot {
   static constexpr double kFlywheelGearing = 1.0;
 
   // 1/2 MR²
-  static constexpr wpi::units::kilogram_square_meter_t kFlywheelMomentOfInertia =
-      0.5 * 1.5_lb * 4_in * 4_in;
+  static constexpr wpi::units::kilogram_square_meter_t
+      kFlywheelMomentOfInertia = 0.5 * 1.5_lb * 4_in * 4_in;
 
   wpi::math::DCMotor m_gearbox = wpi::math::DCMotor::NEO(1);
-  wpi::math::LinearSystem<1, 1, 1> m_plant{wpi::math::LinearSystemId::FlywheelSystem(
-      m_gearbox, kFlywheelMomentOfInertia, kFlywheelGearing)};
+  wpi::math::LinearSystem<1, 1, 1> m_plant{
+      wpi::math::LinearSystemId::FlywheelSystem(
+          m_gearbox, kFlywheelMomentOfInertia, kFlywheelGearing)};
 
   wpi::sim::FlywheelSim m_flywheelSim{m_plant, m_gearbox};
   wpi::sim::EncoderSim m_encoderSim{m_encoder};
diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp
index bd1a8ec805..fda29e5c05 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/RobotContainer.cpp
@@ -42,7 +42,8 @@ void RobotContainer::ConfigureButtonBindings() {
   // While holding R1, drive at half speed
   m_driverController.R1()
       .OnTrue(wpi::cmd::cmd::RunOnce([this] { m_drive.SetMaxOutput(0.5); }, {}))
-      .OnFalse(wpi::cmd::cmd::RunOnce([this] { m_drive.SetMaxOutput(1.0); }, {}));
+      .OnFalse(
+          wpi::cmd::cmd::RunOnce([this] { m_drive.SetMaxOutput(1.0); }, {}));
 }
 
 wpi::cmd::Command* RobotContainer::GetAutonomousCommand() {
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 d6515a4156..7e1edfd332 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/commands/Autos.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/commands/Autos.cpp
@@ -31,7 +31,7 @@ wpi::cmd::CommandPtr autos::SimpleAuto(DriveSubsystem* drive) {
 }
 
 wpi::cmd::CommandPtr autos::ComplexAuto(DriveSubsystem* drive,
-                                    HatchSubsystem* hatch) {
+                                        HatchSubsystem* hatch) {
   return wpi::cmd::cmd::Sequence(
       // Drive forward the specified distance
       wpi::cmd::FunctionalCommand(
diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
index 7ce8aea9e2..73a06463e5 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/RobotContainer.cpp
@@ -48,7 +48,7 @@ void RobotContainer::ConfigureButtonBindings() {
       .OnTrue(ReleaseHatch(&m_hatch).ToPtr());
   // While holding the shoulder button, drive at half speed
   wpi::cmd::JoystickButton(&m_driverController,
-                       wpi::XboxController::Button::kRightBumper)
+                           wpi::XboxController::Button::kRightBumper)
       .WhileTrue(HalveDriveSpeed(&m_drive).ToPtr());
 }
 
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 715eebb9d0..b0f628805d 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ComplexAuto.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ComplexAuto.hpp
@@ -16,7 +16,8 @@
  * backward.
  */
 class ComplexAuto
-    : public wpi::cmd::CommandHelper {
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new ComplexAuto.
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 abf2dad6f5..d48df4bd51 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DefaultDrive.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DefaultDrive.hpp
@@ -18,7 +18,8 @@
  *
  * @see RunCommand
  */
-class DefaultDrive : public wpi::cmd::CommandHelper {
+class DefaultDrive
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new DefaultDrive.
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 c3eb068155..feda0f1f2e 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DriveDistance.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/DriveDistance.hpp
@@ -9,7 +9,8 @@
 
 #include "subsystems/DriveSubsystem.hpp"
 
-class DriveDistance : public wpi::cmd::CommandHelper {
+class DriveDistance
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new DriveDistance.
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 7a54ac5853..d741b6252a 100644
--- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ReleaseHatch.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/include/commands/ReleaseHatch.hpp
@@ -16,7 +16,8 @@
  *
  * @see InstantCommand
  */
-class ReleaseHatch : public wpi::cmd::CommandHelper {
+class ReleaseHatch
+    : public wpi::cmd::CommandHelper {
  public:
   explicit ReleaseHatch(HatchSubsystem* subsystem);
 
diff --git a/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp
index f4873c8e2f..42fa47bb7e 100644
--- a/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/HttpCamera/cpp/Robot.cpp
@@ -27,7 +27,8 @@ class Robot : public wpi::TimedRobot {
   static void VisionThread() {
     // Create an HTTP camera. The address will need to be modified to have the
     // correct team number. The exact path will depend on the source.
-    wpi::cs::HttpCamera camera{"My Camera", "http://10.x.y.11/video/stream.mjpg"};
+    wpi::cs::HttpCamera camera{"My Camera",
+                               "http://10.x.y.11/video/stream.mjpg"};
     // Start capturing images
     wpi::CameraServer::StartAutomaticCapture(camera);
     // Set the resolution
diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp
index 1edeb28c9f..01d432ffd6 100644
--- a/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/MecanumBot/cpp/Drivetrain.cpp
@@ -13,14 +13,16 @@ wpi::math::MecanumDriveWheelSpeeds Drivetrain::GetCurrentState() const {
           wpi::units::meters_per_second_t{m_backRightEncoder.GetRate()}};
 }
 
-wpi::math::MecanumDriveWheelPositions Drivetrain::GetCurrentWheelDistances() const {
+wpi::math::MecanumDriveWheelPositions Drivetrain::GetCurrentWheelDistances()
+    const {
   return {wpi::units::meter_t{m_frontLeftEncoder.GetDistance()},
           wpi::units::meter_t{m_frontRightEncoder.GetDistance()},
           wpi::units::meter_t{m_backLeftEncoder.GetDistance()},
           wpi::units::meter_t{m_backRightEncoder.GetDistance()}};
 }
 
-void Drivetrain::SetSpeeds(const wpi::math::MecanumDriveWheelSpeeds& wheelSpeeds) {
+void Drivetrain::SetSpeeds(
+    const wpi::math::MecanumDriveWheelSpeeds& wheelSpeeds) {
   const auto frontLeftFeedforward =
       m_feedforward.Calculate(wheelSpeeds.frontLeft);
   const auto frontRightFeedforward =
diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp
index 360ec9fb66..272624d11e 100644
--- a/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/MecanumBot/include/Drivetrain.hpp
@@ -34,8 +34,9 @@ class Drivetrain {
   wpi::math::MecanumDriveWheelPositions GetCurrentWheelDistances() const;
   void SetSpeeds(const wpi::math::MecanumDriveWheelSpeeds& wheelSpeeds);
   void Drive(wpi::units::meters_per_second_t xSpeed,
-             wpi::units::meters_per_second_t ySpeed, wpi::units::radians_per_second_t rot,
-             bool fieldRelative, wpi::units::second_t period);
+             wpi::units::meters_per_second_t ySpeed,
+             wpi::units::radians_per_second_t rot, bool fieldRelative,
+             wpi::units::second_t period);
   void UpdateOdometry();
 
   static constexpr wpi::units::meters_per_second_t kMaxSpeed =
@@ -70,10 +71,11 @@ class Drivetrain {
       m_frontLeftLocation, m_frontRightLocation, m_backLeftLocation,
       m_backRightLocation};
 
-  wpi::math::MecanumDriveOdometry m_odometry{m_kinematics, m_imu.GetRotation2d(),
-                                       GetCurrentWheelDistances()};
+  wpi::math::MecanumDriveOdometry m_odometry{
+      m_kinematics, m_imu.GetRotation2d(), GetCurrentWheelDistances()};
 
   // Gains are for example purposes only - must be determined for your own
   // robot!
-  wpi::math::SimpleMotorFeedforward m_feedforward{1_V, 3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_feedforward{
+      1_V, 3_V / 1_mps};
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp
index 6d99b22f1d..22022a3eca 100644
--- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/cpp/Drivetrain.cpp
@@ -22,7 +22,8 @@ wpi::math::MecanumDriveWheelPositions Drivetrain::GetCurrentDistances() const {
           wpi::units::meter_t{m_backRightEncoder.GetDistance()}};
 }
 
-void Drivetrain::SetSpeeds(const wpi::math::MecanumDriveWheelSpeeds& wheelSpeeds) {
+void Drivetrain::SetSpeeds(
+    const wpi::math::MecanumDriveWheelSpeeds& wheelSpeeds) {
   std::function
       calcAndSetSpeeds = [&m_feedforward = m_feedforward](
diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp
index da042ca8b7..2a4c022c7b 100644
--- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/Drivetrain.hpp
@@ -35,8 +35,9 @@ class Drivetrain {
   wpi::math::MecanumDriveWheelPositions GetCurrentDistances() const;
   void SetSpeeds(const wpi::math::MecanumDriveWheelSpeeds& wheelSpeeds);
   void Drive(wpi::units::meters_per_second_t xSpeed,
-             wpi::units::meters_per_second_t ySpeed, wpi::units::radians_per_second_t rot,
-             bool fieldRelative, wpi::units::second_t period);
+             wpi::units::meters_per_second_t ySpeed,
+             wpi::units::radians_per_second_t rot, bool fieldRelative,
+             wpi::units::second_t period);
   void UpdateOdometry();
 
   static constexpr auto kMaxSpeed = 3.0_mps;  // 3 meters per second
@@ -72,11 +73,12 @@ class Drivetrain {
 
   // Gains are for example purposes only - must be determined for your own
   // robot!
-  wpi::math::SimpleMotorFeedforward m_feedforward{1_V, 3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_feedforward{
+      1_V, 3_V / 1_mps};
 
   // Gains are for example purposes only - must be determined for your own
   // robot!
   wpi::math::MecanumDrivePoseEstimator m_poseEstimator{
-      m_kinematics,  m_imu.GetRotation2d(), GetCurrentDistances(),
+      m_kinematics,        m_imu.GetRotation2d(), GetCurrentDistances(),
       wpi::math::Pose2d{}, {0.1, 0.1, 0.1},       {0.1, 0.1, 0.1}};
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
index 16f4123f08..cb2f85b4c7 100644
--- a/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/MecanumDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
@@ -16,9 +16,10 @@ class ExampleGlobalMeasurementSensor {
   static wpi::math::Pose2d GetEstimatedGlobalPose(
       const wpi::math::Pose2d& estimatedRobotPose) {
     auto randVec = wpi::math::MakeWhiteNoiseVector(0.1, 0.1, 0.1);
-    return wpi::math::Pose2d{estimatedRobotPose.X() + wpi::units::meter_t{randVec(0)},
-                       estimatedRobotPose.Y() + wpi::units::meter_t{randVec(1)},
-                       estimatedRobotPose.Rotation() +
-                           wpi::math::Rotation2d{wpi::units::radian_t{randVec(2)}}};
+    return wpi::math::Pose2d{
+        estimatedRobotPose.X() + wpi::units::meter_t{randVec(0)},
+        estimatedRobotPose.Y() + wpi::units::meter_t{randVec(1)},
+        estimatedRobotPose.Rotation() +
+            wpi::math::Rotation2d{wpi::units::radian_t{randVec(2)}}};
   }
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp
index 9f26a88743..02810f7730 100644
--- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp
@@ -26,7 +26,8 @@ void Robot::AutonomousInit() {
   m_autonomousCommand = m_robot.GetAutonomousCommand();
 
   if (m_autonomousCommand) {
-    wpi::cmd::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
+    wpi::cmd::CommandScheduler::GetInstance().Schedule(
+        m_autonomousCommand.value());
   }
 }
 
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 663f5b6772..266d5a36d6 100644
--- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Drive.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Drive.cpp
@@ -35,7 +35,7 @@ Drive::Drive() {
 }
 
 wpi::cmd::CommandPtr Drive::ArcadeDriveCommand(std::function fwd,
-                                           std::function rot) {
+                                               std::function rot) {
   return Run([this, fwd = std::move(fwd), rot = std::move(rot)] {
            m_drive.ArcadeDrive(fwd(), rot());
          })
@@ -43,7 +43,7 @@ wpi::cmd::CommandPtr Drive::ArcadeDriveCommand(std::function fwd,
 }
 
 wpi::cmd::CommandPtr Drive::DriveDistanceCommand(wpi::units::meter_t distance,
-                                             double speed) {
+                                                 double speed) {
   return RunOnce([this] {
            // Reset encoders at the start of the command
            m_leftEncoder.Reset();
@@ -52,8 +52,9 @@ wpi::cmd::CommandPtr Drive::DriveDistanceCommand(wpi::units::meter_t distance,
       // Drive forward at specified speed
       .AndThen(Run([this, speed] { m_drive.ArcadeDrive(speed, 0.0); }))
       .Until([this, distance] {
-        return wpi::units::math::max(wpi::units::meter_t(m_leftEncoder.GetDistance()),
-                                wpi::units::meter_t(m_rightEncoder.GetDistance())) >=
+        return wpi::units::math::max(
+                   wpi::units::meter_t(m_leftEncoder.GetDistance()),
+                   wpi::units::meter_t(m_rightEncoder.GetDistance())) >=
                distance;
       })
       // Stop the drive when the command ends
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 60ba31b7f2..ea994702b2 100644
--- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Shooter.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/subsystems/Shooter.cpp
@@ -19,7 +19,8 @@ Shooter::Shooter() {
                         .WithName("Idle"));
 }
 
-wpi::cmd::CommandPtr Shooter::ShootCommand(wpi::units::turns_per_second_t setpoint) {
+wpi::cmd::CommandPtr Shooter::ShootCommand(
+    wpi::units::turns_per_second_t setpoint) {
   return wpi::cmd::cmd::Parallel(
              // Run the shooter flywheel at the desired setpoint using
              // feedforward and feedback
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 9e46055379..3d3b063118 100644
--- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/include/subsystems/Drive.hpp
@@ -29,7 +29,7 @@ class Drive : public wpi::cmd::SubsystemBase {
    * @param rot the commanded rotation
    */
   wpi::cmd::CommandPtr ArcadeDriveCommand(std::function fwd,
-                                      std::function rot);
+                                          std::function rot);
 
   /**
    * Returns a command that drives the robot forward a specified distance at a
@@ -38,7 +38,8 @@ class Drive : public wpi::cmd::SubsystemBase {
    * @param distance The distance to drive forward in meters
    * @param speed The fraction of max speed at which to drive
    */
-  wpi::cmd::CommandPtr DriveDistanceCommand(wpi::units::meter_t distance, double speed);
+  wpi::cmd::CommandPtr DriveDistanceCommand(wpi::units::meter_t distance,
+                                            double speed);
 
   /**
    * Returns a command that turns to robot to the specified angle using a motion
diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp
index 3109e5dad4..ba4905cea9 100644
--- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/RobotContainer.hpp
@@ -48,7 +48,7 @@ class RobotContainer {
   // The robot's subsystems
   Drivetrain m_drive;
   wpi::romi::OnBoardIO m_onboardIO{wpi::romi::OnBoardIO::ChannelMode::INPUT,
-                             wpi::romi::OnBoardIO::ChannelMode::INPUT};
+                                   wpi::romi::OnBoardIO::ChannelMode::INPUT};
 
   // Example button
   wpi::cmd::Trigger m_onboardButtonA{
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 bd29bdefe0..7cef535c02 100644
--- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousDistance.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousDistance.hpp
@@ -13,7 +13,7 @@
 
 class AutonomousDistance
     : public wpi::cmd::CommandHelper {
+                                     AutonomousDistance> {
  public:
   /**
    * Creates a new Autonomous Drive based on distance. This will drive out for a
diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousTime.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousTime.hpp
index e2dde7998a..86928203fd 100644
--- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousTime.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/AutonomousTime.hpp
@@ -12,7 +12,8 @@
 #include "subsystems/Drivetrain.hpp"
 
 class AutonomousTime
-    : public wpi::cmd::CommandHelper {
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new Autonomous Drive based on time. This will drive out for a
diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveDistance.hpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveDistance.hpp
index 49fc11fb98..c925f39d0a 100644
--- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveDistance.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/DriveDistance.hpp
@@ -10,7 +10,8 @@
 
 #include "subsystems/Drivetrain.hpp"
 
-class DriveDistance : public wpi::cmd::CommandHelper {
+class DriveDistance
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new DriveDistance. This command will drive your your robot for a
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 90df6e892a..9fd4f93e00 100644
--- a/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnDegrees.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/include/commands/TurnDegrees.hpp
@@ -11,7 +11,8 @@
 
 #include "subsystems/Drivetrain.hpp"
 
-class TurnDegrees : public wpi::cmd::CommandHelper {
+class TurnDegrees
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new TurnDegrees. This command will turn your robot for a desired
diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp
index 1d362c7ef8..767c8436ef 100644
--- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/include/RobotContainer.hpp
@@ -35,12 +35,14 @@ class RobotContainer {
   // value returned by the selector method at runtime.  Note that selectcommand
   // takes a generic type, so the selector does not have to be an enum; it could
   // be any desired type (string, integer, boolean, double...)
-  wpi::cmd::CommandPtr m_exampleSelectCommand = wpi::cmd::cmd::Select(
-      [this] { return m_chooser.GetSelected(); },
-      // Maps selector values to commands
-      std::pair{ONE, wpi::cmd::cmd::Print("Command one was selected!")},
-      std::pair{TWO, wpi::cmd::cmd::Print("Command two was selected!")},
-      std::pair{THREE, wpi::cmd::cmd::Print("Command three was selected!")});
+  wpi::cmd::CommandPtr m_exampleSelectCommand =
+      wpi::cmd::cmd::Select(
+          [this] { return m_chooser.GetSelected(); },
+          // Maps selector values to commands
+          std::pair{ONE, wpi::cmd::cmd::Print("Command one was selected!")},
+          std::pair{TWO, wpi::cmd::cmd::Print("Command two was selected!")},
+          std::pair{THREE,
+                    wpi::cmd::cmd::Print("Command three was selected!")});
 
   void ConfigureButtonBindings();
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp
index e24f4418d9..3de27582a0 100644
--- a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Drivetrain.cpp
@@ -6,7 +6,8 @@
 
 #include 
 
-void Drivetrain::SetSpeeds(const wpi::math::DifferentialDriveWheelSpeeds& speeds) {
+void Drivetrain::SetSpeeds(
+    const wpi::math::DifferentialDriveWheelSpeeds& speeds) {
   auto leftFeedforward = m_feedforward.Calculate(speeds.left);
   auto rightFeedforward = m_feedforward.Calculate(speeds.right);
   double leftOutput = m_leftPIDController.Calculate(m_leftEncoder.GetRate(),
@@ -31,9 +32,9 @@ void Drivetrain::UpdateOdometry() {
 
 void Drivetrain::ResetOdometry(const wpi::math::Pose2d& pose) {
   m_drivetrainSimulator.SetPose(pose);
-  m_odometry.ResetPosition(m_imu.GetRotation2d(),
-                           wpi::units::meter_t{m_leftEncoder.GetDistance()},
-                           wpi::units::meter_t{m_rightEncoder.GetDistance()}, pose);
+  m_odometry.ResetPosition(
+      m_imu.GetRotation2d(), wpi::units::meter_t{m_leftEncoder.GetDistance()},
+      wpi::units::meter_t{m_rightEncoder.GetDistance()}, pose);
 }
 
 void Drivetrain::SimulationPeriodic() {
diff --git a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp
index 04634a5caa..31f8e66dbb 100644
--- a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/cpp/Robot.cpp
@@ -15,7 +15,8 @@ class Robot : public wpi::TimedRobot {
  public:
   Robot() {
     m_trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-        wpi::math::Pose2d{2_m, 2_m, 0_rad}, {}, wpi::math::Pose2d{6_m, 4_m, 0_rad},
+        wpi::math::Pose2d{2_m, 2_m, 0_rad}, {},
+        wpi::math::Pose2d{6_m, 4_m, 0_rad},
         wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
   }
 
diff --git a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp
index 881aaab04f..af01c018fd 100644
--- a/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SimpleDifferentialDriveSimulation/include/Drivetrain.hpp
@@ -96,7 +96,8 @@ class Drivetrain {
 
   // Gains are for example purposes only - must be determined for your own
   // robot!
-  wpi::math::SimpleMotorFeedforward m_feedforward{1_V, 3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_feedforward{
+      1_V, 3_V / 1_mps};
 
   // Simulation classes help us simulate our robot
   wpi::sim::EncoderSim m_leftEncoderSim{m_leftEncoder};
diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp
index c6f468a2a5..468df2f365 100644
--- a/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp
@@ -32,7 +32,8 @@ class Robot : public wpi::TimedRobot {
   static constexpr wpi::units::radian_t kLoweredPosition = 0_deg;
 
   // Moment of inertia of the arm. Can be estimated with CAD. If finding this
-  // constant is difficult, wpi::math::LinearSystem.identifyPositionSystem may be better.
+  // constant is difficult, wpi::math::LinearSystem.identifyPositionSystem may
+  // be better.
   static constexpr wpi::units::kilogram_square_meter_t kArmMOI = 1.2_kg_sq_m;
 
   // Reduction between motors and encoder, as output over input. If the arm
@@ -46,8 +47,8 @@ class Robot : public wpi::TimedRobot {
   // Inputs (what we can "put in"): [voltage], in volts.
   // Outputs (what we can measure): [position], in radians.
   wpi::math::LinearSystem<2, 1, 1> m_armPlant =
-      wpi::math::LinearSystemId::SingleJointedArmSystem(wpi::math::DCMotor::NEO(2), kArmMOI,
-                                                  kArmGearing)
+      wpi::math::LinearSystemId::SingleJointedArmSystem(
+          wpi::math::DCMotor::NEO(2), kArmMOI, kArmGearing)
           .Slice(0);
 
   // The observer fuses our encoder data and voltage inputs to reject noise.
@@ -78,8 +79,8 @@ class Robot : public wpi::TimedRobot {
 
   // The state-space loop combines a controller, observer, feedforward and plant
   // for easy control.
-  wpi::math::LinearSystemLoop<2, 1, 1> m_loop{m_armPlant, m_controller, m_observer,
-                                        12_V, 20_ms};
+  wpi::math::LinearSystemLoop<2, 1, 1> m_loop{m_armPlant, m_controller,
+                                              m_observer, 12_V, 20_ms};
 
   // An encoder set up to measure arm position in radians per second.
   wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
@@ -90,7 +91,8 @@ class Robot : public wpi::TimedRobot {
   wpi::math::TrapezoidProfile m_profile{
       {45_deg_per_s, 90_deg_per_s / 1_s}};
 
-  wpi::math::TrapezoidProfile::State m_lastProfiledReference;
+  wpi::math::TrapezoidProfile::State
+      m_lastProfiledReference;
 
  public:
   Robot() {
@@ -99,7 +101,8 @@ class Robot : public wpi::TimedRobot {
   }
 
   void TeleopInit() override {
-    m_loop.Reset(wpi::math::Vectord<2>{m_encoder.GetDistance(), m_encoder.GetRate()});
+    m_loop.Reset(
+        wpi::math::Vectord<2>{m_encoder.GetDistance(), m_encoder.GetRate()});
 
     m_lastProfiledReference = {
         wpi::units::radian_t{m_encoder.GetDistance()},
@@ -120,8 +123,9 @@ class Robot : public wpi::TimedRobot {
     m_lastProfiledReference =
         m_profile.Calculate(20_ms, m_lastProfiledReference, goal);
 
-    m_loop.SetNextR(wpi::math::Vectord<2>{m_lastProfiledReference.position.value(),
-                                    m_lastProfiledReference.velocity.value()});
+    m_loop.SetNextR(
+        wpi::math::Vectord<2>{m_lastProfiledReference.position.value(),
+                              m_lastProfiledReference.velocity.value()});
 
     // Correct our Kalman filter's state vector estimate with encoder data.
     m_loop.Correct(wpi::math::Vectord<1>{m_encoder.GetDistance()});
diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp
index 57da50dc32..82f967afcb 100644
--- a/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp
@@ -44,8 +44,8 @@ class Robot : public wpi::TimedRobot {
   // Inputs (what we can "put in"): [voltage], in volts.
   // Outputs (what we can measure): [position], in meters.
   wpi::math::LinearSystem<2, 1, 1> m_elevatorPlant =
-      wpi::math::LinearSystemId::ElevatorSystem(wpi::math::DCMotor::NEO(2), kCarriageMass,
-                                          kDrumRadius, kGearRatio)
+      wpi::math::LinearSystemId::ElevatorSystem(
+          wpi::math::DCMotor::NEO(2), kCarriageMass, kDrumRadius, kGearRatio)
           .Slice(0);
 
   // The observer fuses our encoder data and voltage inputs to reject noise.
@@ -79,7 +79,7 @@ class Robot : public wpi::TimedRobot {
   // The state-space loop combines a controller, observer, feedforward and plant
   // for easy control.
   wpi::math::LinearSystemLoop<2, 1, 1> m_loop{m_elevatorPlant, m_controller,
-                                        m_observer, 12_V, 20_ms};
+                                              m_observer, 12_V, 20_ms};
 
   // An encoder set up to measure elevator height in meters.
   wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
@@ -89,7 +89,8 @@ class Robot : public wpi::TimedRobot {
 
   wpi::math::TrapezoidProfile m_profile{{3_fps, 6_fps_sq}};
 
-  wpi::math::TrapezoidProfile::State m_lastProfiledReference;
+  wpi::math::TrapezoidProfile::State
+      m_lastProfiledReference;
 
  public:
   Robot() {
@@ -100,10 +101,12 @@ class Robot : public wpi::TimedRobot {
 
   void TeleopInit() override {
     // Reset our loop to make sure it's in a known state.
-    m_loop.Reset(wpi::math::Vectord<2>{m_encoder.GetDistance(), m_encoder.GetRate()});
+    m_loop.Reset(
+        wpi::math::Vectord<2>{m_encoder.GetDistance(), m_encoder.GetRate()});
 
-    m_lastProfiledReference = {wpi::units::meter_t{m_encoder.GetDistance()},
-                               wpi::units::meters_per_second_t{m_encoder.GetRate()}};
+    m_lastProfiledReference = {
+        wpi::units::meter_t{m_encoder.GetDistance()},
+        wpi::units::meters_per_second_t{m_encoder.GetRate()}};
   }
 
   void TeleopPeriodic() override {
@@ -120,8 +123,9 @@ class Robot : public wpi::TimedRobot {
     m_lastProfiledReference =
         m_profile.Calculate(20_ms, m_lastProfiledReference, goal);
 
-    m_loop.SetNextR(wpi::math::Vectord<2>{m_lastProfiledReference.position.value(),
-                                    m_lastProfiledReference.velocity.value()});
+    m_loop.SetNextR(
+        wpi::math::Vectord<2>{m_lastProfiledReference.position.value(),
+                              m_lastProfiledReference.velocity.value()});
 
     // Correct our Kalman filter's state vector estimate with encoder data.
     m_loop.Correct(wpi::math::Vectord<1>{m_encoder.GetDistance()});
diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp
index f0a4ef9532..6488864667 100644
--- a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp
@@ -28,8 +28,8 @@ class Robot : public wpi::TimedRobot {
   static constexpr int kJoystickPort = 0;
   static constexpr wpi::units::radians_per_second_t kSpinup = 500_rpm;
 
-  static constexpr wpi::units::kilogram_square_meter_t kFlywheelMomentOfInertia =
-      0.00032_kg_sq_m;
+  static constexpr wpi::units::kilogram_square_meter_t
+      kFlywheelMomentOfInertia = 0.00032_kg_sq_m;
 
   // Reduction between motors and encoder, as output over input. If the flywheel
   // spins slower than the motors, this number should be greater than one.
@@ -42,8 +42,9 @@ class Robot : public wpi::TimedRobot {
   // Inputs (what we can "put in"): [voltage], in volts.
   // Outputs (what we can measure): [velocity], in radians per second.
   wpi::math::LinearSystem<1, 1, 1> m_flywheelPlant =
-      wpi::math::LinearSystemId::FlywheelSystem(
-          wpi::math::DCMotor::NEO(2), kFlywheelMomentOfInertia, kFlywheelGearing);
+      wpi::math::LinearSystemId::FlywheelSystem(wpi::math::DCMotor::NEO(2),
+                                                kFlywheelMomentOfInertia,
+                                                kFlywheelGearing);
 
   // The observer fuses our encoder data and voltage inputs to reject noise.
   wpi::math::KalmanFilter<1, 1, 1> m_observer{
@@ -71,7 +72,7 @@ class Robot : public wpi::TimedRobot {
   // The state-space loop combines a controller, observer, feedforward and plant
   // for easy control.
   wpi::math::LinearSystemLoop<1, 1, 1> m_loop{m_flywheelPlant, m_controller,
-                                        m_observer, 12_V, 20_ms};
+                                              m_observer, 12_V, 20_ms};
 
   // An encoder set up to measure flywheel velocity in radians per second.
   wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp
index 55c92e7c83..1b3169588d 100644
--- a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp
@@ -42,8 +42,8 @@ class Robot : public wpi::TimedRobot {
   //
   // The Kv and Ka constants are found using the FRC Characterization toolsuite.
   wpi::math::LinearSystem<1, 1, 1> m_flywheelPlant =
-      wpi::math::LinearSystemId::IdentifyVelocitySystem(kFlywheelKv,
-                                                                 kFlywheelKa);
+      wpi::math::LinearSystemId::IdentifyVelocitySystem(
+          kFlywheelKv, kFlywheelKa);
 
   // The observer fuses our encoder data and voltage inputs to reject noise.
   wpi::math::KalmanFilter<1, 1, 1> m_observer{
@@ -71,7 +71,7 @@ class Robot : public wpi::TimedRobot {
   // The state-space loop combines a controller, observer, feedforward and plant
   // for easy control.
   wpi::math::LinearSystemLoop<1, 1, 1> m_loop{m_flywheelPlant, m_controller,
-                                        m_observer, 12_V, 20_ms};
+                                              m_observer, 12_V, 20_ms};
 
   // An encoder set up to measure flywheel velocity in radians per second.
   wpi::Encoder m_encoder{kEncoderAChannel, kEncoderBChannel};
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp
index 9a340ae2b4..c0af9983ae 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/Robot.cpp
@@ -31,23 +31,23 @@ class Robot : public wpi::TimedRobot {
   void DriveWithJoystick(bool fieldRelative) {
     // Get the x speed. We are inverting this because Xbox controllers return
     // negative values when we push forward.
-    const auto xSpeed = -m_xspeedLimiter.Calculate(
-                            wpi::math::ApplyDeadband(m_controller.GetLeftY(), 0.02)) *
+    const auto xSpeed = -m_xspeedLimiter.Calculate(wpi::math::ApplyDeadband(
+                            m_controller.GetLeftY(), 0.02)) *
                         Drivetrain::kMaxSpeed;
 
     // Get the y speed or sideways/strafe speed. We are inverting this because
     // we want a positive value when we pull to the left. Xbox controllers
     // return positive values when you pull to the right by default.
-    const auto ySpeed = -m_yspeedLimiter.Calculate(
-                            wpi::math::ApplyDeadband(m_controller.GetLeftX(), 0.02)) *
+    const auto ySpeed = -m_yspeedLimiter.Calculate(wpi::math::ApplyDeadband(
+                            m_controller.GetLeftX(), 0.02)) *
                         Drivetrain::kMaxSpeed;
 
     // Get the rate of angular rotation. We are inverting this because we want a
     // positive value when we pull to the left (remember, CCW is positive in
     // mathematics). Xbox controllers return positive values when you pull to
     // the right by default.
-    const auto rot = -m_rotLimiter.Calculate(
-                         wpi::math::ApplyDeadband(m_controller.GetRightX(), 0.02)) *
+    const auto rot = -m_rotLimiter.Calculate(wpi::math::ApplyDeadband(
+                         m_controller.GetRightX(), 0.02)) *
                      Drivetrain::kMaxAngularSpeed;
 
     m_swerve.Drive(xSpeed, ySpeed, rot, fieldRelative, GetPeriod());
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp
index c80aeb13d2..5b9ec7753a 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/cpp/SwerveModule.cpp
@@ -33,7 +33,8 @@ SwerveModule::SwerveModule(const int driveMotorChannel,
   // Limit the PID Controller's input range between -pi and pi and set the input
   // to be continuous.
   m_turningPIDController.EnableContinuousInput(
-      -wpi::units::radian_t{std::numbers::pi}, wpi::units::radian_t{std::numbers::pi});
+      -wpi::units::radian_t{std::numbers::pi},
+      wpi::units::radian_t{std::numbers::pi});
 }
 
 wpi::math::SwerveModuleState SwerveModule::GetState() const {
@@ -46,7 +47,8 @@ wpi::math::SwerveModulePosition SwerveModule::GetPosition() const {
           wpi::units::radian_t{m_turningEncoder.GetDistance()}};
 }
 
-void SwerveModule::SetDesiredState(wpi::math::SwerveModuleState& referenceState) {
+void SwerveModule::SetDesiredState(
+    wpi::math::SwerveModuleState& referenceState) {
   wpi::math::Rotation2d encoderRotation{
       wpi::units::radian_t{m_turningEncoder.GetDistance()}};
 
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp
index 2fb4b49086..e68c64a668 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/Drivetrain.hpp
@@ -21,8 +21,9 @@ class Drivetrain {
   Drivetrain() { m_imu.ResetYaw(); }
 
   void Drive(wpi::units::meters_per_second_t xSpeed,
-             wpi::units::meters_per_second_t ySpeed, wpi::units::radians_per_second_t rot,
-             bool fieldRelative, wpi::units::second_t period);
+             wpi::units::meters_per_second_t ySpeed,
+             wpi::units::radians_per_second_t rot, bool fieldRelative,
+             wpi::units::second_t period);
   void UpdateOdometry();
 
   static constexpr wpi::units::meters_per_second_t kMaxSpeed =
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp
index 1533d278a8..ee86b16214 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveBot/include/SwerveModule.hpp
@@ -49,8 +49,8 @@ class SwerveModule {
       0.0,
       {kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration}};
 
-  wpi::math::SimpleMotorFeedforward m_driveFeedforward{1_V,
-                                                                3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_driveFeedforward{
+      1_V, 3_V / 1_mps};
   wpi::math::SimpleMotorFeedforward m_turnFeedforward{
       1_V, 0.5_V / 1_rad_per_s};
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp
index fbbd410046..e2d2808109 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/cpp/SwerveModule.cpp
@@ -33,7 +33,8 @@ SwerveModule::SwerveModule(const int driveMotorChannel,
   // Limit the PID Controller's input range between -pi and pi and set the input
   // to be continuous.
   m_turningPIDController.EnableContinuousInput(
-      -wpi::units::radian_t{std::numbers::pi}, wpi::units::radian_t{std::numbers::pi});
+      -wpi::units::radian_t{std::numbers::pi},
+      wpi::units::radian_t{std::numbers::pi});
 }
 
 wpi::math::SwerveModuleState SwerveModule::GetState() const {
@@ -46,7 +47,8 @@ wpi::math::SwerveModulePosition SwerveModule::GetPosition() const {
           wpi::units::radian_t{m_turningEncoder.GetDistance()}};
 }
 
-void SwerveModule::SetDesiredState(wpi::math::SwerveModuleState& referenceState) {
+void SwerveModule::SetDesiredState(
+    wpi::math::SwerveModuleState& referenceState) {
   wpi::math::Rotation2d encoderRotation{
       wpi::units::radian_t{m_turningEncoder.GetDistance()}};
 
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp
index 88d36615c6..3cc3100082 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/Drivetrain.hpp
@@ -22,8 +22,9 @@ class Drivetrain {
   Drivetrain() { m_imu.ResetYaw(); }
 
   void Drive(wpi::units::meters_per_second_t xSpeed,
-             wpi::units::meters_per_second_t ySpeed, wpi::units::radians_per_second_t rot,
-             bool fieldRelative, wpi::units::second_t period);
+             wpi::units::meters_per_second_t ySpeed,
+             wpi::units::radians_per_second_t rot, bool fieldRelative,
+             wpi::units::second_t period);
   void UpdateOdometry();
 
   static constexpr auto kMaxSpeed = 3.0_mps;  // 3 meters per second
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
index 16f4123f08..cb2f85b4c7 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/ExampleGlobalMeasurementSensor.hpp
@@ -16,9 +16,10 @@ class ExampleGlobalMeasurementSensor {
   static wpi::math::Pose2d GetEstimatedGlobalPose(
       const wpi::math::Pose2d& estimatedRobotPose) {
     auto randVec = wpi::math::MakeWhiteNoiseVector(0.1, 0.1, 0.1);
-    return wpi::math::Pose2d{estimatedRobotPose.X() + wpi::units::meter_t{randVec(0)},
-                       estimatedRobotPose.Y() + wpi::units::meter_t{randVec(1)},
-                       estimatedRobotPose.Rotation() +
-                           wpi::math::Rotation2d{wpi::units::radian_t{randVec(2)}}};
+    return wpi::math::Pose2d{
+        estimatedRobotPose.X() + wpi::units::meter_t{randVec(0)},
+        estimatedRobotPose.Y() + wpi::units::meter_t{randVec(1)},
+        estimatedRobotPose.Rotation() +
+            wpi::math::Rotation2d{wpi::units::radian_t{randVec(2)}}};
   }
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp
index f00bc07e7e..4c9581ced3 100644
--- a/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SwerveDrivePoseEstimator/include/SwerveModule.hpp
@@ -49,8 +49,8 @@ class SwerveModule {
       0.0,
       {kModuleMaxAngularVelocity, kModuleMaxAngularAcceleration}};
 
-  wpi::math::SimpleMotorFeedforward m_driveFeedforward{1_V,
-                                                                3_V / 1_mps};
+  wpi::math::SimpleMotorFeedforward m_driveFeedforward{
+      1_V, 3_V / 1_mps};
   wpi::math::SimpleMotorFeedforward m_turnFeedforward{
       1_V, 0.5_V / 1_rad_per_s};
 };
diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp
index f92c8e2cd5..db88a5b2ce 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp
@@ -22,7 +22,8 @@ void Robot::AutonomousInit() {
   m_autonomousCommand = m_container.GetAutonomousCommand();
 
   if (m_autonomousCommand) {
-    wpi::cmd::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
+    wpi::cmd::CommandScheduler::GetInstance().Schedule(
+        m_autonomousCommand.value());
   }
 }
 
diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp
index 4928c0e06b..4295dd5ae9 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/SysIdRoutineBot.cpp
@@ -18,9 +18,11 @@ void SysIdRoutineBot::ConfigureBindings() {
   // Using bumpers as a modifier and combining it with the buttons so that we
   // can have both sets of bindings at once
   (m_driverController.A() && m_driverController.RightBumper())
-      .WhileTrue(m_drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward));
+      .WhileTrue(
+          m_drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward));
   (m_driverController.B() && m_driverController.RightBumper())
-      .WhileTrue(m_drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse));
+      .WhileTrue(
+          m_drive.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse));
   (m_driverController.X() && m_driverController.RightBumper())
       .WhileTrue(m_drive.SysIdDynamic(wpi::cmd::sysid::Direction::kForward));
   (m_driverController.Y() && m_driverController.RightBumper())
@@ -30,9 +32,11 @@ void SysIdRoutineBot::ConfigureBindings() {
       [this] { return m_driverController.GetLeftTriggerAxis(); }));
 
   (m_driverController.A() && m_driverController.LeftBumper())
-      .WhileTrue(m_shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward));
+      .WhileTrue(
+          m_shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kForward));
   (m_driverController.B() && m_driverController.LeftBumper())
-      .WhileTrue(m_shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse));
+      .WhileTrue(
+          m_shooter.SysIdQuasistatic(wpi::cmd::sysid::Direction::kReverse));
   (m_driverController.X() && m_driverController.LeftBumper())
       .WhileTrue(m_shooter.SysIdDynamic(wpi::cmd::sysid::Direction::kForward));
   (m_driverController.Y() && m_driverController.LeftBumper())
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 2cec8fe5d3..f371a4abf7 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Drive.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Drive.cpp
@@ -22,13 +22,14 @@ Drive::Drive() {
 }
 
 wpi::cmd::CommandPtr Drive::ArcadeDriveCommand(std::function fwd,
-                                           std::function rot) {
-  return wpi::cmd::cmd::Run([this, fwd, rot] { m_drive.ArcadeDrive(fwd(), rot()); },
-                        {this})
+                                               std::function rot) {
+  return wpi::cmd::cmd::Run(
+             [this, fwd, rot] { m_drive.ArcadeDrive(fwd(), rot()); }, {this})
       .WithName("Arcade Drive");
 }
 
-wpi::cmd::CommandPtr Drive::SysIdQuasistatic(wpi::cmd::sysid::Direction direction) {
+wpi::cmd::CommandPtr Drive::SysIdQuasistatic(
+    wpi::cmd::sysid::Direction direction) {
   return m_sysIdRoutine.Quasistatic(direction);
 }
 
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 d54b2ada92..26fd1df09a 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Shooter.cpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/subsystems/Shooter.cpp
@@ -28,10 +28,12 @@ wpi::cmd::CommandPtr Shooter::RunShooterCommand(
       .WithName("Set Shooter Speed");
 }
 
-wpi::cmd::CommandPtr Shooter::SysIdQuasistatic(wpi::cmd::sysid::Direction direction) {
+wpi::cmd::CommandPtr Shooter::SysIdQuasistatic(
+    wpi::cmd::sysid::Direction direction) {
   return m_sysIdRoutine.Quasistatic(direction);
 }
 
-wpi::cmd::CommandPtr Shooter::SysIdDynamic(wpi::cmd::sysid::Direction direction) {
+wpi::cmd::CommandPtr Shooter::SysIdDynamic(
+    wpi::cmd::sysid::Direction direction) {
   return m_sysIdRoutine.Dynamic(direction);
 }
diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp
index 77cb1ccbae..dec709868d 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/Constants.hpp
@@ -34,14 +34,14 @@ inline constexpr wpi::units::meter_t kEncoderDistancePerPulse =
 
 namespace shooter {
 
-using kv_unit =
-    wpi::units::compound_unit,
-                         wpi::units::inverse>;
+using kv_unit = wpi::units::compound_unit<
+    wpi::units::compound_unit,
+    wpi::units::inverse>;
 using kv_unit_t = wpi::units::unit_t;
 
-using ka_unit =
-    wpi::units::compound_unit>;
+using ka_unit = wpi::units::compound_unit<
+    wpi::units::volts,
+    wpi::units::inverse>;
 using ka_unit_t = wpi::units::unit_t;
 
 inline constexpr std::array kEncoderPorts = {4, 5};
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 a3130d2513..f4b7cbbf33 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Drive.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Drive.hpp
@@ -20,7 +20,7 @@ class Drive : public wpi::cmd::SubsystemBase {
   Drive();
 
   wpi::cmd::CommandPtr ArcadeDriveCommand(std::function fwd,
-                                      std::function rot);
+                                          std::function rot);
   wpi::cmd::CommandPtr SysIdQuasistatic(wpi::cmd::sysid::Direction direction);
   wpi::cmd::CommandPtr SysIdDynamic(wpi::cmd::sysid::Direction direction);
 
@@ -39,7 +39,8 @@ class Drive : public wpi::cmd::SubsystemBase {
                               constants::drive::kRightEncoderReversed};
 
   wpi::cmd::sysid::SysIdRoutine m_sysIdRoutine{
-      wpi::cmd::sysid::Config{std::nullopt, std::nullopt, std::nullopt, nullptr},
+      wpi::cmd::sysid::Config{std::nullopt, std::nullopt, std::nullopt,
+                              nullptr},
       wpi::cmd::sysid::Mechanism{
           [this](wpi::units::volt_t driveVoltage) {
             m_leftMotor.SetVoltage(driveVoltage);
@@ -50,12 +51,14 @@ class Drive : public wpi::cmd::SubsystemBase {
                 .voltage(m_leftMotor.Get() *
                          wpi::RobotController::GetBatteryVoltage())
                 .position(wpi::units::meter_t{m_leftEncoder.GetDistance()})
-                .velocity(wpi::units::meters_per_second_t{m_leftEncoder.GetRate()});
+                .velocity(
+                    wpi::units::meters_per_second_t{m_leftEncoder.GetRate()});
             log->Motor("drive-right")
                 .voltage(m_rightMotor.Get() *
                          wpi::RobotController::GetBatteryVoltage())
                 .position(wpi::units::meter_t{m_rightEncoder.GetDistance()})
-                .velocity(wpi::units::meters_per_second_t{m_rightEncoder.GetRate()});
+                .velocity(
+                    wpi::units::meters_per_second_t{m_rightEncoder.GetRate()});
           },
           this}};
 };
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 c762d7a9c5..1c2cc7d1be 100644
--- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Shooter.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/include/subsystems/Shooter.hpp
@@ -33,7 +33,8 @@ class Shooter : public wpi::cmd::SubsystemBase {
                                 constants::shooter::kEncoderReversed};
 
   wpi::cmd::sysid::SysIdRoutine m_sysIdRoutine{
-      wpi::cmd::sysid::Config{std::nullopt, std::nullopt, std::nullopt, nullptr},
+      wpi::cmd::sysid::Config{std::nullopt, std::nullopt, std::nullopt,
+                              nullptr},
       wpi::cmd::sysid::Mechanism{
           [this](wpi::units::volt_t driveVoltage) {
             m_shooterMotor.SetVoltage(driveVoltage);
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 bd29bdefe0..7cef535c02 100644
--- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousDistance.hpp
@@ -13,7 +13,7 @@
 
 class AutonomousDistance
     : public wpi::cmd::CommandHelper {
+                                     AutonomousDistance> {
  public:
   /**
    * Creates a new Autonomous Drive based on distance. This will drive out for a
diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.hpp
index e2dde7998a..86928203fd 100644
--- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/AutonomousTime.hpp
@@ -12,7 +12,8 @@
 #include "subsystems/Drivetrain.hpp"
 
 class AutonomousTime
-    : public wpi::cmd::CommandHelper {
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new Autonomous Drive based on time. This will drive out for a
diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.hpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.hpp
index 49fc11fb98..c925f39d0a 100644
--- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/DriveDistance.hpp
@@ -10,7 +10,8 @@
 
 #include "subsystems/Drivetrain.hpp"
 
-class DriveDistance : public wpi::cmd::CommandHelper {
+class DriveDistance
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new DriveDistance. This command will drive your your robot for a
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 119b116d65..c3745ca915 100644
--- a/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.hpp
+++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/include/commands/TurnDegrees.hpp
@@ -11,7 +11,8 @@
 
 #include "subsystems/Drivetrain.hpp"
 
-class TurnDegrees : public wpi::cmd::CommandHelper {
+class TurnDegrees
+    : public wpi::cmd::CommandHelper {
  public:
   /**
    * Creates a new TurnDegrees. This command will turn your robot for a desired
diff --git a/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp
index d03768a4e7..f4bc3e688f 100644
--- a/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/snippets/AccelerometerFilter/cpp/Robot.cpp
@@ -15,7 +15,8 @@
 class Robot : public wpi::TimedRobot {
  public:
   void RobotPeriodic() override {
-    wpi::units::meters_per_second_squared_t XAccel = m_accelerometer.GetAccelX();
+    wpi::units::meters_per_second_squared_t XAccel =
+        m_accelerometer.GetAccelX();
     // Get the filtered X acceleration
     wpi::units::meters_per_second_squared_t filteredXAccel =
         m_xAccelFilter.Calculate(XAccel);
@@ -27,8 +28,9 @@ class Robot : public wpi::TimedRobot {
 
  private:
   wpi::OnboardIMU m_accelerometer{wpi::OnboardIMU::MountOrientation::kFlat};
-  wpi::math::LinearFilter m_xAccelFilter =
-      wpi::math::LinearFilter::MovingAverage(10);
+  wpi::math::LinearFilter
+      m_xAccelFilter = wpi::math::LinearFilter<
+          wpi::units::meters_per_second_squared_t>::MovingAverage(10);
 };
 
 #ifndef RUNNING_WPILIB_TESTS
diff --git a/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp
index 113de7087e..c125323fa2 100644
--- a/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp
@@ -20,8 +20,8 @@ class Robot : public wpi::TimedRobot {
  public:
   Robot() { m_encoder.SetDistancePerPulse(1.0 / 256.0); }
 
-  // Controls a simple motor's position using a wpi::math::SimpleMotorFeedforward
-  // and a wpi::math::ProfiledPIDController
+  // Controls a simple motor's position using a
+  // wpi::math::SimpleMotorFeedforward and a wpi::math::ProfiledPIDController
   void GoToPosition(wpi::units::meter_t goalPosition) {
     auto pidVal = m_controller.Calculate(
         wpi::units::meter_t{m_encoder.GetDistance()}, goalPosition);
@@ -39,8 +39,8 @@ class Robot : public wpi::TimedRobot {
  private:
   wpi::math::ProfiledPIDController m_controller{
       1.0, 0.0, 0.0, {5_mps, 10_mps_sq}};
-  wpi::math::SimpleMotorFeedforward m_feedforward{0.5_V, 1.5_V / 1_mps,
-                                                           0.3_V / 1_mps_sq};
+  wpi::math::SimpleMotorFeedforward m_feedforward{
+      0.5_V, 1.5_V / 1_mps, 0.3_V / 1_mps_sq};
   wpi::Encoder m_encoder{0, 1};
   wpi::PWMSparkMax m_motor{0};
 
diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp
index f08a46dfdb..67fd6b66c4 100644
--- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp
@@ -37,7 +37,8 @@ void Robot::AutonomousInit() {
   m_autonomousCommand = m_container.GetAutonomousCommand();
 
   if (m_autonomousCommand) {
-    wpi::cmd::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
+    wpi::cmd::CommandScheduler::GetInstance().Schedule(
+        m_autonomousCommand.value());
   }
 }
 
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 6e9872a26b..9c798e704d 100644
--- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/commands/Autos.cpp
+++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/commands/Autos.cpp
@@ -10,5 +10,5 @@
 
 wpi::cmd::CommandPtr autos::ExampleAuto(ExampleSubsystem* subsystem) {
   return wpi::cmd::cmd::Sequence(subsystem->ExampleMethodCommand(),
-                             ExampleCommand(subsystem).ToPtr());
+                                 ExampleCommand(subsystem).ToPtr());
 }
diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp
index f92c8e2cd5..db88a5b2ce 100644
--- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp
+++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp
@@ -22,7 +22,8 @@ void Robot::AutonomousInit() {
   m_autonomousCommand = m_container.GetAutonomousCommand();
 
   if (m_autonomousCommand) {
-    wpi::cmd::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value());
+    wpi::cmd::CommandScheduler::GetInstance().Schedule(
+        m_autonomousCommand.value());
   }
 }
 
diff --git a/wpimath/src/main/native/cpp/controller/ArmFeedforward.cpp b/wpimath/src/main/native/cpp/controller/ArmFeedforward.cpp
index 89f9629cfc..8525923727 100644
--- a/wpimath/src/main/native/cpp/controller/ArmFeedforward.cpp
+++ b/wpimath/src/main/native/cpp/controller/ArmFeedforward.cpp
@@ -16,7 +16,8 @@
 using namespace wpi::math;
 
 wpi::units::volt_t ArmFeedforward::Calculate(
-    wpi::units::unit_t currentAngle, wpi::units::unit_t currentVelocity,
+    wpi::units::unit_t currentAngle,
+    wpi::units::unit_t currentVelocity,
     wpi::units::unit_t nextVelocity) const {
   using VarMat = slp::VariableMatrix;
 
@@ -43,8 +44,9 @@ wpi::units::volt_t ArmFeedforward::Calculate(
 
   // Initial guess
   auto acceleration = (nextVelocity - currentVelocity) / m_dt;
-  u_k.set_value((kS * wpi::util::sgn(currentVelocity.value()) + kV * currentVelocity +
-                 kA * acceleration + kG * wpi::units::math::cos(currentAngle))
+  u_k.set_value((kS * wpi::util::sgn(currentVelocity.value()) +
+                 kV * currentVelocity + kA * acceleration +
+                 kG * wpi::units::math::cos(currentAngle))
                     .value());
 
   auto r_k1 = RK4(f, r_k, u_k, m_dt);
diff --git a/wpimath/src/main/native/cpp/controller/DifferentialDriveAccelerationLimiter.cpp b/wpimath/src/main/native/cpp/controller/DifferentialDriveAccelerationLimiter.cpp
index c415f433a0..9275868221 100644
--- a/wpimath/src/main/native/cpp/controller/DifferentialDriveAccelerationLimiter.cpp
+++ b/wpimath/src/main/native/cpp/controller/DifferentialDriveAccelerationLimiter.cpp
@@ -10,8 +10,8 @@ using namespace wpi::math;
 
 DifferentialDriveWheelVoltages DifferentialDriveAccelerationLimiter::Calculate(
     wpi::units::meters_per_second_t leftVelocity,
-    wpi::units::meters_per_second_t rightVelocity, wpi::units::volt_t leftVoltage,
-    wpi::units::volt_t rightVoltage) {
+    wpi::units::meters_per_second_t rightVelocity,
+    wpi::units::volt_t leftVoltage, wpi::units::volt_t rightVoltage) {
   Vectord<2> u{leftVoltage.value(), rightVoltage.value()};
 
   // Find unconstrained wheel accelerations
diff --git a/wpimath/src/main/native/cpp/controller/DifferentialDriveFeedforward.cpp b/wpimath/src/main/native/cpp/controller/DifferentialDriveFeedforward.cpp
index 2c0a002fb9..6225530edd 100644
--- a/wpimath/src/main/native/cpp/controller/DifferentialDriveFeedforward.cpp
+++ b/wpimath/src/main/native/cpp/controller/DifferentialDriveFeedforward.cpp
@@ -14,7 +14,8 @@ DifferentialDriveWheelVoltages DifferentialDriveFeedforward::Calculate(
     wpi::units::meters_per_second_t currentLeftVelocity,
     wpi::units::meters_per_second_t nextLeftVelocity,
     wpi::units::meters_per_second_t currentRightVelocity,
-    wpi::units::meters_per_second_t nextRightVelocity, wpi::units::second_t dt) {
+    wpi::units::meters_per_second_t nextRightVelocity,
+    wpi::units::second_t dt) {
   wpi::math::LinearPlantInversionFeedforward<2, 2> feedforward{m_plant, dt};
 
   Eigen::Vector2d r{currentLeftVelocity, currentRightVelocity};
diff --git a/wpimath/src/main/native/cpp/controller/LTVDifferentialDriveController.cpp b/wpimath/src/main/native/cpp/controller/LTVDifferentialDriveController.cpp
index dc65925731..1cae86bbdf 100644
--- a/wpimath/src/main/native/cpp/controller/LTVDifferentialDriveController.cpp
+++ b/wpimath/src/main/native/cpp/controller/LTVDifferentialDriveController.cpp
@@ -26,7 +26,8 @@ DifferentialDriveWheelVoltages LTVDifferentialDriveController::Calculate(
   //     [vₗ]
   //     [vᵣ]
 
-  wpi::units::meters_per_second_t velocity{(leftVelocity + rightVelocity) / 2.0};
+  wpi::units::meters_per_second_t velocity{(leftVelocity + rightVelocity) /
+                                           2.0};
 
   // The DARE is ill-conditioned if the velocity is close to zero, so don't
   // let the system stop.
@@ -42,7 +43,8 @@ DifferentialDriveWheelVoltages LTVDifferentialDriveController::Calculate(
                              leftVelocity.value(), rightVelocity.value()};
 
   m_error = r - x;
-  m_error(2) = wpi::math::AngleModulus(wpi::units::radian_t{m_error(2)}).value();
+  m_error(2) =
+      wpi::math::AngleModulus(wpi::units::radian_t{m_error(2)}).value();
 
   Eigen::Matrix A{
       {0.0, 0.0, 0.0, 0.5, 0.5},
diff --git a/wpimath/src/main/native/cpp/controller/LTVUnicycleController.cpp b/wpimath/src/main/native/cpp/controller/LTVUnicycleController.cpp
index fb84617472..1820c9c23a 100644
--- a/wpimath/src/main/native/cpp/controller/LTVUnicycleController.cpp
+++ b/wpimath/src/main/native/cpp/controller/LTVUnicycleController.cpp
@@ -78,7 +78,7 @@ ChassisSpeeds LTVUnicycleController::Calculate(
                     m_poseError.Rotation().Radians().value()};
   Eigen::Vector2d u = K * e;
 
-  return ChassisSpeeds{linearVelocityRef + wpi::units::meters_per_second_t{u(0)},
-                       0_mps,
-                       angularVelocityRef + wpi::units::radians_per_second_t{u(1)}};
+  return ChassisSpeeds{
+      linearVelocityRef + wpi::units::meters_per_second_t{u(0)}, 0_mps,
+      angularVelocityRef + wpi::units::radians_per_second_t{u(1)}};
 }
diff --git a/wpimath/src/main/native/cpp/controller/proto/ArmFeedforwardProto.cpp b/wpimath/src/main/native/cpp/controller/proto/ArmFeedforwardProto.cpp
index 6cb9d1a45d..7f66c6f799 100644
--- a/wpimath/src/main/native/cpp/controller/proto/ArmFeedforwardProto.cpp
+++ b/wpimath/src/main/native/cpp/controller/proto/ArmFeedforwardProto.cpp
@@ -8,8 +8,8 @@
 
 #include "wpimath/protobuf/controller.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufArmFeedforward msg;
   if (!stream.Decode(msg)) {
     return {};
diff --git a/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveFeedforwardProto.cpp b/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveFeedforwardProto.cpp
index 83c014b785..742a27d1d1 100644
--- a/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveFeedforwardProto.cpp
+++ b/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveFeedforwardProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/controller.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::DifferentialDriveFeedforward>::Unpack(InputStream& stream) {
   wpi_proto_ProtobufDifferentialDriveFeedforward msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -22,7 +22,8 @@ wpi::util::Protobuf::Unpack(InputStream
 }
 
 bool wpi::util::Protobuf::Pack(
-    OutputStream& stream, const wpi::math::DifferentialDriveFeedforward& value) {
+    OutputStream& stream,
+    const wpi::math::DifferentialDriveFeedforward& value) {
   wpi_proto_ProtobufDifferentialDriveFeedforward msg{
       .kv_linear = value.m_kVLinear.value(),
       .ka_linear = value.m_kALinear.value(),
diff --git a/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProto.cpp b/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProto.cpp
index 0ac2bcd1e0..7429e64660 100644
--- a/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProto.cpp
+++ b/wpimath/src/main/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProto.cpp
@@ -22,7 +22,8 @@ std::optional wpi::util::Protobuf<
 }
 
 bool wpi::util::Protobuf::Pack(
-    OutputStream& stream, const wpi::math::DifferentialDriveWheelVoltages& value) {
+    OutputStream& stream,
+    const wpi::math::DifferentialDriveWheelVoltages& value) {
   wpi_proto_ProtobufDifferentialDriveWheelVoltages msg{
       .left = value.left.value(),
       .right = value.right.value(),
diff --git a/wpimath/src/main/native/cpp/controller/proto/ElevatorFeedforwardProto.cpp b/wpimath/src/main/native/cpp/controller/proto/ElevatorFeedforwardProto.cpp
index 74a1919cbe..dd0c766505 100644
--- a/wpimath/src/main/native/cpp/controller/proto/ElevatorFeedforwardProto.cpp
+++ b/wpimath/src/main/native/cpp/controller/proto/ElevatorFeedforwardProto.cpp
@@ -8,8 +8,8 @@
 
 #include "wpimath/protobuf/controller.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::ElevatorFeedforward>::Unpack(InputStream& stream) {
   wpi_proto_ProtobufElevatorFeedforward msg;
   if (!stream.Decode(msg)) {
     return {};
diff --git a/wpimath/src/main/native/cpp/controller/struct/DifferentialDriveFeedforwardStruct.cpp b/wpimath/src/main/native/cpp/controller/struct/DifferentialDriveFeedforwardStruct.cpp
index db25e96ba9..de924ac96a 100644
--- a/wpimath/src/main/native/cpp/controller/struct/DifferentialDriveFeedforwardStruct.cpp
+++ b/wpimath/src/main/native/cpp/controller/struct/DifferentialDriveFeedforwardStruct.cpp
@@ -11,17 +11,22 @@ constexpr size_t kKvAngularOff = kKaLinearOff + 8;
 constexpr size_t kKaAngularOff = kKvAngularOff + 8;
 }  // namespace
 
-wpi::math::DifferentialDriveFeedforward wpi::util::Struct<
-    wpi::math::DifferentialDriveFeedforward>::Unpack(std::span data) {
-  return {
-      decltype(1_V / 1_mps){wpi::util::UnpackStruct(data)},
-      decltype(1_V / 1_mps_sq){wpi::util::UnpackStruct(data)},
-      decltype(1_V / 1_mps){wpi::util::UnpackStruct(data)},
-      decltype(1_V / 1_mps_sq){wpi::util::UnpackStruct(data)}};
+wpi::math::DifferentialDriveFeedforward
+wpi::util::Struct::Unpack(
+    std::span data) {
+  return {decltype(1_V /
+                   1_mps){wpi::util::UnpackStruct(data)},
+          decltype(1_V / 1_mps_sq){
+              wpi::util::UnpackStruct(data)},
+          decltype(1_V /
+                   1_mps){wpi::util::UnpackStruct(data)},
+          decltype(1_V / 1_mps_sq){
+              wpi::util::UnpackStruct(data)}};
 }
 
 void wpi::util::Struct::Pack(
-    std::span data, const wpi::math::DifferentialDriveFeedforward& value) {
+    std::span data,
+    const wpi::math::DifferentialDriveFeedforward& value) {
   wpi::util::PackStruct(data, value.m_kVLinear.value());
   wpi::util::PackStruct(data, value.m_kALinear.value());
   wpi::util::PackStruct(data, value.m_kVAngular.value());
diff --git a/wpimath/src/main/native/cpp/controller/struct/ElevatorFeedforwardStruct.cpp b/wpimath/src/main/native/cpp/controller/struct/ElevatorFeedforwardStruct.cpp
index 5d39451843..ebb5f61aeb 100644
--- a/wpimath/src/main/native/cpp/controller/struct/ElevatorFeedforwardStruct.cpp
+++ b/wpimath/src/main/native/cpp/controller/struct/ElevatorFeedforwardStruct.cpp
@@ -13,7 +13,8 @@ constexpr size_t kKaOff = kKvOff + 8;
 
 using StructType = wpi::util::Struct;
 
-wpi::math::ElevatorFeedforward StructType::Unpack(std::span data) {
+wpi::math::ElevatorFeedforward StructType::Unpack(
+    std::span data) {
   return wpi::math::ElevatorFeedforward{
       wpi::units::volt_t{wpi::util::UnpackStruct(data)},
       wpi::units::volt_t{wpi::util::UnpackStruct(data)},
diff --git a/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp b/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp
index 3cd00ac852..fc35f501c3 100644
--- a/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp
+++ b/wpimath/src/main/native/cpp/geometry/Ellipse2d.cpp
@@ -42,7 +42,7 @@ Translation2d Ellipse2d::Nearest(const Translation2d& point) const {
     problem.solve();
 
     rotPoint = wpi::math::Translation2d{wpi::units::meter_t{x.value()},
-                                  wpi::units::meter_t{y.value()}};
+                                        wpi::units::meter_t{y.value()}};
   }
 
   // Undo rotation
diff --git a/wpimath/src/main/native/cpp/geometry/Pose2d.cpp b/wpimath/src/main/native/cpp/geometry/Pose2d.cpp
index b3e2449639..7b05dfc51a 100644
--- a/wpimath/src/main/native/cpp/geometry/Pose2d.cpp
+++ b/wpimath/src/main/native/cpp/geometry/Pose2d.cpp
@@ -8,7 +8,7 @@
 
 void wpi::math::to_json(wpi::util::json& json, const Pose2d& pose) {
   json = wpi::util::json{{"translation", pose.Translation()},
-                   {"rotation", pose.Rotation()}};
+                         {"rotation", pose.Rotation()}};
 }
 
 void wpi::math::from_json(const wpi::util::json& json, Pose2d& pose) {
diff --git a/wpimath/src/main/native/cpp/geometry/Pose3d.cpp b/wpimath/src/main/native/cpp/geometry/Pose3d.cpp
index 6b41b0730c..bac9f9f21c 100644
--- a/wpimath/src/main/native/cpp/geometry/Pose3d.cpp
+++ b/wpimath/src/main/native/cpp/geometry/Pose3d.cpp
@@ -8,7 +8,7 @@
 
 void wpi::math::to_json(wpi::util::json& json, const Pose3d& pose) {
   json = wpi::util::json{{"translation", pose.Translation()},
-                   {"rotation", pose.Rotation()}};
+                         {"rotation", pose.Rotation()}};
 }
 
 void wpi::math::from_json(const wpi::util::json& json, Pose3d& pose) {
diff --git a/wpimath/src/main/native/cpp/geometry/Quaternion.cpp b/wpimath/src/main/native/cpp/geometry/Quaternion.cpp
index e4738dded6..b2cecfe5dc 100644
--- a/wpimath/src/main/native/cpp/geometry/Quaternion.cpp
+++ b/wpimath/src/main/native/cpp/geometry/Quaternion.cpp
@@ -8,9 +8,9 @@
 
 void wpi::math::to_json(wpi::util::json& json, const Quaternion& quaternion) {
   json = wpi::util::json{{"W", quaternion.W()},
-                   {"X", quaternion.X()},
-                   {"Y", quaternion.Y()},
-                   {"Z", quaternion.Z()}};
+                         {"X", quaternion.X()},
+                         {"Y", quaternion.Y()},
+                         {"Z", quaternion.Z()}};
 }
 
 void wpi::math::from_json(const wpi::util::json& json, Quaternion& quaternion) {
diff --git a/wpimath/src/main/native/cpp/geometry/Translation2d.cpp b/wpimath/src/main/native/cpp/geometry/Translation2d.cpp
index 0a85c360ce..633a823637 100644
--- a/wpimath/src/main/native/cpp/geometry/Translation2d.cpp
+++ b/wpimath/src/main/native/cpp/geometry/Translation2d.cpp
@@ -6,12 +6,14 @@
 
 #include "wpi/util/json.hpp"
 
-void wpi::math::to_json(wpi::util::json& json, const Translation2d& translation) {
-  json =
-      wpi::util::json{{"x", translation.X().value()}, {"y", translation.Y().value()}};
+void wpi::math::to_json(wpi::util::json& json,
+                        const Translation2d& translation) {
+  json = wpi::util::json{{"x", translation.X().value()},
+                         {"y", translation.Y().value()}};
 }
 
-void wpi::math::from_json(const wpi::util::json& json, Translation2d& translation) {
+void wpi::math::from_json(const wpi::util::json& json,
+                          Translation2d& translation) {
   translation = Translation2d{wpi::units::meter_t{json.at("x").get()},
                               wpi::units::meter_t{json.at("y").get()}};
 }
diff --git a/wpimath/src/main/native/cpp/geometry/Translation3d.cpp b/wpimath/src/main/native/cpp/geometry/Translation3d.cpp
index df4c81a932..4b777e32b1 100644
--- a/wpimath/src/main/native/cpp/geometry/Translation3d.cpp
+++ b/wpimath/src/main/native/cpp/geometry/Translation3d.cpp
@@ -6,13 +6,15 @@
 
 #include "wpi/util/json.hpp"
 
-void wpi::math::to_json(wpi::util::json& json, const Translation3d& translation) {
+void wpi::math::to_json(wpi::util::json& json,
+                        const Translation3d& translation) {
   json = wpi::util::json{{"x", translation.X().value()},
-                   {"y", translation.Y().value()},
-                   {"z", translation.Z().value()}};
+                         {"y", translation.Y().value()},
+                         {"z", translation.Z().value()}};
 }
 
-void wpi::math::from_json(const wpi::util::json& json, Translation3d& translation) {
+void wpi::math::from_json(const wpi::util::json& json,
+                          Translation3d& translation) {
   translation = Translation3d{wpi::units::meter_t{json.at("x").get()},
                               wpi::units::meter_t{json.at("y").get()},
                               wpi::units::meter_t{json.at("z").get()}};
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Ellipse2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Ellipse2dProto.cpp
index ce4510ec95..4b8dc9c706 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Ellipse2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Ellipse2dProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/geometry2d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback pose;
   wpi_proto_ProtobufEllipse2d msg{
       .center = pose.Callback(),
@@ -32,8 +32,8 @@ std::optional wpi::util::Protobuf::U
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                         const wpi::math::Ellipse2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Ellipse2d& value) {
   wpi::util::PackCallback pose{&value.Center()};
   wpi_proto_ProtobufEllipse2d msg{
       .center = pose.Callback(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Pose2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Pose2dProto.cpp
index 4b0bcf8440..d716ad6a7a 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Pose2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Pose2dProto.cpp
@@ -32,8 +32,8 @@ std::optional wpi::util::Protobuf::Unpack(
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                      const wpi::math::Pose2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Pose2d& value) {
   wpi::util::PackCallback tsln{&value.Translation()};
   wpi::util::PackCallback rot{&value.Rotation()};
   wpi_proto_ProtobufPose2d msg{
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Pose3dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Pose3dProto.cpp
index 1c1d61bfe1..53f2954fda 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Pose3dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Pose3dProto.cpp
@@ -34,8 +34,8 @@ std::optional wpi::util::Protobuf::Unpack(
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                      const wpi::math::Pose3d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Pose3d& value) {
   wpi::util::PackCallback tsln{&value.Translation()};
   wpi::util::PackCallback rot{&value.Rotation()};
   wpi_proto_ProtobufPose3d msg{
diff --git a/wpimath/src/main/native/cpp/geometry/proto/QuaternionProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/QuaternionProto.cpp
index 78653e0d3c..d1990a4942 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/QuaternionProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/QuaternionProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/geometry3d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufQuaternion msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -21,8 +21,8 @@ std::optional wpi::util::Protobuf:
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                          const wpi::math::Quaternion& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Quaternion& value) {
   wpi_proto_ProtobufQuaternion msg{
       .w = value.W(),
       .x = value.X(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Rectangle2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Rectangle2dProto.cpp
index a79fe89efb..7017af7c3d 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Rectangle2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Rectangle2dProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/geometry2d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback pose;
   wpi_proto_ProtobufRectangle2d msg{
       .center = pose.Callback(),
@@ -32,8 +32,8 @@ std::optional wpi::util::Protobuf::Pack(OutputStream& stream,
-                                           const wpi::math::Rectangle2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Rectangle2d& value) {
   wpi::util::PackCallback pose{&value.Center()};
   wpi_proto_ProtobufRectangle2d msg{
       .center = pose.Callback(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Rotation2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Rotation2dProto.cpp
index d78fd6acfc..ee5217c82e 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Rotation2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Rotation2dProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/geometry2d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufRotation2d msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -18,8 +18,8 @@ std::optional wpi::util::Protobuf:
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                          const wpi::math::Rotation2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Rotation2d& value) {
   wpi_proto_ProtobufRotation2d msg{
       .value = value.Radians().value(),
   };
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Rotation3dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Rotation3dProto.cpp
index 5945069f62..65303c5780 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Rotation3dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Rotation3dProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/geometry3d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback quat;
   wpi_proto_ProtobufRotation3d msg{
       .q = quat.Callback(),
@@ -28,8 +28,8 @@ std::optional wpi::util::Protobuf:
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                          const wpi::math::Rotation3d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Rotation3d& value) {
   wpi::util::PackCallback quat{&value.GetQuaternion()};
   wpi_proto_ProtobufRotation3d msg{
       .q = quat.Callback(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Transform2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Transform2dProto.cpp
index b8414ef481..32bb0730a2 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Transform2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Transform2dProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/geometry2d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback tsln;
   wpi::util::UnpackCallback rot;
   wpi_proto_ProtobufTransform2d msg{
@@ -32,8 +32,8 @@ std::optional wpi::util::Protobuf::Pack(OutputStream& stream,
-                                           const wpi::math::Transform2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Transform2d& value) {
   wpi::util::PackCallback tsln{&value.Translation()};
   wpi::util::PackCallback rot{&value.Rotation()};
   wpi_proto_ProtobufTransform2d msg{
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Transform3dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Transform3dProto.cpp
index d2e10da7f2..72a7ad6a61 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Transform3dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Transform3dProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/geometry3d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback tsln;
   wpi::util::UnpackCallback rot;
   wpi_proto_ProtobufTransform3d msg{
@@ -32,8 +32,8 @@ std::optional wpi::util::Protobuf::Pack(OutputStream& stream,
-                                           const wpi::math::Transform3d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Transform3d& value) {
   wpi::util::PackCallback tsln{&value.Translation()};
   wpi::util::PackCallback rot{&value.Rotation()};
   wpi_proto_ProtobufTransform3d msg{
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Translation2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Translation2dProto.cpp
index 6d33710dda..15736254b7 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Translation2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Translation2dProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/geometry2d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufTranslation2d msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -19,8 +19,8 @@ std::optional wpi::util::Protobuf::Pack(OutputStream& stream,
-                                             const wpi::math::Translation2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Translation2d& value) {
   wpi_proto_ProtobufTranslation2d msg{
       .x = value.X().value(),
       .y = value.Y().value(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Translation3dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Translation3dProto.cpp
index b75d026f86..d86443be01 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Translation3dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Translation3dProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/geometry3d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufTranslation3d msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -20,8 +20,8 @@ std::optional wpi::util::Protobuf::Pack(OutputStream& stream,
-                                             const wpi::math::Translation3d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Translation3d& value) {
   wpi_proto_ProtobufTranslation3d msg{
       .x = value.X().value(),
       .y = value.Y().value(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Twist2dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Twist2dProto.cpp
index dab29929ad..87c324fe9b 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Twist2dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Twist2dProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/geometry2d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufTwist2d msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -20,8 +20,8 @@ std::optional wpi::util::Protobuf::Unpac
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                       const wpi::math::Twist2d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Twist2d& value) {
   wpi_proto_ProtobufTwist2d msg{
       .dx = value.dx.value(),
       .dy = value.dy.value(),
diff --git a/wpimath/src/main/native/cpp/geometry/proto/Twist3dProto.cpp b/wpimath/src/main/native/cpp/geometry/proto/Twist3dProto.cpp
index 712e6d6f4c..3526181d57 100644
--- a/wpimath/src/main/native/cpp/geometry/proto/Twist3dProto.cpp
+++ b/wpimath/src/main/native/cpp/geometry/proto/Twist3dProto.cpp
@@ -6,21 +6,22 @@
 
 #include "wpimath/protobuf/geometry3d.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufTwist3d msg;
   if (!stream.Decode(msg)) {
     return {};
   }
 
   return wpi::math::Twist3d{
-      wpi::units::meter_t{msg.dx},  wpi::units::meter_t{msg.dy},  wpi::units::meter_t{msg.dz},
-      wpi::units::radian_t{msg.rx}, wpi::units::radian_t{msg.ry}, wpi::units::radian_t{msg.rz},
+      wpi::units::meter_t{msg.dx},  wpi::units::meter_t{msg.dy},
+      wpi::units::meter_t{msg.dz},  wpi::units::radian_t{msg.rx},
+      wpi::units::radian_t{msg.ry}, wpi::units::radian_t{msg.rz},
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                       const wpi::math::Twist3d& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Twist3d& value) {
   wpi_proto_ProtobufTwist3d msg{
       .dx = value.dx.value(),
       .dy = value.dy.value(),
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Ellipse2dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Ellipse2dStruct.cpp
index 72367f4644..b9cf3af1a7 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Ellipse2dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Ellipse2dStruct.cpp
@@ -6,7 +6,8 @@
 
 namespace {
 constexpr size_t kCenterOff = 0;
-constexpr size_t kXSemiAxisOff = kCenterOff + wpi::util::GetStructSize();
+constexpr size_t kXSemiAxisOff =
+    kCenterOff + wpi::util::GetStructSize();
 constexpr size_t kYSemiAxisOff = kXSemiAxisOff + 8;
 }  // namespace
 
@@ -20,7 +21,8 @@ wpi::math::Ellipse2d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Ellipse2d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Ellipse2d& value) {
   wpi::util::PackStruct(data, value.Center());
   wpi::util::PackStruct(data, value.XSemiAxis().value());
   wpi::util::PackStruct(data, value.YSemiAxis().value());
diff --git a/wpimath/src/main/native/cpp/geometry/struct/QuaternionStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/QuaternionStruct.cpp
index 5fd797a7f9..bbcd2b92f5 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/QuaternionStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/QuaternionStruct.cpp
@@ -22,7 +22,8 @@ wpi::math::Quaternion StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Quaternion& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Quaternion& value) {
   wpi::util::PackStruct(data, value.W());
   wpi::util::PackStruct(data, value.X());
   wpi::util::PackStruct(data, value.Y());
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Rectangle2dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Rectangle2dStruct.cpp
index 77716b8257..424c917f37 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Rectangle2dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Rectangle2dStruct.cpp
@@ -6,7 +6,8 @@
 
 namespace {
 constexpr size_t kCenterOff = 0;
-constexpr size_t kXWidthOff = kCenterOff + wpi::util::GetStructSize();
+constexpr size_t kXWidthOff =
+    kCenterOff + wpi::util::GetStructSize();
 constexpr size_t kYWidthOff = kXWidthOff + 8;
 }  // namespace
 
@@ -20,7 +21,8 @@ wpi::math::Rectangle2d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Rectangle2d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Rectangle2d& value) {
   wpi::util::PackStruct(data, value.Center());
   wpi::util::PackStruct(data, value.XWidth().value());
   wpi::util::PackStruct(data, value.YWidth().value());
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Rotation2dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Rotation2dStruct.cpp
index be887ef65a..e42bee80a1 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Rotation2dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Rotation2dStruct.cpp
@@ -16,6 +16,7 @@ wpi::math::Rotation2d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Rotation2d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Rotation2d& value) {
   wpi::util::PackStruct(data, value.Radians().value());
 }
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Rotation3dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Rotation3dStruct.cpp
index 0354d074a3..c381f5776b 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Rotation3dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Rotation3dStruct.cpp
@@ -16,6 +16,7 @@ wpi::math::Rotation3d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Rotation3d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Rotation3d& value) {
   wpi::util::PackStruct(data, value.GetQuaternion());
 }
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Transform2dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Transform2dStruct.cpp
index 83eb0f87af..6c9061057d 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Transform2dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Transform2dStruct.cpp
@@ -19,7 +19,8 @@ wpi::math::Transform2d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Transform2d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Transform2d& value) {
   wpi::util::PackStruct(data, value.Translation());
   wpi::util::PackStruct(data, value.Rotation());
 }
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Transform3dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Transform3dStruct.cpp
index 7cccc7f523..459b4b74a7 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Transform3dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Transform3dStruct.cpp
@@ -19,7 +19,8 @@ wpi::math::Transform3d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Transform3d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Transform3d& value) {
   wpi::util::PackStruct(data, value.Translation());
   wpi::util::PackStruct(data, value.Rotation());
 }
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Twist2dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Twist2dStruct.cpp
index e0ccd248cd..f322639f37 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Twist2dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Twist2dStruct.cpp
@@ -20,7 +20,8 @@ wpi::math::Twist2d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Twist2d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Twist2d& value) {
   wpi::util::PackStruct(data, value.dx.value());
   wpi::util::PackStruct(data, value.dy.value());
   wpi::util::PackStruct(data, value.dtheta.value());
diff --git a/wpimath/src/main/native/cpp/geometry/struct/Twist3dStruct.cpp b/wpimath/src/main/native/cpp/geometry/struct/Twist3dStruct.cpp
index a213952716..63f03a4007 100644
--- a/wpimath/src/main/native/cpp/geometry/struct/Twist3dStruct.cpp
+++ b/wpimath/src/main/native/cpp/geometry/struct/Twist3dStruct.cpp
@@ -26,7 +26,8 @@ wpi::math::Twist3d StructType::Unpack(std::span data) {
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::Twist3d& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::Twist3d& value) {
   wpi::util::PackStruct(data, value.dx.value());
   wpi::util::PackStruct(data, value.dy.value());
   wpi::util::PackStruct(data, value.dz.value());
diff --git a/wpimath/src/main/native/cpp/jni/ArmFeedforwardJNI.cpp b/wpimath/src/main/native/cpp/jni/ArmFeedforwardJNI.cpp
index 1b280b8966..a6a46e5b37 100644
--- a/wpimath/src/main/native/cpp/jni/ArmFeedforwardJNI.cpp
+++ b/wpimath/src/main/native/cpp/jni/ArmFeedforwardJNI.cpp
@@ -23,10 +23,11 @@ Java_org_wpilib_math_jni_ArmFeedforwardJNI_calculate
    jdouble currentAngle, jdouble currentVelocity, jdouble nextVelocity,
    jdouble dt)
 {
-  return wpi::math::ArmFeedforward{wpi::units::volt_t{ks}, wpi::units::volt_t{kg},
-                             wpi::units::unit_t{kv},
-                             wpi::units::unit_t{ka},
-                             wpi::units::second_t{dt}}
+  return wpi::math::ArmFeedforward{
+      wpi::units::volt_t{ks}, wpi::units::volt_t{kg},
+      wpi::units::unit_t{kv},
+      wpi::units::unit_t{ka},
+      wpi::units::second_t{dt}}
       .Calculate(wpi::units::radian_t{currentAngle},
                  wpi::units::radians_per_second_t{currentVelocity},
                  wpi::units::radians_per_second_t{nextVelocity})
diff --git a/wpimath/src/main/native/cpp/jni/DAREJNI.cpp b/wpimath/src/main/native/cpp/jni/DAREJNI.cpp
index 7afb1b560e..36ef6e6597 100644
--- a/wpimath/src/main/native/cpp/jni/DAREJNI.cpp
+++ b/wpimath/src/main/native/cpp/jni/DAREJNI.cpp
@@ -45,9 +45,9 @@ Java_org_wpilib_math_jni_DAREJNI_dareNoPrecondABQR
                                  Eigen::RowMajor>>
       Rmat{nativeR.data(), inputs, inputs};
 
-  auto result =
-      wpi::math::DARE(Amat, Bmat, Qmat, Rmat, false)
-          .value();
+  auto result = wpi::math::DARE(
+                    Amat, Bmat, Qmat, Rmat, false)
+                    .value();
 
   env->SetDoubleArrayRegion(S, 0, states * states, result.data());
 }
@@ -84,8 +84,8 @@ Java_org_wpilib_math_jni_DAREJNI_dareNoPrecondABQRN
                                  Eigen::RowMajor>>
       Nmat{nativeN.data(), states, inputs};
 
-  auto result = wpi::math::DARE(Amat, Bmat, Qmat,
-                                                          Rmat, Nmat, false)
+  auto result = wpi::math::DARE(
+                    Amat, Bmat, Qmat, Rmat, Nmat, false)
                     .value();
 
   env->SetDoubleArrayRegion(S, 0, states * states, result.data());
@@ -119,8 +119,8 @@ Java_org_wpilib_math_jni_DAREJNI_dareABQR
                                  Eigen::RowMajor>>
       Rmat{nativeR.data(), inputs, inputs};
 
-  if (auto result =
-          wpi::math::DARE(Amat, Bmat, Qmat, Rmat)) {
+  if (auto result = wpi::math::DARE(
+          Amat, Bmat, Qmat, Rmat)) {
     env->SetDoubleArrayRegion(S, 0, states * states, result.value().data());
     // K = (BᵀSB + R)⁻¹BᵀSA
   } else if (result.error() == wpi::math::DAREError::QNotSymmetric ||
@@ -172,8 +172,8 @@ Java_org_wpilib_math_jni_DAREJNI_dareABQRN
                                  Eigen::RowMajor>>
       Nmat{nativeN.data(), states, inputs};
 
-  if (auto result = wpi::math::DARE(Amat, Bmat, Qmat,
-                                                              Rmat, Nmat)) {
+  if (auto result = wpi::math::DARE(
+          Amat, Bmat, Qmat, Rmat, Nmat)) {
     env->SetDoubleArrayRegion(S, 0, states * states, result.value().data());
   } else if (result.error() == wpi::math::DAREError::QNotSymmetric ||
              result.error() == wpi::math::DAREError::QNotPositiveSemidefinite) {
diff --git a/wpimath/src/main/native/cpp/jni/Ellipse2dJNI.cpp b/wpimath/src/main/native/cpp/jni/Ellipse2dJNI.cpp
index 28d3877b2f..14f7a0c7a4 100644
--- a/wpimath/src/main/native/cpp/jni/Ellipse2dJNI.cpp
+++ b/wpimath/src/main/native/cpp/jni/Ellipse2dJNI.cpp
@@ -26,8 +26,9 @@ Java_org_wpilib_math_jni_Ellipse2dJNI_nearest
 {
   auto point =
       wpi::math::Ellipse2d{
-          wpi::math::Pose2d{wpi::units::meter_t{centerX}, wpi::units::meter_t{centerY},
-                      wpi::units::radian_t{centerHeading}},
+          wpi::math::Pose2d{wpi::units::meter_t{centerX},
+                            wpi::units::meter_t{centerY},
+                            wpi::units::radian_t{centerHeading}},
           wpi::units::meter_t{xSemiAxis}, wpi::units::meter_t{ySemiAxis}}
           .Nearest({wpi::units::meter_t{pointX}, wpi::units::meter_t{pointY}});
 
diff --git a/wpimath/src/main/native/cpp/jni/Transform3dJNI.cpp b/wpimath/src/main/native/cpp/jni/Transform3dJNI.cpp
index 1e20916e30..b46fe916f0 100644
--- a/wpimath/src/main/native/cpp/jni/Transform3dJNI.cpp
+++ b/wpimath/src/main/native/cpp/jni/Transform3dJNI.cpp
@@ -28,7 +28,8 @@ Java_org_wpilib_math_jni_Transform3dJNI_log
    jdouble relQx, jdouble relQy, jdouble relQz)
 {
   wpi::math::Transform3d transform3d{
-      wpi::units::meter_t{relX}, wpi::units::meter_t{relY}, wpi::units::meter_t{relZ},
+      wpi::units::meter_t{relX}, wpi::units::meter_t{relY},
+      wpi::units::meter_t{relZ},
       wpi::math::Rotation3d{wpi::math::Quaternion{relQw, relQx, relQy, relQz}}};
 
   wpi::math::Twist3d result = transform3d.Log();
diff --git a/wpimath/src/main/native/cpp/jni/Twist3dJNI.cpp b/wpimath/src/main/native/cpp/jni/Twist3dJNI.cpp
index 7c82ea72aa..23fd35bc7d 100644
--- a/wpimath/src/main/native/cpp/jni/Twist3dJNI.cpp
+++ b/wpimath/src/main/native/cpp/jni/Twist3dJNI.cpp
@@ -25,9 +25,10 @@ Java_org_wpilib_math_jni_Twist3dJNI_exp
   (JNIEnv* env, jclass, jdouble twistDx, jdouble twistDy, jdouble twistDz,
    jdouble twistRx, jdouble twistRy, jdouble twistRz)
 {
-  wpi::math::Twist3d twist{wpi::units::meter_t{twistDx},  wpi::units::meter_t{twistDy},
-                     wpi::units::meter_t{twistDz},  wpi::units::radian_t{twistRx},
-                     wpi::units::radian_t{twistRy}, wpi::units::radian_t{twistRz}};
+  wpi::math::Twist3d twist{
+      wpi::units::meter_t{twistDx},  wpi::units::meter_t{twistDy},
+      wpi::units::meter_t{twistDz},  wpi::units::radian_t{twistRx},
+      wpi::units::radian_t{twistRy}, wpi::units::radian_t{twistRz}};
 
   wpi::math::Transform3d result = twist.Exp();
 
diff --git a/wpimath/src/main/native/cpp/kinematics/MecanumDriveKinematics.cpp b/wpimath/src/main/native/cpp/kinematics/MecanumDriveKinematics.cpp
index 04a9818ff7..2de6ec0a47 100644
--- a/wpimath/src/main/native/cpp/kinematics/MecanumDriveKinematics.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/MecanumDriveKinematics.cpp
@@ -60,7 +60,8 @@ Twist2d MecanumDriveKinematics::ToTwist2d(
 
   Eigen::Vector3d twistVector = m_forwardKinematics.solve(wheelDeltasVector);
 
-  return {wpi::units::meter_t{twistVector(0)}, wpi::units::meter_t{twistVector(1)},
+  return {wpi::units::meter_t{twistVector(0)},
+          wpi::units::meter_t{twistVector(1)},
           wpi::units::radian_t{twistVector(2)}};
 }
 
@@ -72,7 +73,8 @@ Twist2d MecanumDriveKinematics::ToTwist2d(
 
   Eigen::Vector3d twistVector = m_forwardKinematics.solve(wheelDeltasVector);
 
-  return {wpi::units::meter_t{twistVector(0)}, wpi::units::meter_t{twistVector(1)},
+  return {wpi::units::meter_t{twistVector(0)},
+          wpi::units::meter_t{twistVector(1)},
           wpi::units::radian_t{twistVector(2)}};
 }
 
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/ChassisSpeedsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/ChassisSpeedsProto.cpp
index 168714e475..8732ffcfad 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/ChassisSpeedsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/ChassisSpeedsProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufChassisSpeeds msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -20,8 +20,8 @@ std::optional wpi::util::Protobuf::Pack(OutputStream& stream,
-                                             const wpi::math::ChassisSpeeds& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::ChassisSpeeds& value) {
   wpi_proto_ProtobufChassisSpeeds msg{
       .vx = value.vx.value(),
       .vy = value.vy.value(),
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveKinematicsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveKinematicsProto.cpp
index a47296d7d4..ff165c6d06 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveKinematicsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveKinematicsProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::DifferentialDriveKinematics>::Unpack(InputStream& stream) {
   wpi_proto_ProtobufDifferentialDriveKinematics msg;
   if (!stream.Decode(msg)) {
     return {};
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelPositionsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelPositionsProto.cpp
index ff6ec6a9f2..c143144c4c 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelPositionsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelPositionsProto.cpp
@@ -20,7 +20,8 @@ std::optional wpi::util::Protobuf<
 }
 
 bool wpi::util::Protobuf::Pack(
-    OutputStream& stream, const wpi::math::DifferentialDriveWheelPositions& value) {
+    OutputStream& stream,
+    const wpi::math::DifferentialDriveWheelPositions& value) {
   wpi_proto_ProtobufDifferentialDriveWheelPositions msg{
       .left = value.left.value(),
       .right = value.right.value(),
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProto.cpp
index 5a2b555d45..13dc46e561 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/DifferentialDriveWheelSpeedsProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::DifferentialDriveWheelSpeeds>::Unpack(InputStream& stream) {
   wpi_proto_ProtobufDifferentialDriveWheelSpeeds msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -20,7 +20,8 @@ wpi::util::Protobuf::Unpack(InputStream
 }
 
 bool wpi::util::Protobuf::Pack(
-    OutputStream& stream, const wpi::math::DifferentialDriveWheelSpeeds& value) {
+    OutputStream& stream,
+    const wpi::math::DifferentialDriveWheelSpeeds& value) {
   wpi_proto_ProtobufDifferentialDriveWheelSpeeds msg{
       .left = value.left.value(),
       .right = value.right.value(),
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveKinematicsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveKinematicsProto.cpp
index be9dcd7fa0..65a340a075 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveKinematicsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveKinematicsProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::MecanumDriveKinematics>::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback frontLeft;
   wpi::util::UnpackCallback frontRight;
   wpi::util::UnpackCallback rearLeft;
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProto.cpp
index e08446f2e3..7ad215be42 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelPositionsProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::MecanumDriveWheelPositions>::Unpack(InputStream& stream) {
   wpi_proto_ProtobufMecanumDriveWheelPositions msg;
   if (!stream.Decode(msg)) {
     return {};
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProto.cpp
index cd74d84bc1..862cf87b90 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/MecanumDriveWheelSpeedsProto.cpp
@@ -6,8 +6,8 @@
 
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::MecanumDriveWheelSpeeds>::Unpack(InputStream& stream) {
   wpi_proto_ProtobufMecanumDriveWheelSpeeds msg;
   if (!stream.Decode(msg)) {
     return {};
diff --git a/wpimath/src/main/native/cpp/kinematics/proto/SwerveModulePositionProto.cpp b/wpimath/src/main/native/cpp/kinematics/proto/SwerveModulePositionProto.cpp
index 05aae69ef2..be049a2de1 100644
--- a/wpimath/src/main/native/cpp/kinematics/proto/SwerveModulePositionProto.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/proto/SwerveModulePositionProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/kinematics.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::SwerveModulePosition>::Unpack(InputStream& stream) {
   wpi::util::UnpackCallback angle;
   wpi_proto_ProtobufSwerveModulePosition msg{
       .distance = 0,
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/ChassisSpeedsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/ChassisSpeedsStruct.cpp
index 1a1b97ea0c..f3d769e966 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/ChassisSpeedsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/ChassisSpeedsStruct.cpp
@@ -14,9 +14,12 @@ using StructType = wpi::util::Struct;
 
 wpi::math::ChassisSpeeds StructType::Unpack(std::span data) {
   return wpi::math::ChassisSpeeds{
-      wpi::units::meters_per_second_t{wpi::util::UnpackStruct(data)},
-      wpi::units::meters_per_second_t{wpi::util::UnpackStruct(data)},
-      wpi::units::radians_per_second_t{wpi::util::UnpackStruct(data)},
+      wpi::units::meters_per_second_t{
+          wpi::util::UnpackStruct(data)},
+      wpi::units::meters_per_second_t{
+          wpi::util::UnpackStruct(data)},
+      wpi::units::radians_per_second_t{
+          wpi::util::UnpackStruct(data)},
   };
 }
 
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveKinematicsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveKinematicsStruct.cpp
index f2bdeb8410..6f3484b75c 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveKinematicsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveKinematicsStruct.cpp
@@ -13,7 +13,8 @@ using StructType = wpi::util::Struct;
 wpi::math::DifferentialDriveKinematics StructType::Unpack(
     std::span data) {
   return wpi::math::DifferentialDriveKinematics{
-      wpi::units::meter_t{wpi::util::UnpackStruct(data)},
+      wpi::units::meter_t{
+          wpi::util::UnpackStruct(data)},
   };
 }
 
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStruct.cpp
index 563df5a03d..294dacd396 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStruct.cpp
@@ -9,7 +9,8 @@ constexpr size_t kLeftOff = 0;
 constexpr size_t kRightOff = kLeftOff + 8;
 }  // namespace
 
-using StructType = wpi::util::Struct;
+using StructType =
+    wpi::util::Struct;
 
 wpi::math::DifferentialDriveWheelPositions StructType::Unpack(
     std::span data) {
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelSpeedsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelSpeedsStruct.cpp
index 3d193bd6c8..ac1eecea4b 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelSpeedsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/DifferentialDriveWheelSpeedsStruct.cpp
@@ -14,8 +14,10 @@ using StructType = wpi::util::Struct;
 wpi::math::DifferentialDriveWheelSpeeds StructType::Unpack(
     std::span data) {
   return wpi::math::DifferentialDriveWheelSpeeds{
-      wpi::units::meters_per_second_t{wpi::util::UnpackStruct(data)},
-      wpi::units::meters_per_second_t{wpi::util::UnpackStruct(data)},
+      wpi::units::meters_per_second_t{
+          wpi::util::UnpackStruct(data)},
+      wpi::units::meters_per_second_t{
+          wpi::util::UnpackStruct(data)},
   };
 }
 
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveKinematicsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveKinematicsStruct.cpp
index da1f6b987e..e88d2edb2f 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveKinematicsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveKinematicsStruct.cpp
@@ -16,7 +16,8 @@ constexpr size_t kRearRightOff =
 
 using StructType = wpi::util::Struct;
 
-wpi::math::MecanumDriveKinematics StructType::Unpack(std::span data) {
+wpi::math::MecanumDriveKinematics StructType::Unpack(
+    std::span data) {
   return wpi::math::MecanumDriveKinematics{
       wpi::util::UnpackStruct(data),
       wpi::util::UnpackStruct(data),
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelPositionsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelPositionsStruct.cpp
index 7c7c004fe7..b28a68484d 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelPositionsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelPositionsStruct.cpp
@@ -17,7 +17,8 @@ wpi::math::MecanumDriveWheelPositions StructType::Unpack(
     std::span data) {
   return wpi::math::MecanumDriveWheelPositions{
       wpi::units::meter_t{wpi::util::UnpackStruct(data)},
-      wpi::units::meter_t{wpi::util::UnpackStruct(data)},
+      wpi::units::meter_t{
+          wpi::util::UnpackStruct(data)},
       wpi::units::meter_t{wpi::util::UnpackStruct(data)},
       wpi::units::meter_t{wpi::util::UnpackStruct(data)},
   };
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelSpeedsStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelSpeedsStruct.cpp
index 1f4cd6ae6e..8259dd5127 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelSpeedsStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/MecanumDriveWheelSpeedsStruct.cpp
@@ -13,13 +13,15 @@ constexpr size_t kRearRightOff = kRearLeftOff + 8;
 
 using StructType = wpi::util::Struct;
 
-wpi::math::MecanumDriveWheelSpeeds StructType::Unpack(std::span data) {
+wpi::math::MecanumDriveWheelSpeeds StructType::Unpack(
+    std::span data) {
   return wpi::math::MecanumDriveWheelSpeeds{
       wpi::units::meters_per_second_t{
           wpi::util::UnpackStruct(data)},
       wpi::units::meters_per_second_t{
           wpi::util::UnpackStruct(data)},
-      wpi::units::meters_per_second_t{wpi::util::UnpackStruct(data)},
+      wpi::units::meters_per_second_t{
+          wpi::util::UnpackStruct(data)},
       wpi::units::meters_per_second_t{
           wpi::util::UnpackStruct(data)},
   };
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/SwerveModulePositionStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/SwerveModulePositionStruct.cpp
index 22ed63d958..f07022e37e 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/SwerveModulePositionStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/SwerveModulePositionStruct.cpp
@@ -11,7 +11,8 @@ constexpr size_t kAngleOff = kDistanceOff + 8;
 
 using StructType = wpi::util::Struct;
 
-wpi::math::SwerveModulePosition StructType::Unpack(std::span data) {
+wpi::math::SwerveModulePosition StructType::Unpack(
+    std::span data) {
   return wpi::math::SwerveModulePosition{
       wpi::units::meter_t{wpi::util::UnpackStruct(data)},
       wpi::util::UnpackStruct(data),
diff --git a/wpimath/src/main/native/cpp/kinematics/struct/SwerveModuleStateStruct.cpp b/wpimath/src/main/native/cpp/kinematics/struct/SwerveModuleStateStruct.cpp
index 26c7a6c008..15b568e8a6 100644
--- a/wpimath/src/main/native/cpp/kinematics/struct/SwerveModuleStateStruct.cpp
+++ b/wpimath/src/main/native/cpp/kinematics/struct/SwerveModuleStateStruct.cpp
@@ -13,7 +13,8 @@ using StructType = wpi::util::Struct;
 
 wpi::math::SwerveModuleState StructType::Unpack(std::span data) {
   return wpi::math::SwerveModuleState{
-      wpi::units::meters_per_second_t{wpi::util::UnpackStruct(data)},
+      wpi::units::meters_per_second_t{
+          wpi::util::UnpackStruct(data)},
       wpi::util::UnpackStruct(data),
   };
 }
diff --git a/wpimath/src/main/native/cpp/spline/proto/CubicHermiteSplineProto.cpp b/wpimath/src/main/native/cpp/spline/proto/CubicHermiteSplineProto.cpp
index 48882b9365..1e6d6061e7 100644
--- a/wpimath/src/main/native/cpp/spline/proto/CubicHermiteSplineProto.cpp
+++ b/wpimath/src/main/native/cpp/spline/proto/CubicHermiteSplineProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/spline.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::CubicHermiteSpline>::Unpack(InputStream& stream) {
   wpi::util::WpiArrayUnpackCallback xInitial;
   wpi::util::WpiArrayUnpackCallback xFinal;
   wpi::util::WpiArrayUnpackCallback yInitial;
diff --git a/wpimath/src/main/native/cpp/spline/proto/QuinticHermiteSplineProto.cpp b/wpimath/src/main/native/cpp/spline/proto/QuinticHermiteSplineProto.cpp
index 8f4fead901..807f7f4471 100644
--- a/wpimath/src/main/native/cpp/spline/proto/QuinticHermiteSplineProto.cpp
+++ b/wpimath/src/main/native/cpp/spline/proto/QuinticHermiteSplineProto.cpp
@@ -7,8 +7,8 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/spline.npb.h"
 
-std::optional
-wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf<
+    wpi::math::QuinticHermiteSpline>::Unpack(InputStream& stream) {
   wpi::util::WpiArrayUnpackCallback xInitial;
   wpi::util::WpiArrayUnpackCallback xFinal;
   wpi::util::WpiArrayUnpackCallback yInitial;
diff --git a/wpimath/src/main/native/cpp/spline/struct/CubicHermiteSplineStruct.cpp b/wpimath/src/main/native/cpp/spline/struct/CubicHermiteSplineStruct.cpp
index 58674b45cb..525166d369 100644
--- a/wpimath/src/main/native/cpp/spline/struct/CubicHermiteSplineStruct.cpp
+++ b/wpimath/src/main/native/cpp/spline/struct/CubicHermiteSplineStruct.cpp
@@ -11,8 +11,8 @@ constexpr size_t kYInitialOff = kXFinalOff + 2 * 8;
 constexpr size_t kYFinalOff = kYInitialOff + 2 * 8;
 }  // namespace
 
-wpi::math::CubicHermiteSpline wpi::util::Struct::Unpack(
-    std::span data) {
+wpi::math::CubicHermiteSpline wpi::util::Struct<
+    wpi::math::CubicHermiteSpline>::Unpack(std::span data) {
   return wpi::math::CubicHermiteSpline{
       wpi::util::UnpackStructArray(data),
       wpi::util::UnpackStructArray(data),
@@ -22,10 +22,12 @@ wpi::math::CubicHermiteSpline wpi::util::Struct::
 
 void wpi::util::Struct::Pack(
     std::span data, const wpi::math::CubicHermiteSpline& value) {
-  wpi::util::PackStructArray(data,
-                                        value.GetInitialControlVector().x);
-  wpi::util::PackStructArray(data, value.GetFinalControlVector().x);
-  wpi::util::PackStructArray(data,
-                                        value.GetInitialControlVector().y);
-  wpi::util::PackStructArray(data, value.GetFinalControlVector().y);
+  wpi::util::PackStructArray(
+      data, value.GetInitialControlVector().x);
+  wpi::util::PackStructArray(data,
+                                            value.GetFinalControlVector().x);
+  wpi::util::PackStructArray(
+      data, value.GetInitialControlVector().y);
+  wpi::util::PackStructArray(data,
+                                            value.GetFinalControlVector().y);
 }
diff --git a/wpimath/src/main/native/cpp/spline/struct/QuinticHermiteSplineStruct.cpp b/wpimath/src/main/native/cpp/spline/struct/QuinticHermiteSplineStruct.cpp
index 057b2dad89..fc77374505 100644
--- a/wpimath/src/main/native/cpp/spline/struct/QuinticHermiteSplineStruct.cpp
+++ b/wpimath/src/main/native/cpp/spline/struct/QuinticHermiteSplineStruct.cpp
@@ -11,8 +11,8 @@ constexpr size_t kYInitialOff = kXFinalOff + 3 * 8;
 constexpr size_t kYFinalOff = kYInitialOff + 3 * 8;
 }  // namespace
 
-wpi::math::QuinticHermiteSpline wpi::util::Struct::Unpack(
-    std::span data) {
+wpi::math::QuinticHermiteSpline wpi::util::Struct<
+    wpi::math::QuinticHermiteSpline>::Unpack(std::span data) {
   return wpi::math::QuinticHermiteSpline{
       wpi::util::UnpackStructArray(data),
       wpi::util::UnpackStructArray(data),
@@ -22,10 +22,12 @@ wpi::math::QuinticHermiteSpline wpi::util::Struct::Pack(
     std::span data, const wpi::math::QuinticHermiteSpline& value) {
-  wpi::util::PackStructArray(data,
-                                        value.GetInitialControlVector().x);
-  wpi::util::PackStructArray(data, value.GetFinalControlVector().x);
-  wpi::util::PackStructArray(data,
-                                        value.GetInitialControlVector().y);
-  wpi::util::PackStructArray(data, value.GetFinalControlVector().y);
+  wpi::util::PackStructArray(
+      data, value.GetInitialControlVector().x);
+  wpi::util::PackStructArray(data,
+                                            value.GetFinalControlVector().x);
+  wpi::util::PackStructArray(
+      data, value.GetInitialControlVector().y);
+  wpi::util::PackStructArray(data,
+                                            value.GetFinalControlVector().y);
 }
diff --git a/wpimath/src/main/native/cpp/system/plant/proto/DCMotorProto.cpp b/wpimath/src/main/native/cpp/system/plant/proto/DCMotorProto.cpp
index 6637c6a467..2a45b28086 100644
--- a/wpimath/src/main/native/cpp/system/plant/proto/DCMotorProto.cpp
+++ b/wpimath/src/main/native/cpp/system/plant/proto/DCMotorProto.cpp
@@ -8,8 +8,8 @@
 
 #include "wpimath/protobuf/plant.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
   wpi_proto_ProtobufDCMotor msg;
   if (!stream.Decode(msg)) {
     return {};
@@ -24,8 +24,8 @@ std::optional wpi::util::Protobuf::Unpac
   };
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                       const wpi::math::DCMotor& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::DCMotor& value) {
   wpi_proto_ProtobufDCMotor msg{
       .nominal_voltage = value.nominalVoltage.value(),
       .stall_torque = value.stallTorque.value(),
diff --git a/wpimath/src/main/native/cpp/system/plant/struct/DCMotorStruct.cpp b/wpimath/src/main/native/cpp/system/plant/struct/DCMotorStruct.cpp
index 8cccad71b2..d9f0202a0b 100644
--- a/wpimath/src/main/native/cpp/system/plant/struct/DCMotorStruct.cpp
+++ b/wpimath/src/main/native/cpp/system/plant/struct/DCMotorStruct.cpp
@@ -16,16 +16,21 @@ using StructType = wpi::util::Struct;
 
 wpi::math::DCMotor StructType::Unpack(std::span data) {
   return wpi::math::DCMotor{
-      wpi::units::volt_t{wpi::util::UnpackStruct(data)},
-      wpi::units::newton_meter_t{wpi::util::UnpackStruct(data)},
-      wpi::units::ampere_t{wpi::util::UnpackStruct(data)},
-      wpi::units::ampere_t{wpi::util::UnpackStruct(data)},
+      wpi::units::volt_t{
+          wpi::util::UnpackStruct(data)},
+      wpi::units::newton_meter_t{
+          wpi::util::UnpackStruct(data)},
+      wpi::units::ampere_t{
+          wpi::util::UnpackStruct(data)},
+      wpi::units::ampere_t{
+          wpi::util::UnpackStruct(data)},
       wpi::units::radians_per_second_t{
           wpi::util::UnpackStruct(data)},
   };
 }
 
-void StructType::Pack(std::span data, const wpi::math::DCMotor& value) {
+void StructType::Pack(std::span data,
+                      const wpi::math::DCMotor& value) {
   wpi::util::PackStruct(data, value.nominalVoltage.value());
   wpi::util::PackStruct(data, value.stallTorque.value());
   wpi::util::PackStruct(data, value.stallCurrent.value());
diff --git a/wpimath/src/main/native/cpp/trajectory/Trajectory.cpp b/wpimath/src/main/native/cpp/trajectory/Trajectory.cpp
index 4b38834c2d..d3c0336b72 100644
--- a/wpimath/src/main/native/cpp/trajectory/Trajectory.cpp
+++ b/wpimath/src/main/native/cpp/trajectory/Trajectory.cpp
@@ -10,18 +10,19 @@ using namespace wpi::math;
 
 void wpi::math::to_json(wpi::util::json& json, const Trajectory::State& state) {
   json = wpi::util::json{{"time", state.t.value()},
-                   {"velocity", state.velocity.value()},
-                   {"acceleration", state.acceleration.value()},
-                   {"pose", state.pose},
-                   {"curvature", state.curvature.value()}};
+                         {"velocity", state.velocity.value()},
+                         {"acceleration", state.acceleration.value()},
+                         {"pose", state.pose},
+                         {"curvature", state.curvature.value()}};
 }
 
-void wpi::math::from_json(const wpi::util::json& json, Trajectory::State& state) {
+void wpi::math::from_json(const wpi::util::json& json,
+                          Trajectory::State& state) {
   state.pose = json.at("pose").get();
   state.t = wpi::units::second_t{json.at("time").get()};
   state.velocity =
       wpi::units::meters_per_second_t{json.at("velocity").get()};
-  state.acceleration =
-      wpi::units::meters_per_second_squared_t{json.at("acceleration").get()};
+  state.acceleration = wpi::units::meters_per_second_squared_t{
+      json.at("acceleration").get()};
   state.curvature = wpi::units::curvature_t{json.at("curvature").get()};
 }
diff --git a/wpimath/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp b/wpimath/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
index 6a275ab325..bcc088f804 100644
--- a/wpimath/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
+++ b/wpimath/src/main/native/cpp/trajectory/TrajectoryParameterizer.cpp
@@ -67,9 +67,9 @@ Trajectory TrajectoryParameterizer::TimeParameterizeTrajectory(
       // acceleration limit. v_f = √(v_i² + 2ad).
 
       constrainedState.maxVelocity = wpi::units::math::min(
-          maxVelocity,
-          wpi::units::math::sqrt(predecessor.maxVelocity * predecessor.maxVelocity +
-                            predecessor.maxAcceleration * ds * 2.0));
+          maxVelocity, wpi::units::math::sqrt(
+                           predecessor.maxVelocity * predecessor.maxVelocity +
+                           predecessor.maxAcceleration * ds * 2.0));
 
       constrainedState.minAcceleration = -maxAcceleration;
       constrainedState.maxAcceleration = maxAcceleration;
@@ -131,7 +131,7 @@ Trajectory TrajectoryParameterizer::TimeParameterizeTrajectory(
       // v_f = √(v_i² + 2ad), where v_i = successor.
       wpi::units::meters_per_second_t newMaxVelocity =
           wpi::units::math::sqrt(successor.maxVelocity * successor.maxVelocity +
-                            successor.minAcceleration * ds * 2.0);
+                                 successor.minAcceleration * ds * 2.0);
 
       // No more limits to impose! This state can be finalized.
       if (newMaxVelocity >= constrainedState.maxVelocity) {
diff --git a/wpimath/src/main/native/cpp/trajectory/proto/TrajectoryProto.cpp b/wpimath/src/main/native/cpp/trajectory/proto/TrajectoryProto.cpp
index 5e0c478a48..a1d25d5f4f 100644
--- a/wpimath/src/main/native/cpp/trajectory/proto/TrajectoryProto.cpp
+++ b/wpimath/src/main/native/cpp/trajectory/proto/TrajectoryProto.cpp
@@ -9,9 +9,10 @@
 #include "wpi/util/protobuf/ProtobufCallbacks.hpp"
 #include "wpimath/protobuf/trajectory.npb.h"
 
-std::optional wpi::util::Protobuf::Unpack(
-    InputStream& stream) {
-  wpi::util::StdVectorUnpackCallback states;
+std::optional
+wpi::util::Protobuf::Unpack(InputStream& stream) {
+  wpi::util::StdVectorUnpackCallback
+      states;
   wpi_proto_ProtobufTrajectory msg{
       .states = states.Callback(),
   };
@@ -22,8 +23,8 @@ std::optional wpi::util::Protobuf:
   return wpi::math::Trajectory{states.Vec()};
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                          const wpi::math::Trajectory& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const wpi::math::Trajectory& value) {
   wpi::util::PackCallback states{value.States()};
   wpi_proto_ProtobufTrajectory msg{
       .states = states.Callback(),
diff --git a/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp b/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp
index 44f9004a2c..558b61ad2c 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp
@@ -23,13 +23,13 @@ class WPILIB_DLLEXPORT ArmFeedforward {
  public:
   using Angle = wpi::units::radians;
   using Velocity = wpi::units::radians_per_second;
-  using Acceleration = wpi::units::compound_unit>;
-  using kv_unit =
-      wpi::units::compound_unit>;
-  using ka_unit =
-      wpi::units::compound_unit>;
+  using Acceleration =
+      wpi::units::compound_unit>;
+  using kv_unit = wpi::units::compound_unit<
+      wpi::units::volts, wpi::units::inverse>;
+  using ka_unit = wpi::units::compound_unit>;
 
   /**
    * Creates a new ArmFeedforward with the specified gains.
@@ -44,7 +44,8 @@ class WPILIB_DLLEXPORT ArmFeedforward {
    * @throws IllegalArgumentException for period ≤ zero.
    */
   constexpr ArmFeedforward(
-      wpi::units::volt_t kS, wpi::units::volt_t kG, wpi::units::unit_t kV,
+      wpi::units::volt_t kS, wpi::units::volt_t kG,
+      wpi::units::unit_t kV,
       wpi::units::unit_t kA = wpi::units::unit_t(0),
       wpi::units::second_t dt = 20_ms)
       : kS(kS), kG(kG), kV(kV), kA(kA), m_dt(dt) {
@@ -104,9 +105,9 @@ class WPILIB_DLLEXPORT ArmFeedforward {
    */
   [[deprecated("Use the current/next velocity overload instead.")]]
   wpi::units::volt_t Calculate(wpi::units::unit_t currentAngle,
-                          wpi::units::unit_t currentVelocity,
-                          wpi::units::unit_t nextVelocity,
-                          wpi::units::second_t dt) const {
+                               wpi::units::unit_t currentVelocity,
+                               wpi::units::unit_t nextVelocity,
+                               wpi::units::second_t dt) const {
     return Calculate(currentAngle, currentVelocity, nextVelocity);
   }
 
@@ -141,8 +142,8 @@ class WPILIB_DLLEXPORT ArmFeedforward {
    * @return The computed feedforward in volts.
    */
   wpi::units::volt_t Calculate(wpi::units::unit_t currentAngle,
-                          wpi::units::unit_t currentVelocity,
-                          wpi::units::unit_t nextVelocity) const;
+                               wpi::units::unit_t currentVelocity,
+                               wpi::units::unit_t nextVelocity) const;
 
   // Rearranging the main equation from the calculate() method yields the
   // formulas for the methods below:
diff --git a/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp b/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp
index 251e7fe9ff..0c9eee3832 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveAccelerationLimiter.hpp
@@ -84,8 +84,8 @@ class WPILIB_DLLEXPORT DifferentialDriveAccelerationLimiter {
    */
   DifferentialDriveWheelVoltages Calculate(
       wpi::units::meters_per_second_t leftVelocity,
-      wpi::units::meters_per_second_t rightVelocity, wpi::units::volt_t leftVoltage,
-      wpi::units::volt_t rightVoltage);
+      wpi::units::meters_per_second_t rightVelocity,
+      wpi::units::volt_t leftVoltage, wpi::units::volt_t rightVoltage);
 
  private:
   LinearSystem<2, 2, 2> m_system;
diff --git a/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveFeedforward.hpp b/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveFeedforward.hpp
index 0bc5f982f7..1787da9bd5 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveFeedforward.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/DifferentialDriveFeedforward.hpp
@@ -89,7 +89,8 @@ class WPILIB_DLLEXPORT DifferentialDriveFeedforward {
       wpi::units::meters_per_second_t currentLeftVelocity,
       wpi::units::meters_per_second_t nextLeftVelocity,
       wpi::units::meters_per_second_t currentRightVelocity,
-      wpi::units::meters_per_second_t nextRightVelocity, wpi::units::second_t dt);
+      wpi::units::meters_per_second_t nextRightVelocity,
+      wpi::units::second_t dt);
 
   decltype(1_V / 1_mps) m_kVLinear;
   decltype(1_V / 1_mps_sq) m_kALinear;
diff --git a/wpimath/src/main/native/include/wpi/math/controller/ElevatorFeedforward.hpp b/wpimath/src/main/native/include/wpi/math/controller/ElevatorFeedforward.hpp
index 947a92dfa6..263dbb3eaf 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/ElevatorFeedforward.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/ElevatorFeedforward.hpp
@@ -22,12 +22,15 @@ class ElevatorFeedforward {
  public:
   using Distance = wpi::units::meters;
   using Velocity =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Acceleration =
-      wpi::units::compound_unit>;
-  using kv_unit = wpi::units::compound_unit>;
-  using ka_unit =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
+  using kv_unit = wpi::units::compound_unit>;
+  using ka_unit = wpi::units::compound_unit>;
 
   /**
    * Creates a new ElevatorFeedforward with the specified gains.
@@ -42,7 +45,8 @@ class ElevatorFeedforward {
    * @throws IllegalArgumentException for period ≤ zero.
    */
   constexpr ElevatorFeedforward(
-      wpi::units::volt_t kS, wpi::units::volt_t kG, wpi::units::unit_t kV,
+      wpi::units::volt_t kS, wpi::units::volt_t kG,
+      wpi::units::unit_t kV,
       wpi::units::unit_t kA = wpi::units::unit_t(0),
       wpi::units::second_t dt = 20_ms)
       : kS(kS), kG(kG), kV(kV), kA(kA), m_dt(dt) {
@@ -79,7 +83,8 @@ class ElevatorFeedforward {
   constexpr wpi::units::volt_t Calculate(
       wpi::units::unit_t velocity,
       wpi::units::unit_t acceleration) const {
-    return kS * wpi::util::sgn(velocity) + kG + kV * velocity + kA * acceleration;
+    return kS * wpi::util::sgn(velocity) + kG + kV * velocity +
+           kA * acceleration;
   }
 
   /**
@@ -93,8 +98,8 @@ class ElevatorFeedforward {
    */
   [[deprecated("Use the current/next velocity overload instead.")]]
   wpi::units::volt_t Calculate(wpi::units::unit_t currentVelocity,
-                          wpi::units::unit_t nextVelocity,
-                          wpi::units::second_t dt) const {
+                               wpi::units::unit_t nextVelocity,
+                               wpi::units::second_t dt) const {
     // See wpimath/algorithms.md#Elevator_feedforward for derivation
     auto plant = LinearSystemId::IdentifyVelocitySystem(kV, kA);
     LinearPlantInversionFeedforward<1, 1> feedforward{plant, dt};
@@ -161,7 +166,8 @@ class ElevatorFeedforward {
    * @return The maximum possible velocity at the given acceleration.
    */
   constexpr wpi::units::unit_t MaxAchievableVelocity(
-      wpi::units::volt_t maxVoltage, wpi::units::unit_t acceleration) {
+      wpi::units::volt_t maxVoltage,
+      wpi::units::unit_t acceleration) {
     // Assume max velocity is positive
     return (maxVoltage - kS - kG - kA * acceleration) / kV;
   }
@@ -178,7 +184,8 @@ class ElevatorFeedforward {
    * @return The minimum possible velocity at the given acceleration.
    */
   constexpr wpi::units::unit_t MinAchievableVelocity(
-      wpi::units::volt_t maxVoltage, wpi::units::unit_t acceleration) {
+      wpi::units::volt_t maxVoltage,
+      wpi::units::unit_t acceleration) {
     // Assume min velocity is negative, ks flips sign
     return (-maxVoltage + kS - kG - kA * acceleration) / kV;
   }
@@ -196,7 +203,8 @@ class ElevatorFeedforward {
    */
   constexpr wpi::units::unit_t MaxAchievableAcceleration(
       wpi::units::volt_t maxVoltage, wpi::units::unit_t velocity) {
-    return (maxVoltage - kS * wpi::util::sgn(velocity) - kG - kV * velocity) / kA;
+    return (maxVoltage - kS * wpi::util::sgn(velocity) - kG - kV * velocity) /
+           kA;
   }
 
   /**
diff --git a/wpimath/src/main/native/include/wpi/math/controller/LTVUnicycleController.hpp b/wpimath/src/main/native/include/wpi/math/controller/LTVUnicycleController.hpp
index 4ce4965eef..5b13f0f31e 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/LTVUnicycleController.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/LTVUnicycleController.hpp
@@ -54,7 +54,8 @@ class WPILIB_DLLEXPORT LTVUnicycleController {
    * @param dt     Discretization timestep.
    */
   LTVUnicycleController(const wpi::util::array& Qelems,
-                        const wpi::util::array& Relems, wpi::units::second_t dt)
+                        const wpi::util::array& Relems,
+                        wpi::units::second_t dt)
       : m_Q{wpi::math::MakeCostMatrix(Qelems)},
         m_R{wpi::math::MakeCostMatrix(Relems)},
         m_dt{dt} {}
diff --git a/wpimath/src/main/native/include/wpi/math/controller/LinearPlantInversionFeedforward.hpp b/wpimath/src/main/native/include/wpi/math/controller/LinearPlantInversionFeedforward.hpp
index 2650e3dcbb..89bdf6731a 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/LinearPlantInversionFeedforward.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/LinearPlantInversionFeedforward.hpp
@@ -44,7 +44,8 @@ class LinearPlantInversionFeedforward {
    */
   template 
   LinearPlantInversionFeedforward(
-      const LinearSystem& plant, wpi::units::second_t dt)
+      const LinearSystem& plant,
+      wpi::units::second_t dt)
       : LinearPlantInversionFeedforward(plant.A(), plant.B(), dt) {}
 
   /**
diff --git a/wpimath/src/main/native/include/wpi/math/controller/LinearQuadraticRegulator.hpp b/wpimath/src/main/native/include/wpi/math/controller/LinearQuadraticRegulator.hpp
index 855760a648..1bb1a6185d 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/LinearQuadraticRegulator.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/LinearQuadraticRegulator.hpp
@@ -291,7 +291,8 @@ class LinearQuadraticRegulator {
    */
   template 
   void LatencyCompensate(const LinearSystem& plant,
-                         wpi::units::second_t dt, wpi::units::second_t inputDelay) {
+                         wpi::units::second_t dt,
+                         wpi::units::second_t inputDelay) {
     Matrixd discA;
     Matrixd discB;
     DiscretizeAB(plant.A(), plant.B(), dt, &discA, &discB);
diff --git a/wpimath/src/main/native/include/wpi/math/controller/ProfiledPIDController.hpp b/wpimath/src/main/native/include/wpi/math/controller/ProfiledPIDController.hpp
index 07ac7f41f7..bbe85d6e3f 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/ProfiledPIDController.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/ProfiledPIDController.hpp
@@ -34,10 +34,12 @@ class ProfiledPIDController
  public:
   using Distance_t = wpi::units::unit_t;
   using Velocity =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Velocity_t = wpi::units::unit_t;
   using Acceleration =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Acceleration_t = wpi::units::unit_t;
   using State = typename TrapezoidProfile::State;
   using Constraints = typename TrapezoidProfile::Constraints;
@@ -64,7 +66,8 @@ class ProfiledPIDController
       int instances = detail::IncrementAndGetProfiledPIDControllerInstances();
       wpi::math::MathSharedStore::ReportUsage("ProfiledPIDController",
                                               std::to_string(instances));
-      wpi::util::SendableRegistry::Add(this, "ProfiledPIDController", instances);
+      wpi::util::SendableRegistry::Add(this, "ProfiledPIDController",
+                                       instances);
     }
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/controller/SimpleMotorFeedforward.hpp b/wpimath/src/main/native/include/wpi/math/controller/SimpleMotorFeedforward.hpp
index 83fd827790..312e749b01 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/SimpleMotorFeedforward.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/SimpleMotorFeedforward.hpp
@@ -24,12 +24,15 @@ template 
 class SimpleMotorFeedforward {
  public:
   using Velocity =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Acceleration =
-      wpi::units::compound_unit>;
-  using kv_unit = wpi::units::compound_unit>;
-  using ka_unit =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
+  using kv_unit = wpi::units::compound_unit>;
+  using ka_unit = wpi::units::compound_unit>;
 
   /**
    * Creates a new SimpleMotorFeedforward with the specified gains.
@@ -75,7 +78,8 @@ class SimpleMotorFeedforward {
    * @param velocity The velocity setpoint.
    * @return The computed feedforward, in volts.
    */
-  constexpr wpi::units::volt_t Calculate(wpi::units::unit_t velocity) const {
+  constexpr wpi::units::volt_t Calculate(
+      wpi::units::unit_t velocity) const {
     return Calculate(velocity, velocity);
   }
 
@@ -158,7 +162,8 @@ class SimpleMotorFeedforward {
    * @return The maximum possible acceleration at the given velocity.
    */
   constexpr wpi::units::unit_t MaxAchievableAcceleration(
-      wpi::units::volt_t maxVoltage, wpi::units::unit_t velocity) const {
+      wpi::units::volt_t maxVoltage,
+      wpi::units::unit_t velocity) const {
     return (maxVoltage - kS * wpi::util::sgn(velocity) - kV * velocity) / kA;
   }
 
@@ -174,7 +179,8 @@ class SimpleMotorFeedforward {
    * @return The minimum possible acceleration at the given velocity.
    */
   constexpr wpi::units::unit_t MinAchievableAcceleration(
-      wpi::units::volt_t maxVoltage, wpi::units::unit_t velocity) const {
+      wpi::units::volt_t maxVoltage,
+      wpi::units::unit_t velocity) const {
     return MaxAchievableAcceleration(-maxVoltage, velocity);
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/controller/proto/ArmFeedforwardProto.hpp b/wpimath/src/main/native/include/wpi/math/controller/proto/ArmFeedforwardProto.hpp
index abf98630ac..eec01bdcdc 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/proto/ArmFeedforwardProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/proto/ArmFeedforwardProto.hpp
@@ -16,5 +16,6 @@ struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using InputStream = wpi::util::ProtoInputStream;
   using OutputStream = wpi::util::ProtoOutputStream;
   static std::optional Unpack(InputStream& stream);
-  static bool Pack(OutputStream& stream, const wpi::math::ArmFeedforward& value);
+  static bool Pack(OutputStream& stream,
+                   const wpi::math::ArmFeedforward& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveFeedforwardProto.hpp b/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveFeedforwardProto.hpp
index 575fdb13e5..9a5a21241a 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveFeedforwardProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveFeedforwardProto.hpp
@@ -11,9 +11,11 @@
 #include "wpimath/protobuf/controller.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufDifferentialDriveFeedforward;
-  using InputStream = wpi::util::ProtoInputStream;
+  using InputStream =
+      wpi::util::ProtoInputStream;
   using OutputStream =
       wpi::util::ProtoOutputStream;
   static std::optional Unpack(
diff --git a/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveWheelVoltagesProto.hpp b/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveWheelVoltagesProto.hpp
index 6b6308f448..7531fdef0b 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveWheelVoltagesProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/proto/DifferentialDriveWheelVoltagesProto.hpp
@@ -11,7 +11,8 @@
 #include "wpimath/protobuf/controller.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufDifferentialDriveWheelVoltages;
   using InputStream =
       wpi::util::ProtoInputStream;
diff --git a/wpimath/src/main/native/include/wpi/math/controller/proto/ElevatorFeedforwardProto.hpp b/wpimath/src/main/native/include/wpi/math/controller/proto/ElevatorFeedforwardProto.hpp
index a0a97da5e2..43c3329646 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/proto/ElevatorFeedforwardProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/proto/ElevatorFeedforwardProto.hpp
@@ -13,8 +13,12 @@
 template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufElevatorFeedforward;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
-  static bool Pack(OutputStream& stream, const wpi::math::ElevatorFeedforward& value);
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
+  static bool Pack(OutputStream& stream,
+                   const wpi::math::ElevatorFeedforward& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/controller/proto/SimpleMotorFeedforwardProto.hpp b/wpimath/src/main/native/include/wpi/math/controller/proto/SimpleMotorFeedforwardProto.hpp
index 1008e8cb5d..f6e1c1e7fb 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/proto/SimpleMotorFeedforwardProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/proto/SimpleMotorFeedforwardProto.hpp
@@ -26,7 +26,8 @@ struct wpi::util::Protobuf> {
   static std::optional> Unpack(
       InputStream& stream) {
     using BaseUnit =
-        wpi::units::unit, wpi::units::traits::base_unit_of>;
+        wpi::units::unit,
+                         wpi::units::traits::base_unit_of>;
     using BaseFeedforward = wpi::math::SimpleMotorFeedforward;
     wpi_proto_ProtobufSimpleMotorFeedforward msg;
     if (!stream.Decode(msg)) {
@@ -44,14 +45,17 @@ struct wpi::util::Protobuf> {
   static bool Pack(OutputStream& stream,
                    const wpi::math::SimpleMotorFeedforward& value) {
     using BaseUnit =
-        wpi::units::unit, wpi::units::traits::base_unit_of>;
+        wpi::units::unit,
+                         wpi::units::traits::base_unit_of>;
     using BaseFeedforward = wpi::math::SimpleMotorFeedforward;
     wpi_proto_ProtobufSimpleMotorFeedforward msg{
         .ks = value.GetKs().value(),
-        .kv = wpi::units::unit_t{value.GetKv()}
-                  .value(),
-        .ka = wpi::units::unit_t{value.GetKa()}
-                  .value(),
+        .kv =
+            wpi::units::unit_t{value.GetKv()}
+                .value(),
+        .ka =
+            wpi::units::unit_t{value.GetKa()}
+                .value(),
         .dt = wpi::units::second_t{value.GetDt()}.value(),
     };
     return stream.Encode(msg);
diff --git a/wpimath/src/main/native/include/wpi/math/controller/struct/ArmFeedforwardStruct.hpp b/wpimath/src/main/native/include/wpi/math/controller/struct/ArmFeedforwardStruct.hpp
index b107258299..850b95ff79 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/struct/ArmFeedforwardStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/struct/ArmFeedforwardStruct.hpp
@@ -17,7 +17,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   }
 
   static wpi::math::ArmFeedforward Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::ArmFeedforward& value);
+  static void Pack(std::span data,
+                   const wpi::math::ArmFeedforward& value);
 };
 
 static_assert(wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveFeedforwardStruct.hpp b/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveFeedforwardStruct.hpp
index 5302dfe68d..42b23e5b7d 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveFeedforwardStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveFeedforwardStruct.hpp
@@ -9,7 +9,8 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Struct {
+struct WPILIB_DLLEXPORT
+    wpi::util::Struct {
   static constexpr std::string_view GetTypeName() {
     return "DifferentialDriveFeedforward";
   }
@@ -25,4 +26,5 @@ struct WPILIB_DLLEXPORT wpi::util::Struct);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveWheelVoltagesStruct.hpp b/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveWheelVoltagesStruct.hpp
index 80f0484964..c70a77b31c 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveWheelVoltagesStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/struct/DifferentialDriveWheelVoltagesStruct.hpp
@@ -9,7 +9,8 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Struct {
+struct WPILIB_DLLEXPORT
+    wpi::util::Struct {
   static constexpr std::string_view GetTypeName() {
     return "DifferentialDriveWheelVoltages";
   }
@@ -24,4 +25,5 @@ struct WPILIB_DLLEXPORT wpi::util::Struct);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/controller/struct/SimpleMotorFeedforwardStruct.hpp b/wpimath/src/main/native/include/wpi/math/controller/struct/SimpleMotorFeedforwardStruct.hpp
index 4e7898159b..c43e0300cc 100644
--- a/wpimath/src/main/native/include/wpi/math/controller/struct/SimpleMotorFeedforwardStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/controller/struct/SimpleMotorFeedforwardStruct.hpp
@@ -26,24 +26,27 @@ struct wpi::util::Struct> {
   static wpi::math::SimpleMotorFeedforward Unpack(
       std::span data) {
     using BaseUnit =
-        wpi::units::unit, wpi::units::traits::base_unit_of>;
+        wpi::units::unit,
+                         wpi::units::traits::base_unit_of>;
     using BaseFeedforward = wpi::math::SimpleMotorFeedforward;
     constexpr size_t kKsOff = 0;
     constexpr size_t kKvOff = kKsOff + 8;
     constexpr size_t kKaOff = kKvOff + 8;
     constexpr size_t kDtOff = kKaOff + 8;
-    return {wpi::units::volt_t{wpi::util::UnpackStruct(data)},
-            wpi::units::unit_t{
-                wpi::util::UnpackStruct(data)},
-            wpi::units::unit_t{
-                wpi::util::UnpackStruct(data)},
-            wpi::units::second_t{wpi::util::UnpackStruct(data)}};
+    return {
+        wpi::units::volt_t{wpi::util::UnpackStruct(data)},
+        wpi::units::unit_t{
+            wpi::util::UnpackStruct(data)},
+        wpi::units::unit_t{
+            wpi::util::UnpackStruct(data)},
+        wpi::units::second_t{wpi::util::UnpackStruct(data)}};
   }
 
   static void Pack(std::span data,
                    const wpi::math::SimpleMotorFeedforward& value) {
     using BaseUnit =
-        wpi::units::unit, wpi::units::traits::base_unit_of>;
+        wpi::units::unit,
+                         wpi::units::traits::base_unit_of>;
     using BaseFeedforward = wpi::math::SimpleMotorFeedforward;
     constexpr size_t kKsOff = 0;
     constexpr size_t kKvOff = kKsOff + 8;
@@ -51,18 +54,21 @@ struct wpi::util::Struct> {
     constexpr size_t kDtOff = kKaOff + 8;
     wpi::util::PackStruct(data, value.GetKs().value());
     wpi::util::PackStruct(
-        data, wpi::units::unit_t{value.GetKv()}
-                  .value());
+        data,
+        wpi::units::unit_t{value.GetKv()}
+            .value());
     wpi::util::PackStruct(
-        data, wpi::units::unit_t{value.GetKa()}
-                  .value());
-    wpi::util::PackStruct(data, wpi::units::second_t{value.GetDt()}.value());
+        data,
+        wpi::units::unit_t{value.GetKa()}
+            .value());
+    wpi::util::PackStruct(data,
+                                  wpi::units::second_t{value.GetDt()}.value());
   }
 };
 
-static_assert(
-    wpi::util::StructSerializable>);
-static_assert(
-    wpi::util::StructSerializable>);
-static_assert(
-    wpi::util::StructSerializable>);
+static_assert(wpi::util::StructSerializable<
+              wpi::math::SimpleMotorFeedforward>);
+static_assert(wpi::util::StructSerializable<
+              wpi::math::SimpleMotorFeedforward>);
+static_assert(wpi::util::StructSerializable<
+              wpi::math::SimpleMotorFeedforward>);
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator.hpp b/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator.hpp
index d59a144471..4cb460f44c 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator.hpp
@@ -75,7 +75,8 @@ class WPILIB_DLLEXPORT DifferentialDrivePoseEstimator
   DifferentialDrivePoseEstimator(
       DifferentialDriveKinematics& kinematics, const Rotation2d& gyroAngle,
       wpi::units::meter_t leftDistance, wpi::units::meter_t rightDistance,
-      const Pose2d& initialPose, const wpi::util::array& stateStdDevs,
+      const Pose2d& initialPose,
+      const wpi::util::array& stateStdDevs,
       const wpi::util::array& visionMeasurementStdDevs);
 
   /**
@@ -86,7 +87,8 @@ class WPILIB_DLLEXPORT DifferentialDrivePoseEstimator
    * @param rightDistance The distance traveled by the right encoder.
    * @param pose The estimated pose of the robot on the field.
    */
-  void ResetPosition(const Rotation2d& gyroAngle, wpi::units::meter_t leftDistance,
+  void ResetPosition(const Rotation2d& gyroAngle,
+                     wpi::units::meter_t leftDistance,
                      wpi::units::meter_t rightDistance, const Pose2d& pose) {
     PoseEstimator::ResetPosition(gyroAngle, {leftDistance, rightDistance},
                                  pose);
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp b/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp
index 07a1857983..5c626cd240 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/DifferentialDrivePoseEstimator3d.hpp
@@ -80,7 +80,8 @@ class WPILIB_DLLEXPORT DifferentialDrivePoseEstimator3d
   DifferentialDrivePoseEstimator3d(
       DifferentialDriveKinematics& kinematics, const Rotation3d& gyroAngle,
       wpi::units::meter_t leftDistance, wpi::units::meter_t rightDistance,
-      const Pose3d& initialPose, const wpi::util::array& stateStdDevs,
+      const Pose3d& initialPose,
+      const wpi::util::array& stateStdDevs,
       const wpi::util::array& visionMeasurementStdDevs);
 
   /**
@@ -91,7 +92,8 @@ class WPILIB_DLLEXPORT DifferentialDrivePoseEstimator3d
    * @param rightDistance The distance traveled by the right encoder.
    * @param pose The estimated pose of the robot on the field.
    */
-  void ResetPosition(const Rotation3d& gyroAngle, wpi::units::meter_t leftDistance,
+  void ResetPosition(const Rotation3d& gyroAngle,
+                     wpi::units::meter_t leftDistance,
                      wpi::units::meter_t rightDistance, const Pose3d& pose) {
     PoseEstimator3d::ResetPosition(gyroAngle, {leftDistance, rightDistance},
                                    pose);
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/KalmanFilterLatencyCompensator.hpp b/wpimath/src/main/native/include/wpi/math/estimator/KalmanFilterLatencyCompensator.hpp
index dc0dc4052e..01a56ca8ee 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/KalmanFilterLatencyCompensator.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/KalmanFilterLatencyCompensator.hpp
@@ -62,7 +62,8 @@ class KalmanFilterLatencyCompensator {
    * @param timestamp The timestamp of the state.
    */
   void AddObserverState(const KalmanFilterType& observer, Vectord u,
-                        Vectord localY, wpi::units::second_t timestamp) {
+                        Vectord localY,
+                        wpi::units::second_t timestamp) {
     // Add the new state into the vector.
     m_pastObserverSnapshots.emplace_back(timestamp,
                                          ObserverSnapshot{observer, u, localY});
@@ -86,7 +87,8 @@ class KalmanFilterLatencyCompensator {
    */
   template 
   void ApplyPastGlobalMeasurement(
-      KalmanFilterType* observer, wpi::units::second_t nominalDt, Vectord y,
+      KalmanFilterType* observer, wpi::units::second_t nominalDt,
+      Vectord y,
       std::function& u, const Vectord& y)>
           globalMeasurementCorrect,
       wpi::units::second_t timestamp) {
@@ -130,10 +132,10 @@ class KalmanFilterLatencyCompensator {
       int prevIdx = nextIdx - 1;
 
       // Find the snapshot closest in time to global measurement
-      wpi::units::second_t prevTimeDiff =
-          wpi::units::math::abs(timestamp - m_pastObserverSnapshots[prevIdx].first);
-      wpi::units::second_t nextTimeDiff =
-          wpi::units::math::abs(timestamp - m_pastObserverSnapshots[nextIdx].first);
+      wpi::units::second_t prevTimeDiff = wpi::units::math::abs(
+          timestamp - m_pastObserverSnapshots[prevIdx].first);
+      wpi::units::second_t nextTimeDiff = wpi::units::math::abs(
+          timestamp - m_pastObserverSnapshots[nextIdx].first);
       indexOfClosestEntry = prevTimeDiff < nextTimeDiff ? prevIdx : nextIdx;
     }
 
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator.hpp b/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator.hpp
index ce390e8178..41c2003540 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator.hpp
@@ -74,7 +74,8 @@ class WPILIB_DLLEXPORT MecanumDrivePoseEstimator
   MecanumDrivePoseEstimator(
       MecanumDriveKinematics& kinematics, const Rotation2d& gyroAngle,
       const MecanumDriveWheelPositions& wheelPositions,
-      const Pose2d& initialPose, const wpi::util::array& stateStdDevs,
+      const Pose2d& initialPose,
+      const wpi::util::array& stateStdDevs,
       const wpi::util::array& visionMeasurementStdDevs);
 
  private:
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp b/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp
index d44db79225..9dc0bdc9b3 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/MecanumDrivePoseEstimator3d.hpp
@@ -79,7 +79,8 @@ class WPILIB_DLLEXPORT MecanumDrivePoseEstimator3d
   MecanumDrivePoseEstimator3d(
       MecanumDriveKinematics& kinematics, const Rotation3d& gyroAngle,
       const MecanumDriveWheelPositions& wheelPositions,
-      const Pose3d& initialPose, const wpi::util::array& stateStdDevs,
+      const Pose3d& initialPose,
+      const wpi::util::array& stateStdDevs,
       const wpi::util::array& visionMeasurementStdDevs);
 
  private:
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/PoseEstimator3d.hpp b/wpimath/src/main/native/include/wpi/math/estimator/PoseEstimator3d.hpp
index 2d19ba821f..1c6dc8ac35 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/PoseEstimator3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/PoseEstimator3d.hpp
@@ -279,14 +279,16 @@ class WPILIB_DLLEXPORT PoseEstimator3d {
     // measurements compared to our current pose.
     wpi::math::Vectord<6> k_times_twist =
         m_visionK * wpi::math::Vectord<6>{twist.dx.value(), twist.dy.value(),
-                                    twist.dz.value(), twist.rx.value(),
-                                    twist.ry.value(), twist.rz.value()};
+                                          twist.dz.value(), twist.rx.value(),
+                                          twist.ry.value(), twist.rz.value()};
 
     // Step 6: Convert back to Twist3d.
-    Twist3d scaledTwist{
-        wpi::units::meter_t{k_times_twist(0)},  wpi::units::meter_t{k_times_twist(1)},
-        wpi::units::meter_t{k_times_twist(2)},  wpi::units::radian_t{k_times_twist(3)},
-        wpi::units::radian_t{k_times_twist(4)}, wpi::units::radian_t{k_times_twist(5)}};
+    Twist3d scaledTwist{wpi::units::meter_t{k_times_twist(0)},
+                        wpi::units::meter_t{k_times_twist(1)},
+                        wpi::units::meter_t{k_times_twist(2)},
+                        wpi::units::radian_t{k_times_twist(3)},
+                        wpi::units::radian_t{k_times_twist(4)},
+                        wpi::units::radian_t{k_times_twist(5)}};
 
     // Step 7: Calculate and record the vision update.
     VisionUpdate visionUpdate{visionSample.value() + scaledTwist.Exp(),
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator.hpp b/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator.hpp
index 0ef9557a44..249fe39248 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator.hpp
@@ -79,7 +79,8 @@ class SwerveDrivePoseEstimator
       SwerveDriveKinematics& kinematics,
       const Rotation2d& gyroAngle,
       const wpi::util::array& modulePositions,
-      const Pose2d& initialPose, const wpi::util::array& stateStdDevs,
+      const Pose2d& initialPose,
+      const wpi::util::array& stateStdDevs,
       const wpi::util::array& visionMeasurementStdDevs)
       : SwerveDrivePoseEstimator::PoseEstimator(
             kinematics, m_odometryImpl, stateStdDevs, visionMeasurementStdDevs),
diff --git a/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp b/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp
index 9cdba71d31..b39e1580a1 100644
--- a/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/estimator/SwerveDrivePoseEstimator3d.hpp
@@ -34,8 +34,9 @@ namespace wpi::math {
  */
 template 
 class SwerveDrivePoseEstimator3d
-    : public PoseEstimator3d,
-                             wpi::util::array> {
+    : public PoseEstimator3d<
+          wpi::util::array,
+          wpi::util::array> {
  public:
   /**
    * Constructs a SwerveDrivePoseEstimator3d with default standard deviations
@@ -85,7 +86,8 @@ class SwerveDrivePoseEstimator3d
       SwerveDriveKinematics& kinematics,
       const Rotation3d& gyroAngle,
       const wpi::util::array& modulePositions,
-      const Pose3d& initialPose, const wpi::util::array& stateStdDevs,
+      const Pose3d& initialPose,
+      const wpi::util::array& stateStdDevs,
       const wpi::util::array& visionMeasurementStdDevs)
       : SwerveDrivePoseEstimator3d::PoseEstimator3d(
             kinematics, m_odometryImpl, stateStdDevs, visionMeasurementStdDevs),
diff --git a/wpimath/src/main/native/include/wpi/math/filter/Debouncer.hpp b/wpimath/src/main/native/include/wpi/math/filter/Debouncer.hpp
index 3972d25507..70978055f9 100644
--- a/wpimath/src/main/native/include/wpi/math/filter/Debouncer.hpp
+++ b/wpimath/src/main/native/include/wpi/math/filter/Debouncer.hpp
@@ -63,7 +63,9 @@ class WPILIB_DLLEXPORT Debouncer {
    * @return The number of seconds the value must change from baseline
    *             for the filtered value to change.
    */
-  constexpr wpi::units::second_t GetDebounceTime() const { return m_debounceTime; }
+  constexpr wpi::units::second_t GetDebounceTime() const {
+    return m_debounceTime;
+  }
 
   /**
    * Set the debounce type.
diff --git a/wpimath/src/main/native/include/wpi/math/filter/LinearFilter.hpp b/wpimath/src/main/native/include/wpi/math/filter/LinearFilter.hpp
index 3d47e12c4d..f1b4d3107d 100644
--- a/wpimath/src/main/native/include/wpi/math/filter/LinearFilter.hpp
+++ b/wpimath/src/main/native/include/wpi/math/filter/LinearFilter.hpp
@@ -191,7 +191,8 @@ class LinearFilter {
    */
   template 
   static LinearFilter FiniteDifference(
-      const wpi::util::array& stencil, wpi::units::second_t period) {
+      const wpi::util::array& stencil,
+      wpi::units::second_t period) {
     // See
     // https://en.wikipedia.org/wiki/Finite_difference_coefficient#Arbitrary_stencil_points
     //
diff --git a/wpimath/src/main/native/include/wpi/math/filter/SlewRateLimiter.hpp b/wpimath/src/main/native/include/wpi/math/filter/SlewRateLimiter.hpp
index 37c8320768..abe1017fd5 100644
--- a/wpimath/src/main/native/include/wpi/math/filter/SlewRateLimiter.hpp
+++ b/wpimath/src/main/native/include/wpi/math/filter/SlewRateLimiter.hpp
@@ -24,7 +24,8 @@ template 
 class SlewRateLimiter {
  public:
   using Unit_t = wpi::units::unit_t;
-  using Rate = wpi::units::compound_unit>;
+  using Rate =
+      wpi::units::compound_unit>;
   using Rate_t = wpi::units::unit_t;
 
   /**
@@ -44,8 +45,8 @@ class SlewRateLimiter {
       : m_positiveRateLimit{positiveRateLimit},
         m_negativeRateLimit{negativeRateLimit},
         m_prevVal{initialValue},
-        m_prevTime{
-            wpi::units::microsecond_t{wpi::math::MathSharedStore::GetTimestamp()}} {}
+        m_prevTime{wpi::units::microsecond_t{
+            wpi::math::MathSharedStore::GetTimestamp()}} {}
 
   /**
    * Creates a new SlewRateLimiter with the given positive rate limit and
@@ -64,7 +65,8 @@ class SlewRateLimiter {
    * rate.
    */
   Unit_t Calculate(Unit_t input) {
-    wpi::units::second_t currentTime = wpi::math::MathSharedStore::GetTimestamp();
+    wpi::units::second_t currentTime =
+        wpi::math::MathSharedStore::GetTimestamp();
     wpi::units::second_t elapsedTime = currentTime - m_prevTime;
     m_prevVal +=
         std::clamp(input - m_prevVal, m_negativeRateLimit * elapsedTime,
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp
index 0d506e20a1..2e607d98ec 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Pose2d.hpp
@@ -49,7 +49,8 @@ class WPILIB_DLLEXPORT Pose2d {
    * @param y The y component of the translational component of the pose.
    * @param rotation The rotational component of the pose.
    */
-  constexpr Pose2d(wpi::units::meter_t x, wpi::units::meter_t y, Rotation2d rotation)
+  constexpr Pose2d(wpi::units::meter_t x, wpi::units::meter_t y,
+                   Rotation2d rotation)
       : m_translation{x, y}, m_rotation{std::move(rotation)} {}
 
   /**
@@ -284,7 +285,8 @@ constexpr Transform2d Pose2d::operator-(const Pose2d& other) const {
   return Transform2d{pose.Translation(), pose.Rotation()};
 }
 
-constexpr Pose2d Pose2d::TransformBy(const wpi::math::Transform2d& other) const {
+constexpr Pose2d Pose2d::TransformBy(
+    const wpi::math::Transform2d& other) const {
   return {m_translation + (other.Translation().RotateBy(m_rotation)),
           other.Rotation() + m_rotation};
 }
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp
index e66b047142..9fbd29fda4 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Pose3d.hpp
@@ -53,8 +53,8 @@ class WPILIB_DLLEXPORT Pose3d {
    * @param z The z component of the translational component of the pose.
    * @param rotation The rotational component of the pose.
    */
-  constexpr Pose3d(wpi::units::meter_t x, wpi::units::meter_t y, wpi::units::meter_t z,
-                   Rotation3d rotation)
+  constexpr Pose3d(wpi::units::meter_t x, wpi::units::meter_t y,
+                   wpi::units::meter_t z, Rotation3d rotation)
       : m_translation{x, y, z}, m_rotation{std::move(rotation)} {}
 
   /**
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Rectangle2d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Rectangle2d.hpp
index a13d0b87ac..7b45de1a30 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Rectangle2d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Rectangle2d.hpp
@@ -114,12 +114,12 @@ class WPILIB_DLLEXPORT Rectangle2d {
     auto pointInRect = point - m_center.Translation();
     pointInRect = pointInRect.RotateBy(-m_center.Rotation());
 
-    if (wpi::units::math::abs(wpi::units::math::abs(pointInRect.X()) - m_xWidth / 2.0) <=
-        1E-9_m) {
+    if (wpi::units::math::abs(wpi::units::math::abs(pointInRect.X()) -
+                              m_xWidth / 2.0) <= 1E-9_m) {
       // Point rests on left/right perimeter
       return wpi::units::math::abs(pointInRect.Y()) <= m_yWidth / 2.0;
     } else if (wpi::units::math::abs(wpi::units::math::abs(pointInRect.Y()) -
-                                m_yWidth / 2.0) <= 1E-9_m) {
+                                     m_yWidth / 2.0) <= 1E-9_m) {
       // Point rests on top/bottom perimeter
       return wpi::units::math::abs(pointInRect.X()) <= m_xWidth / 2.0;
     }
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Rotation2d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Rotation2d.hpp
index 0980ff2f24..d4897bc93d 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Rotation2d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Rotation2d.hpp
@@ -37,7 +37,8 @@ class WPILIB_DLLEXPORT Rotation2d {
    */
   constexpr Rotation2d(wpi::units::angle_unit auto value)  // NOLINT
       : m_cos{gcem::cos(value.template convert().value())},
-        m_sin{gcem::sin(value.template convert().value())} {}
+        m_sin{gcem::sin(value.template convert().value())} {
+  }
 
   /**
    * Constructs a Rotation2d with the given x and y (cosine and sine)
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Rotation3d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Rotation3d.hpp
index 2ad0e70f9d..70b71b68ad 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Rotation3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Rotation3d.hpp
@@ -77,7 +77,8 @@ class WPILIB_DLLEXPORT Rotation3d {
    * @param axis The rotation axis.
    * @param angle The rotation around the axis.
    */
-  constexpr Rotation3d(const Eigen::Vector3d& axis, wpi::units::radian_t angle) {
+  constexpr Rotation3d(const Eigen::Vector3d& axis,
+                       wpi::units::radian_t angle) {
     double norm = ct_matrix{axis}.norm();
     if (norm == 0.0) {
       return;
@@ -281,11 +282,13 @@ class WPILIB_DLLEXPORT Rotation3d {
   constexpr Rotation3d operator*(double scalar) const {
     // https://en.wikipedia.org/wiki/Slerp#Quaternion_Slerp
     if (m_q.W() >= 0.0) {
-      return Rotation3d{Eigen::Vector3d{{m_q.X(), m_q.Y(), m_q.Z()}},
-                        2.0 * wpi::units::radian_t{scalar * gcem::acos(m_q.W())}};
+      return Rotation3d{
+          Eigen::Vector3d{{m_q.X(), m_q.Y(), m_q.Z()}},
+          2.0 * wpi::units::radian_t{scalar * gcem::acos(m_q.W())}};
     } else {
-      return Rotation3d{Eigen::Vector3d{{-m_q.X(), -m_q.Y(), -m_q.Z()}},
-                        2.0 * wpi::units::radian_t{scalar * gcem::acos(-m_q.W())}};
+      return Rotation3d{
+          Eigen::Vector3d{{-m_q.X(), -m_q.Y(), -m_q.Z()}},
+          2.0 * wpi::units::radian_t{scalar * gcem::acos(-m_q.W())}};
     }
   }
 
@@ -360,7 +363,8 @@ class WPILIB_DLLEXPORT Rotation3d {
     // https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles#Quaternion_to_Euler_angles_(in_3-2-1_sequence)_conversion
     double ratio = 2.0 * (w * y - z * x);
     if (gcem::abs(ratio) >= 1.0) {
-      return wpi::units::radian_t{gcem::copysign(std::numbers::pi / 2.0, ratio)};
+      return wpi::units::radian_t{
+          gcem::copysign(std::numbers::pi / 2.0, ratio)};
     } else {
       return wpi::units::radian_t{gcem::asin(ratio)};
     }
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Transform2d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Transform2d.hpp
index 685ce95260..5c6be18b03 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Transform2d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Transform2d.hpp
@@ -46,7 +46,8 @@ class WPILIB_DLLEXPORT Transform2d {
    * @param y The y component of the translational component of the transform.
    * @param rotation The rotational component of the transform.
    */
-  constexpr Transform2d(wpi::units::meter_t x, wpi::units::meter_t y, Rotation2d rotation)
+  constexpr Transform2d(wpi::units::meter_t x, wpi::units::meter_t y,
+                        Rotation2d rotation)
       : m_translation{x, y}, m_rotation{std::move(rotation)} {}
 
   /**
@@ -207,7 +208,8 @@ constexpr Twist2d Transform2d::Log() const {
       m_translation.RotateBy({halfThetaByTanOfHalfDtheta, -halfDtheta}) *
       gcem::hypot(halfThetaByTanOfHalfDtheta, halfDtheta);
 
-  return {translationPart.X(), translationPart.Y(), wpi::units::radian_t{dtheta}};
+  return {translationPart.X(), translationPart.Y(),
+          wpi::units::radian_t{dtheta}};
 }
 
 }  // namespace wpi::math
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp
index cbdc0f492c..f88a032d1e 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Transform3d.hpp
@@ -47,8 +47,8 @@ class WPILIB_DLLEXPORT Transform3d {
    * @param z The z component of the translational component of the transform.
    * @param rotation The rotational component of the transform.
    */
-  constexpr Transform3d(wpi::units::meter_t x, wpi::units::meter_t y, wpi::units::meter_t z,
-                        Rotation3d rotation)
+  constexpr Transform3d(wpi::units::meter_t x, wpi::units::meter_t y,
+                        wpi::units::meter_t z, Rotation3d rotation)
       : m_translation{x, y, z}, m_rotation{std::move(rotation)} {}
 
   /**
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Translation2d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Translation2d.hpp
index dcaa62ca90..1fd26d71a7 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Translation2d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Translation2d.hpp
@@ -61,7 +61,8 @@ class WPILIB_DLLEXPORT Translation2d {
    * @param vector The translation vector.
    */
   constexpr explicit Translation2d(const Eigen::Vector2d& vector)
-      : m_x{wpi::units::meter_t{vector.x()}}, m_y{wpi::units::meter_t{vector.y()}} {}
+      : m_x{wpi::units::meter_t{vector.x()}},
+        m_y{wpi::units::meter_t{vector.y()}} {}
 
   /**
    * Calculates the distance between two translations in 2D space.
@@ -121,7 +122,9 @@ class WPILIB_DLLEXPORT Translation2d {
    *
    * @return The norm of the translation.
    */
-  constexpr wpi::units::meter_t Norm() const { return wpi::units::math::hypot(m_x, m_y); }
+  constexpr wpi::units::meter_t Norm() const {
+    return wpi::units::math::hypot(m_x, m_y);
+  }
 
   /**
    * Returns the squared norm, or squared distance from the origin to the
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/Translation3d.hpp b/wpimath/src/main/native/include/wpi/math/geometry/Translation3d.hpp
index 2f2d80261a..b44cbf3b60 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/Translation3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/Translation3d.hpp
@@ -43,7 +43,8 @@ class WPILIB_DLLEXPORT Translation3d {
    * @param y The y component of the translation.
    * @param z The z component of the translation.
    */
-  constexpr Translation3d(wpi::units::meter_t x, wpi::units::meter_t y, wpi::units::meter_t z)
+  constexpr Translation3d(wpi::units::meter_t x, wpi::units::meter_t y,
+                          wpi::units::meter_t z)
       : m_x{x}, m_y{y}, m_z{z} {}
 
   /**
@@ -53,7 +54,8 @@ class WPILIB_DLLEXPORT Translation3d {
    * @param distance The distance from the origin to the end of the translation.
    * @param angle The angle between the x-axis and the translation vector.
    */
-  constexpr Translation3d(wpi::units::meter_t distance, const Rotation3d& angle) {
+  constexpr Translation3d(wpi::units::meter_t distance,
+                          const Rotation3d& angle) {
     auto rectangular = Translation3d{distance, 0_m, 0_m}.RotateBy(angle);
     m_x = rectangular.X();
     m_y = rectangular.Y();
@@ -93,8 +95,8 @@ class WPILIB_DLLEXPORT Translation3d {
    */
   constexpr wpi::units::meter_t Distance(const Translation3d& other) const {
     return wpi::units::math::sqrt(wpi::units::math::pow<2>(other.m_x - m_x) +
-                             wpi::units::math::pow<2>(other.m_y - m_y) +
-                             wpi::units::math::pow<2>(other.m_z - m_z));
+                                  wpi::units::math::pow<2>(other.m_y - m_y) +
+                                  wpi::units::math::pow<2>(other.m_z - m_z));
   }
 
   /**
@@ -178,7 +180,8 @@ class WPILIB_DLLEXPORT Translation3d {
   constexpr Translation3d RotateBy(const Rotation3d& other) const {
     Quaternion p{0.0, m_x.value(), m_y.value(), m_z.value()};
     auto qprime = other.GetQuaternion() * p * other.GetQuaternion().Inverse();
-    return Translation3d{wpi::units::meter_t{qprime.X()}, wpi::units::meter_t{qprime.Y()},
+    return Translation3d{wpi::units::meter_t{qprime.X()},
+                         wpi::units::meter_t{qprime.Y()},
                          wpi::units::meter_t{qprime.Z()}};
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/struct/Rectangle2dStruct.hpp b/wpimath/src/main/native/include/wpi/math/geometry/struct/Rectangle2dStruct.hpp
index b0d2cbf56f..762f5f591b 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/struct/Rectangle2dStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/struct/Rectangle2dStruct.hpp
@@ -19,7 +19,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   }
 
   static wpi::math::Rectangle2d Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::Rectangle2d& value);
+  static void Pack(std::span data,
+                   const wpi::math::Rectangle2d& value);
   static void ForEachNested(
       std::invocable auto fn) {
     wpi::util::ForEachStructSchema(fn);
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform2dStruct.hpp b/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform2dStruct.hpp
index 37d2137fbc..47a7366c38 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform2dStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform2dStruct.hpp
@@ -20,7 +20,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   }
 
   static wpi::math::Transform2d Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::Transform2d& value);
+  static void Pack(std::span data,
+                   const wpi::math::Transform2d& value);
   static void ForEachNested(
       std::invocable auto fn) {
     wpi::util::ForEachStructSchema(fn);
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform3dStruct.hpp b/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform3dStruct.hpp
index 36042cb1e4..f631320eb2 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform3dStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/struct/Transform3dStruct.hpp
@@ -20,7 +20,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   }
 
   static wpi::math::Transform3d Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::Transform3d& value);
+  static void Pack(std::span data,
+                   const wpi::math::Transform3d& value);
   static void ForEachNested(
       std::invocable auto fn) {
     wpi::util::ForEachStructSchema(fn);
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation2dStruct.hpp b/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation2dStruct.hpp
index 48d4b3029b..a75e314a48 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation2dStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation2dStruct.hpp
@@ -15,7 +15,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   static constexpr std::string_view GetSchema() { return "double x;double y"; }
 
   static wpi::math::Translation2d Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::Translation2d& value);
+  static void Pack(std::span data,
+                   const wpi::math::Translation2d& value);
 };
 
 static_assert(wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation3dStruct.hpp b/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation3dStruct.hpp
index 3088182e2c..7a66fad048 100644
--- a/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation3dStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/geometry/struct/Translation3dStruct.hpp
@@ -17,7 +17,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   }
 
   static wpi::math::Translation3d Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::Translation3d& value);
+  static void Pack(std::span data,
+                   const wpi::math::Translation3d& value);
 };
 
 static_assert(wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/interpolation/TimeInterpolatableBuffer.hpp b/wpimath/src/main/native/include/wpi/math/interpolation/TimeInterpolatableBuffer.hpp
index 4716a3461e..bb6f328b30 100644
--- a/wpimath/src/main/native/include/wpi/math/interpolation/TimeInterpolatableBuffer.hpp
+++ b/wpimath/src/main/native/include/wpi/math/interpolation/TimeInterpolatableBuffer.hpp
@@ -44,7 +44,8 @@ class TimeInterpolatableBuffer {
 
   /**
    * Create a new TimeInterpolatableBuffer. By default, the interpolation
-   * function is wpi::util::Lerp except for Pose2d, which uses the pose exponential.
+   * function is wpi::util::Lerp except for Pose2d, which uses the pose
+   * exponential.
    *
    * @param historySize  The history size of the buffer.
    */
@@ -144,7 +145,8 @@ class TimeInterpolatableBuffer {
   /**
    * Grant access to the internal sample buffer.
    */
-  const std::vector>& GetInternalBuffer() const {
+  const std::vector>& GetInternalBuffer()
+      const {
     return m_pastSnapshots;
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/ChassisSpeeds.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/ChassisSpeeds.hpp
index 05044ea8ee..607c473513 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/ChassisSpeeds.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/ChassisSpeeds.hpp
@@ -93,9 +93,9 @@ struct WPILIB_DLLEXPORT ChassisSpeeds {
    */
   constexpr ChassisSpeeds ToRobotRelative(const Rotation2d& robotAngle) const {
     // CW rotation into chassis frame
-    auto rotated =
-        Translation2d{wpi::units::meter_t{vx.value()}, wpi::units::meter_t{vy.value()}}
-            .RotateBy(-robotAngle);
+    auto rotated = Translation2d{wpi::units::meter_t{vx.value()},
+                                 wpi::units::meter_t{vy.value()}}
+                       .RotateBy(-robotAngle);
     return {wpi::units::meters_per_second_t{rotated.X().value()},
             wpi::units::meters_per_second_t{rotated.Y().value()}, omega};
   }
@@ -113,9 +113,9 @@ struct WPILIB_DLLEXPORT ChassisSpeeds {
    */
   constexpr ChassisSpeeds ToFieldRelative(const Rotation2d& robotAngle) const {
     // CCW rotation out of chassis frame
-    auto rotated =
-        Translation2d{wpi::units::meter_t{vx.value()}, wpi::units::meter_t{vy.value()}}
-            .RotateBy(robotAngle);
+    auto rotated = Translation2d{wpi::units::meter_t{vx.value()},
+                                 wpi::units::meter_t{vy.value()}}
+                       .RotateBy(robotAngle);
     return {wpi::units::meters_per_second_t{rotated.X().value()},
             wpi::units::meters_per_second_t{rotated.Y().value()}, omega};
   }
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry.hpp
index 94f695a477..dc2766b371 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry.hpp
@@ -59,7 +59,8 @@ class WPILIB_DLLEXPORT DifferentialDriveOdometry
    * @param leftDistance The distance traveled by the left encoder.
    * @param rightDistance The distance traveled by the right encoder.
    */
-  void ResetPosition(const Rotation2d& gyroAngle, wpi::units::meter_t leftDistance,
+  void ResetPosition(const Rotation2d& gyroAngle,
+                     wpi::units::meter_t leftDistance,
                      wpi::units::meter_t rightDistance, const Pose2d& pose) {
     Odometry::ResetPosition(gyroAngle, {leftDistance, rightDistance}, pose);
   }
@@ -75,7 +76,8 @@ class WPILIB_DLLEXPORT DifferentialDriveOdometry
    * @param rightDistance The distance traveled by the right encoder.
    * @return The new pose of the robot.
    */
-  const Pose2d& Update(const Rotation2d& gyroAngle, wpi::units::meter_t leftDistance,
+  const Pose2d& Update(const Rotation2d& gyroAngle,
+                       wpi::units::meter_t leftDistance,
                        wpi::units::meter_t rightDistance) {
     return Odometry::Update(gyroAngle, {leftDistance, rightDistance});
   }
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry3d.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry3d.hpp
index 70c1f7a5d0..d85e27a7ce 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry3d.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveOdometry3d.hpp
@@ -59,7 +59,8 @@ class WPILIB_DLLEXPORT DifferentialDriveOdometry3d
    * @param leftDistance The distance traveled by the left encoder.
    * @param rightDistance The distance traveled by the right encoder.
    */
-  void ResetPosition(const Rotation3d& gyroAngle, wpi::units::meter_t leftDistance,
+  void ResetPosition(const Rotation3d& gyroAngle,
+                     wpi::units::meter_t leftDistance,
                      wpi::units::meter_t rightDistance, const Pose3d& pose) {
     Odometry3d::ResetPosition(gyroAngle, {leftDistance, rightDistance}, pose);
   }
@@ -75,7 +76,8 @@ class WPILIB_DLLEXPORT DifferentialDriveOdometry3d
    * @param rightDistance The distance traveled by the right encoder.
    * @return The new pose of the robot.
    */
-  const Pose3d& Update(const Rotation3d& gyroAngle, wpi::units::meter_t leftDistance,
+  const Pose3d& Update(const Rotation3d& gyroAngle,
+                       wpi::units::meter_t leftDistance,
                        wpi::units::meter_t rightDistance) {
     return Odometry3d::Update(gyroAngle, {leftDistance, rightDistance});
   }
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveWheelSpeeds.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveWheelSpeeds.hpp
index 7bd8c340c7..b0d25b317e 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveWheelSpeeds.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/DifferentialDriveWheelSpeeds.hpp
@@ -35,9 +35,10 @@ struct WPILIB_DLLEXPORT DifferentialDriveWheelSpeeds {
    *
    * @param attainableMaxSpeed The absolute max speed that a wheel can reach.
    */
-  constexpr void Desaturate(wpi::units::meters_per_second_t attainableMaxSpeed) {
-    auto realMaxSpeed =
-        wpi::units::math::max(wpi::units::math::abs(left), wpi::units::math::abs(right));
+  constexpr void Desaturate(
+      wpi::units::meters_per_second_t attainableMaxSpeed) {
+    auto realMaxSpeed = wpi::units::math::max(wpi::units::math::abs(left),
+                                              wpi::units::math::abs(right));
 
     if (realMaxSpeed > attainableMaxSpeed) {
       left = left / realMaxSpeed * attainableMaxSpeed;
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp
index bba0bb559d..797413a8d6 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp
@@ -52,13 +52,14 @@ struct WPILIB_DLLEXPORT MecanumDriveWheelSpeeds {
    */
   constexpr MecanumDriveWheelSpeeds Desaturate(
       wpi::units::meters_per_second_t attainableMaxSpeed) const {
-    std::array wheelSpeeds{frontLeft, frontRight,
-                                                          rearLeft, rearRight};
-    wpi::units::meters_per_second_t realMaxSpeed = wpi::units::math::abs(
-        *std::max_element(wheelSpeeds.begin(), wheelSpeeds.end(),
-                          [](const auto& a, const auto& b) {
-                            return wpi::units::math::abs(a) < wpi::units::math::abs(b);
-                          }));
+    std::array wheelSpeeds{
+        frontLeft, frontRight, rearLeft, rearRight};
+    wpi::units::meters_per_second_t realMaxSpeed =
+        wpi::units::math::abs(*std::max_element(
+            wheelSpeeds.begin(), wheelSpeeds.end(),
+            [](const auto& a, const auto& b) {
+              return wpi::units::math::abs(a) < wpi::units::math::abs(b);
+            }));
 
     if (realMaxSpeed > attainableMaxSpeed) {
       for (int i = 0; i < 4; ++i) {
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/SwerveDriveKinematics.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/SwerveDriveKinematics.hpp
index 34de11995c..0d347b2509 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/SwerveDriveKinematics.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/SwerveDriveKinematics.hpp
@@ -67,7 +67,8 @@ class SwerveDriveKinematics
   template ... ModuleTranslations>
     requires(sizeof...(ModuleTranslations) == NumModules)
   explicit SwerveDriveKinematics(ModuleTranslations&&... moduleTranslations)
-      : m_modules{moduleTranslations...}, m_moduleHeadings(wpi::util::empty_array) {
+      : m_modules{moduleTranslations...},
+        m_moduleHeadings(wpi::util::empty_array) {
     for (size_t i = 0; i < NumModules; i++) {
       // clang-format off
       m_inverseKinematics.template block<2, 3>(i * 2, 0) <<
@@ -145,9 +146,9 @@ class SwerveDriveKinematics
    * module states are not normalized. Sometimes, a user input may cause one of
    * the module speeds to go above the attainable max velocity. Use the
    * DesaturateWheelSpeeds(wpi::util::array*,
-   * wpi::units::meters_per_second_t) function to rectify this issue. In addition,
-   * you can leverage the power of C++17 to directly assign the module states to
-   * variables:
+   * wpi::units::meters_per_second_t) function to rectify this issue. In
+   * addition, you can leverage the power of C++17 to directly assign the module
+   * states to variables:
    *
    * @code{.cpp}
    * auto [fl, fr, bl, br] = kinematics.ToSwerveModuleStates(chassisSpeeds);
@@ -156,7 +157,8 @@ class SwerveDriveKinematics
   wpi::util::array ToSwerveModuleStates(
       const ChassisSpeeds& chassisSpeeds,
       const Translation2d& centerOfRotation = Translation2d{}) const {
-    wpi::util::array moduleStates(wpi::util::empty_array);
+    wpi::util::array moduleStates(
+        wpi::util::empty_array);
 
     if (chassisSpeeds.vx == 0_mps && chassisSpeeds.vy == 0_mps &&
         chassisSpeeds.omega == 0_rad_per_s) {
@@ -239,8 +241,9 @@ class SwerveDriveKinematics
    *
    * @return The resulting chassis speed.
    */
-  ChassisSpeeds ToChassisSpeeds(const wpi::util::array&
-                                    moduleStates) const override {
+  ChassisSpeeds ToChassisSpeeds(
+      const wpi::util::array& moduleStates)
+      const override {
     Matrixd moduleStateMatrix;
 
     for (size_t i = 0; i < NumModules; ++i) {
@@ -313,9 +316,10 @@ class SwerveDriveKinematics
 
   Twist2d ToTwist2d(
       const wpi::util::array& start,
-      const wpi::util::array& end) const override {
-    auto result =
-        wpi::util::array(wpi::util::empty_array);
+      const wpi::util::array& end)
+      const override {
+    auto result = wpi::util::array(
+        wpi::util::empty_array);
     for (size_t i = 0; i < NumModules; i++) {
       result[i] = {end[i].distance - start[i].distance, end[i].angle};
     }
@@ -346,13 +350,13 @@ class SwerveDriveKinematics
       wpi::util::array* moduleStates,
       wpi::units::meters_per_second_t attainableMaxSpeed) {
     auto& states = *moduleStates;
-    auto realMaxSpeed =
-        wpi::units::math::abs(std::max_element(states.begin(), states.end(),
-                                          [](const auto& a, const auto& b) {
-                                            return wpi::units::math::abs(a.speed) <
-                                                   wpi::units::math::abs(b.speed);
-                                          })
-                             ->speed);
+    auto realMaxSpeed = wpi::units::math::abs(
+        std::max_element(states.begin(), states.end(),
+                         [](const auto& a, const auto& b) {
+                           return wpi::units::math::abs(a.speed) <
+                                  wpi::units::math::abs(b.speed);
+                         })
+            ->speed);
 
     if (realMaxSpeed > attainableMaxSpeed) {
       for (auto& module : states) {
@@ -395,13 +399,13 @@ class SwerveDriveKinematics
       wpi::units::radians_per_second_t attainableMaxRobotRotationSpeed) {
     auto& states = *moduleStates;
 
-    auto realMaxSpeed =
-        wpi::units::math::abs(std::max_element(states.begin(), states.end(),
-                                          [](const auto& a, const auto& b) {
-                                            return wpi::units::math::abs(a.speed) <
-                                                   wpi::units::math::abs(b.speed);
-                                          })
-                             ->speed);
+    auto realMaxSpeed = wpi::units::math::abs(
+        std::max_element(states.begin(), states.end(),
+                         [](const auto& a, const auto& b) {
+                           return wpi::units::math::abs(a.speed) <
+                                  wpi::units::math::abs(b.speed);
+                         })
+            ->speed);
 
     if (attainableMaxRobotTranslationSpeed == 0_mps ||
         attainableMaxRobotRotationSpeed == 0_rad_per_s ||
@@ -409,17 +413,17 @@ class SwerveDriveKinematics
       return;
     }
 
-    auto translationalK =
-        wpi::units::math::hypot(desiredChassisSpeed.vx, desiredChassisSpeed.vy) /
-        attainableMaxRobotTranslationSpeed;
+    auto translationalK = wpi::units::math::hypot(desiredChassisSpeed.vx,
+                                                  desiredChassisSpeed.vy) /
+                          attainableMaxRobotTranslationSpeed;
 
     auto rotationalK = wpi::units::math::abs(desiredChassisSpeed.omega) /
                        attainableMaxRobotRotationSpeed;
 
     auto k = wpi::units::math::max(translationalK, rotationalK);
 
-    auto scale = wpi::units::math::min(k * attainableMaxModuleSpeed / realMaxSpeed,
-                                  wpi::units::scalar_t{1});
+    auto scale = wpi::units::math::min(
+        k * attainableMaxModuleSpeed / realMaxSpeed, wpi::units::scalar_t{1});
     for (auto& module : states) {
       module.speed = module.speed * scale;
     }
@@ -429,8 +433,8 @@ class SwerveDriveKinematics
       const wpi::util::array& start,
       const wpi::util::array& end,
       double t) const override {
-    auto result =
-        wpi::util::array(wpi::util::empty_array);
+    auto result = wpi::util::array(
+        wpi::util::empty_array);
     for (size_t i = 0; i < NumModules; ++i) {
       result[i] = start[i].Interpolate(end[i], t);
     }
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveKinematicsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveKinematicsProto.hpp
index 3972bf65ab..03480b4275 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveKinematicsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveKinematicsProto.hpp
@@ -10,10 +10,13 @@
 #include "wpimath/protobuf/kinematics.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufDifferentialDriveKinematics;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
   static std::optional Unpack(
       InputStream& stream);
   static bool Pack(OutputStream& stream,
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelPositionsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelPositionsProto.hpp
index d574c6a1d9..8476a7c211 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelPositionsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelPositionsProto.hpp
@@ -10,7 +10,8 @@
 #include "wpimath/protobuf/kinematics.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufDifferentialDriveWheelPositions;
   using InputStream =
       wpi::util::ProtoInputStream;
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelSpeedsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelSpeedsProto.hpp
index 782c2f628e..f1e59eb00c 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelSpeedsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/DifferentialDriveWheelSpeedsProto.hpp
@@ -10,9 +10,11 @@
 #include "wpimath/protobuf/kinematics.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufDifferentialDriveWheelSpeeds;
-  using InputStream = wpi::util::ProtoInputStream;
+  using InputStream =
+      wpi::util::ProtoInputStream;
   using OutputStream =
       wpi::util::ProtoOutputStream;
   static std::optional Unpack(
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveKinematicsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveKinematicsProto.hpp
index 9a5ad2da6e..f98a48112b 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveKinematicsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveKinematicsProto.hpp
@@ -12,9 +12,12 @@
 template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufMecanumDriveKinematics;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
   static bool Pack(OutputStream& stream,
                    const wpi::math::MecanumDriveKinematics& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelPositionsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelPositionsProto.hpp
index ac2bdeb01c..8ae1bc25f9 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelPositionsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelPositionsProto.hpp
@@ -10,10 +10,13 @@
 #include "wpimath/protobuf/kinematics.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufMecanumDriveWheelPositions;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
   static std::optional Unpack(
       InputStream& stream);
   static bool Pack(OutputStream& stream,
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelSpeedsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelSpeedsProto.hpp
index 2d610ac4d0..0bdfca42fd 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelSpeedsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/MecanumDriveWheelSpeedsProto.hpp
@@ -10,10 +10,13 @@
 #include "wpimath/protobuf/kinematics.npb.h"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Protobuf {
+struct WPILIB_DLLEXPORT
+    wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufMecanumDriveWheelSpeeds;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
   static std::optional Unpack(
       InputStream& stream);
   static bool Pack(OutputStream& stream,
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveDriveKinematicsProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveDriveKinematicsProto.hpp
index c5242c0aea..11ddb47d53 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveDriveKinematicsProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveDriveKinematicsProto.hpp
@@ -18,12 +18,13 @@ struct wpi::util::Protobuf> {
   using MessageStruct = wpi_proto_ProtobufSwerveDriveKinematics;
   using InputStream =
       wpi::util::ProtoInputStream>;
-  using OutputStream =
-      wpi::util::ProtoOutputStream>;
+  using OutputStream = wpi::util::ProtoOutputStream<
+      wpi::math::SwerveDriveKinematics>;
 
   static std::optional> Unpack(
       InputStream& stream) {
-    wpi::util::WpiArrayUnpackCallback modules;
+    wpi::util::WpiArrayUnpackCallback
+        modules;
     wpi_proto_ProtobufSwerveDriveKinematics msg{
         .modules = modules.Callback(),
     };
@@ -37,7 +38,8 @@ struct wpi::util::Protobuf> {
 
   static bool Pack(OutputStream& stream,
                    const wpi::math::SwerveDriveKinematics& value) {
-    wpi::util::PackCallback modules{value.GetModules()};
+    wpi::util::PackCallback modules{
+        value.GetModules()};
     wpi_proto_ProtobufSwerveDriveKinematics msg{
         .modules = modules.Callback(),
     };
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModulePositionProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModulePositionProto.hpp
index 23bbec0f89..63812cc6a5 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModulePositionProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModulePositionProto.hpp
@@ -12,9 +12,12 @@
 template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufSwerveModulePosition;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
   static bool Pack(OutputStream& stream,
                    const wpi::math::SwerveModulePosition& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModuleStateProto.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModuleStateProto.hpp
index cf4b97c828..150b0a30d5 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModuleStateProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/proto/SwerveModuleStateProto.hpp
@@ -13,7 +13,10 @@ template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufSwerveModuleState;
   using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
-  static bool Pack(OutputStream& stream, const wpi::math::SwerveModuleState& value);
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
+  static bool Pack(OutputStream& stream,
+                   const wpi::math::SwerveModuleState& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/ChassisSpeedsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/ChassisSpeedsStruct.hpp
index 872a8a5acd..bbc41dfd79 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/ChassisSpeedsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/ChassisSpeedsStruct.hpp
@@ -17,7 +17,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
   }
 
   static wpi::math::ChassisSpeeds Unpack(std::span data);
-  static void Pack(std::span data, const wpi::math::ChassisSpeeds& value);
+  static void Pack(std::span data,
+                   const wpi::math::ChassisSpeeds& value);
 };
 
 static_assert(wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveKinematicsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveKinematicsStruct.hpp
index 040d7141cd..c862096850 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveKinematicsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveKinematicsStruct.hpp
@@ -9,16 +9,19 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Struct {
+struct WPILIB_DLLEXPORT
+    wpi::util::Struct {
   static constexpr std::string_view GetTypeName() {
     return "DifferentialDriveKinematics";
   }
   static constexpr size_t GetSize() { return 8; }
   static constexpr std::string_view GetSchema() { return "double trackwidth"; }
 
-  static wpi::math::DifferentialDriveKinematics Unpack(std::span data);
+  static wpi::math::DifferentialDriveKinematics Unpack(
+      std::span data);
   static void Pack(std::span data,
                    const wpi::math::DifferentialDriveKinematics& value);
 };
 
-static_assert(wpi::util::StructSerializable);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelPositionsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelPositionsStruct.hpp
index 241eab0bb1..f871a2d3f5 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelPositionsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelPositionsStruct.hpp
@@ -9,7 +9,8 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Struct {
+struct WPILIB_DLLEXPORT
+    wpi::util::Struct {
   static constexpr std::string_view GetTypeName() {
     return "DifferentialDriveWheelPositions";
   }
@@ -24,4 +25,5 @@ struct WPILIB_DLLEXPORT wpi::util::Struct);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelSpeedsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelSpeedsStruct.hpp
index 3185b28170..b0817426d9 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelSpeedsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/DifferentialDriveWheelSpeedsStruct.hpp
@@ -9,7 +9,8 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Struct {
+struct WPILIB_DLLEXPORT
+    wpi::util::Struct {
   static constexpr std::string_view GetTypeName() {
     return "DifferentialDriveWheelSpeeds";
   }
@@ -24,4 +25,5 @@ struct WPILIB_DLLEXPORT wpi::util::Struct);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveKinematicsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveKinematicsStruct.hpp
index f445401235..4c70ceeb7b 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveKinematicsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveKinematicsStruct.hpp
@@ -21,7 +21,8 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
            "rear_left;Translation2d rear_right";
   }
 
-  static wpi::math::MecanumDriveKinematics Unpack(std::span data);
+  static wpi::math::MecanumDriveKinematics Unpack(
+      std::span data);
   static void Pack(std::span data,
                    const wpi::math::MecanumDriveKinematics& value);
   static void ForEachNested(
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelPositionsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelPositionsStruct.hpp
index c39c47cd8d..46c04eed23 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelPositionsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelPositionsStruct.hpp
@@ -9,7 +9,8 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template <>
-struct WPILIB_DLLEXPORT wpi::util::Struct {
+struct WPILIB_DLLEXPORT
+    wpi::util::Struct {
   static constexpr std::string_view GetTypeName() {
     return "MecanumDriveWheelPositions";
   }
@@ -19,9 +20,11 @@ struct WPILIB_DLLEXPORT wpi::util::Struct
            "rear_right";
   }
 
-  static wpi::math::MecanumDriveWheelPositions Unpack(std::span data);
+  static wpi::math::MecanumDriveWheelPositions Unpack(
+      std::span data);
   static void Pack(std::span data,
                    const wpi::math::MecanumDriveWheelPositions& value);
 };
 
-static_assert(wpi::util::StructSerializable);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelSpeedsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelSpeedsStruct.hpp
index ed0d86fa8a..9646cc437b 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelSpeedsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/MecanumDriveWheelSpeedsStruct.hpp
@@ -19,9 +19,11 @@ struct WPILIB_DLLEXPORT wpi::util::Struct {
            "double rear_right";
   }
 
-  static wpi::math::MecanumDriveWheelSpeeds Unpack(std::span data);
+  static wpi::math::MecanumDriveWheelSpeeds Unpack(
+      std::span data);
   static void Pack(std::span data,
                    const wpi::math::MecanumDriveWheelSpeeds& value);
 };
 
-static_assert(wpi::util::StructSerializable);
+static_assert(
+    wpi::util::StructSerializable);
diff --git a/wpimath/src/main/native/include/wpi/math/kinematics/struct/SwerveDriveKinematicsStruct.hpp b/wpimath/src/main/native/include/wpi/math/kinematics/struct/SwerveDriveKinematicsStruct.hpp
index 72e0b9eec8..6880fe3043 100644
--- a/wpimath/src/main/native/include/wpi/math/kinematics/struct/SwerveDriveKinematicsStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/kinematics/struct/SwerveDriveKinematicsStruct.hpp
@@ -12,29 +12,31 @@
 
 template 
 struct wpi::util::Struct> {
-  static constexpr ct_string kTypeName = wpi::util::Concat(
-      "SwerveDriveKinematics__"_ct_string, wpi::util::NumToCtString());
+  static constexpr ct_string kTypeName =
+      wpi::util::Concat("SwerveDriveKinematics__"_ct_string,
+                        wpi::util::NumToCtString());
   static constexpr std::string_view GetTypeName() { return kTypeName; }
   static constexpr size_t GetSize() {
     return NumModules * wpi::util::Struct::GetSize();
   }
   static constexpr ct_string kSchema =
       wpi::util::Concat("Translation2d modules["_ct_string,
-                  wpi::util::NumToCtString(), "]"_ct_string);
+                        wpi::util::NumToCtString(), "]"_ct_string);
   static constexpr std::string_view GetSchema() { return kSchema; }
 
   static wpi::math::SwerveDriveKinematics Unpack(
       std::span data) {
     constexpr size_t kModulesOff = 0;
     return wpi::math::SwerveDriveKinematics{
-        wpi::util::UnpackStructArray(
-            data)};
+        wpi::util::UnpackStructArray(data)};
   }
 
   static void Pack(std::span data,
                    const wpi::math::SwerveDriveKinematics& value) {
     constexpr size_t kModulesOff = 0;
-    wpi::util::PackStructArray(data, value.GetModules());
+    wpi::util::PackStructArray(data,
+                                                        value.GetModules());
   }
 
   static void ForEachNested(
@@ -43,7 +45,9 @@ struct wpi::util::Struct> {
   }
 };
 
-static_assert(wpi::util::StructSerializable>);
+static_assert(
+    wpi::util::StructSerializable>);
 static_assert(wpi::util::HasNestedStruct>);
-static_assert(wpi::util::StructSerializable>);
+static_assert(
+    wpi::util::StructSerializable>);
 static_assert(wpi::util::HasNestedStruct>);
diff --git a/wpimath/src/main/native/include/wpi/math/linalg/proto/MatrixProto.hpp b/wpimath/src/main/native/include/wpi/math/linalg/proto/MatrixProto.hpp
index 238e8d266b..466125915b 100644
--- a/wpimath/src/main/native/include/wpi/math/linalg/proto/MatrixProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/linalg/proto/MatrixProto.hpp
@@ -15,19 +15,21 @@
 
 template 
   requires(Cols != 1)
-struct wpi::util::Protobuf> {
+struct wpi::util::Protobuf<
+    wpi::math::Matrixd> {
   using MessageStruct = wpi_proto_ProtobufMatrix;
   using InputStream = wpi::util::ProtoInputStream<
       wpi::math::Matrixd>;
   using OutputStream = wpi::util::ProtoOutputStream<
       wpi::math::Matrixd>;
 
-  static std::optional>
+  static std::optional<
+      wpi::math::Matrixd>
   Unpack(InputStream& stream) {
     constexpr bool isSmall = Rows * Cols * sizeof(double) < 256;
-    using UnpackType =
-        std::conditional_t,
-                           wpi::util::StdVectorUnpackCallback>;
+    using UnpackType = std::conditional_t<
+        isSmall, wpi::util::UnpackCallback,
+        wpi::util::StdVectorUnpackCallback>;
     UnpackType data;
     data.Vec().reserve(Rows * Cols);
     data.SetLimits(wpi::util::DecodeLimits::Fail);
diff --git a/wpimath/src/main/native/include/wpi/math/linalg/proto/VectorProto.hpp b/wpimath/src/main/native/include/wpi/math/linalg/proto/VectorProto.hpp
index 14592e31a2..bf3582f08d 100644
--- a/wpimath/src/main/native/include/wpi/math/linalg/proto/VectorProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/linalg/proto/VectorProto.hpp
@@ -14,15 +14,16 @@
 #include "wpimath/protobuf/wpimath.npb.h"
 
 template 
-struct wpi::util::Protobuf> {
+struct wpi::util::Protobuf<
+    wpi::math::Matrixd> {
   using MessageStruct = wpi_proto_ProtobufVector;
-  using InputStream =
-      wpi::util::ProtoInputStream>;
-  using OutputStream =
-      wpi::util::ProtoOutputStream>;
+  using InputStream = wpi::util::ProtoInputStream<
+      wpi::math::Matrixd>;
+  using OutputStream = wpi::util::ProtoOutputStream<
+      wpi::math::Matrixd>;
 
-  static std::optional> Unpack(
-      InputStream& stream) {
+  static std::optional>
+  Unpack(InputStream& stream) {
     constexpr bool isSmall = Size * sizeof(double) < 256;
     using UnpackType =
         std::conditional_t,
diff --git a/wpimath/src/main/native/include/wpi/math/linalg/struct/StructProto.hpp b/wpimath/src/main/native/include/wpi/math/linalg/struct/StructProto.hpp
index d2748a1f59..b71f568ab8 100644
--- a/wpimath/src/main/native/include/wpi/math/linalg/struct/StructProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/linalg/struct/StructProto.hpp
@@ -12,15 +12,16 @@
 
 template 
   requires(Cols != 1)
-struct wpi::util::Struct> {
+struct wpi::util::Struct<
+    wpi::math::Matrixd> {
   static constexpr ct_string kTypeName =
       wpi::util::Concat("Matrix__"_ct_string, wpi::util::NumToCtString(),
-                  "_"_ct_string, wpi::util::NumToCtString());
+                        "_"_ct_string, wpi::util::NumToCtString());
   static constexpr std::string_view GetTypeName() { return kTypeName; }
   static constexpr size_t GetSize() { return Rows * Cols * 8; }
   static constexpr ct_string kSchema =
-      wpi::util::Concat("double data["_ct_string, wpi::util::NumToCtString(),
-                  "]"_ct_string);
+      wpi::util::Concat("double data["_ct_string,
+                        wpi::util::NumToCtString(), "]"_ct_string);
   static constexpr std::string_view GetSchema() { return kSchema; }
 
   static wpi::math::Matrixd Unpack(
diff --git a/wpimath/src/main/native/include/wpi/math/linalg/struct/VectorStruct.hpp b/wpimath/src/main/native/include/wpi/math/linalg/struct/VectorStruct.hpp
index f27900fe8d..a80aed0af2 100644
--- a/wpimath/src/main/native/include/wpi/math/linalg/struct/VectorStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/linalg/struct/VectorStruct.hpp
@@ -11,13 +11,15 @@
 #include "wpi/util/struct/Struct.hpp"
 
 template 
-struct wpi::util::Struct> {
+struct wpi::util::Struct<
+    wpi::math::Matrixd> {
   static constexpr ct_string kTypeName =
       wpi::util::Concat("Vector__"_ct_string, wpi::util::NumToCtString());
   static constexpr std::string_view GetTypeName() { return kTypeName; }
   static constexpr size_t GetSize() { return Size * 8; }
-  static constexpr ct_string kSchema = wpi::util::Concat(
-      "double data["_ct_string, wpi::util::NumToCtString(), "]"_ct_string);
+  static constexpr ct_string kSchema =
+      wpi::util::Concat("double data["_ct_string,
+                        wpi::util::NumToCtString(), "]"_ct_string);
   static constexpr std::string_view GetSchema() { return kSchema; }
 
   static wpi::math::Matrixd Unpack(
diff --git a/wpimath/src/main/native/include/wpi/math/path/TravelingSalesman.hpp b/wpimath/src/main/native/include/wpi/math/path/TravelingSalesman.hpp
index 6870c8f414..8af12a2f93 100644
--- a/wpimath/src/main/native/include/wpi/math/path/TravelingSalesman.hpp
+++ b/wpimath/src/main/native/include/wpi/math/path/TravelingSalesman.hpp
@@ -55,8 +55,8 @@ class TravelingSalesman {
    * @return The optimized path as an array of Pose2ds.
    */
   template 
-  wpi::util::array Solve(const wpi::util::array& poses,
-                                  int iterations) {
+  wpi::util::array Solve(
+      const wpi::util::array& poses, int iterations) {
     SimulatedAnnealing> solver{
         1, &Neighbor, [&](const Vectord& state) {
           // Total cost is sum of all costs between adjacent pairs in path
diff --git a/wpimath/src/main/native/include/wpi/math/spline/CubicHermiteSpline.hpp b/wpimath/src/main/native/include/wpi/math/spline/CubicHermiteSpline.hpp
index 53a9620fe0..238e9b91d6 100644
--- a/wpimath/src/main/native/include/wpi/math/spline/CubicHermiteSpline.hpp
+++ b/wpimath/src/main/native/include/wpi/math/spline/CubicHermiteSpline.hpp
@@ -137,7 +137,8 @@ class WPILIB_DLLEXPORT CubicHermiteSpline : public Spline<3> {
    * @return The control vector matrix for a dimension.
    */
   static constexpr Eigen::Vector4d ControlVectorFromArrays(
-      wpi::util::array initialVector, wpi::util::array finalVector) {
+      wpi::util::array initialVector,
+      wpi::util::array finalVector) {
     return Eigen::Vector4d{{initialVector[0]},
                            {initialVector[1]},
                            {finalVector[0]},
diff --git a/wpimath/src/main/native/include/wpi/math/spline/QuinticHermiteSpline.hpp b/wpimath/src/main/native/include/wpi/math/spline/QuinticHermiteSpline.hpp
index b1f2f62c9b..b38e422371 100644
--- a/wpimath/src/main/native/include/wpi/math/spline/QuinticHermiteSpline.hpp
+++ b/wpimath/src/main/native/include/wpi/math/spline/QuinticHermiteSpline.hpp
@@ -145,7 +145,8 @@ class WPILIB_DLLEXPORT QuinticHermiteSpline : public Spline<5> {
    * @return The control vector matrix for a dimension.
    */
   static constexpr Vectord<6> ControlVectorFromArrays(
-      wpi::util::array initialVector, wpi::util::array finalVector) {
+      wpi::util::array initialVector,
+      wpi::util::array finalVector) {
     return Vectord<6>{{initialVector[0]}, {initialVector[1]},
                       {initialVector[2]}, {finalVector[0]},
                       {finalVector[1]},   {finalVector[2]}};
diff --git a/wpimath/src/main/native/include/wpi/math/spline/Spline.hpp b/wpimath/src/main/native/include/wpi/math/spline/Spline.hpp
index e1fb805f04..43a177c357 100644
--- a/wpimath/src/main/native/include/wpi/math/spline/Spline.hpp
+++ b/wpimath/src/main/native/include/wpi/math/spline/Spline.hpp
@@ -143,7 +143,8 @@ class Spline {
    * @return The Translation2d.
    */
   static constexpr Translation2d FromVector(const Eigen::Vector2d& vector) {
-    return Translation2d{wpi::units::meter_t{vector(0)}, wpi::units::meter_t{vector(1)}};
+    return Translation2d{wpi::units::meter_t{vector(0)},
+                         wpi::units::meter_t{vector(1)}};
   }
 };
 
diff --git a/wpimath/src/main/native/include/wpi/math/spline/SplineHelper.hpp b/wpimath/src/main/native/include/wpi/math/spline/SplineHelper.hpp
index b8b06ea0de..1131bc2a57 100644
--- a/wpimath/src/main/native/include/wpi/math/spline/SplineHelper.hpp
+++ b/wpimath/src/main/native/include/wpi/math/spline/SplineHelper.hpp
@@ -106,8 +106,8 @@ class WPILIB_DLLEXPORT SplineHelper {
       waypoints.emplace(waypoints.begin(),
                         Translation2d{wpi::units::meter_t{xInitial[0]},
                                       wpi::units::meter_t{yInitial[0]}});
-      waypoints.emplace_back(
-          Translation2d{wpi::units::meter_t{xFinal[0]}, wpi::units::meter_t{yFinal[0]}});
+      waypoints.emplace_back(Translation2d{wpi::units::meter_t{xFinal[0]},
+                                           wpi::units::meter_t{yFinal[0]}});
 
       // Populate tridiagonal system for clamped cubic
       /* See:
@@ -186,8 +186,10 @@ class WPILIB_DLLEXPORT SplineHelper {
       const double yDeriv =
           (3 * (yFinal[0] - yInitial[0]) - yFinal[1] - yInitial[1]) / 4.0;
 
-      wpi::util::array midXControlVector{waypoints[0].X().value(), xDeriv};
-      wpi::util::array midYControlVector{waypoints[0].Y().value(), yDeriv};
+      wpi::util::array midXControlVector{waypoints[0].X().value(),
+                                                    xDeriv};
+      wpi::util::array midYControlVector{waypoints[0].Y().value(),
+                                                    yDeriv};
 
       splines.emplace_back(xInitial, midXControlVector, yInitial,
                            midYControlVector);
diff --git a/wpimath/src/main/native/include/wpi/math/spline/proto/CubicHermiteSplineProto.hpp b/wpimath/src/main/native/include/wpi/math/spline/proto/CubicHermiteSplineProto.hpp
index b75ebfcbf7..53c110b02d 100644
--- a/wpimath/src/main/native/include/wpi/math/spline/proto/CubicHermiteSplineProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/spline/proto/CubicHermiteSplineProto.hpp
@@ -12,8 +12,12 @@
 template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufCubicHermiteSpline;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
-  static bool Pack(OutputStream& stream, const wpi::math::CubicHermiteSpline& value);
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
+  static bool Pack(OutputStream& stream,
+                   const wpi::math::CubicHermiteSpline& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/spline/proto/QuinticHermiteSplineProto.hpp b/wpimath/src/main/native/include/wpi/math/spline/proto/QuinticHermiteSplineProto.hpp
index 5b9a42fbad..63f339ac1d 100644
--- a/wpimath/src/main/native/include/wpi/math/spline/proto/QuinticHermiteSplineProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/spline/proto/QuinticHermiteSplineProto.hpp
@@ -12,9 +12,12 @@
 template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufQuinticHermiteSpline;
-  using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
+  using InputStream =
+      wpi::util::ProtoInputStream;
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
   static bool Pack(OutputStream& stream,
                    const wpi::math::QuinticHermiteSpline& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/system/LinearSystemLoop.hpp b/wpimath/src/main/native/include/wpi/math/system/LinearSystemLoop.hpp
index 25991f48e1..fc99061e5a 100644
--- a/wpimath/src/main/native/include/wpi/math/system/LinearSystemLoop.hpp
+++ b/wpimath/src/main/native/include/wpi/math/system/LinearSystemLoop.hpp
@@ -61,7 +61,8 @@ class LinearSystemLoop {
       : LinearSystemLoop(
             plant, controller, observer,
             [=](const InputVector& u) {
-              return wpi::math::DesaturateInputVector(u, maxVoltage.value());
+              return wpi::math::DesaturateInputVector(
+                  u, maxVoltage.value());
             },
             dt) {}
 
@@ -101,11 +102,13 @@ class LinearSystemLoop {
   LinearSystemLoop(
       LinearQuadraticRegulator& controller,
       const LinearPlantInversionFeedforward& feedforward,
-      KalmanFilter& observer, wpi::units::volt_t maxVoltage)
-      : LinearSystemLoop(
-            controller, feedforward, observer, [=](const InputVector& u) {
-              return wpi::math::DesaturateInputVector(u, maxVoltage.value());
-            }) {}
+      KalmanFilter& observer,
+      wpi::units::volt_t maxVoltage)
+      : LinearSystemLoop(controller, feedforward, observer,
+                         [=](const InputVector& u) {
+                           return wpi::math::DesaturateInputVector(
+                               u, maxVoltage.value());
+                         }) {}
 
   /**
    * Constructs a state-space loop with the given controller, feedforward,
diff --git a/wpimath/src/main/native/include/wpi/math/system/plant/DCMotor.hpp b/wpimath/src/main/native/include/wpi/math/system/plant/DCMotor.hpp
index 27e0c757b6..b4b39ea784 100644
--- a/wpimath/src/main/native/include/wpi/math/system/plant/DCMotor.hpp
+++ b/wpimath/src/main/native/include/wpi/math/system/plant/DCMotor.hpp
@@ -18,12 +18,12 @@ namespace wpi::math {
  */
 class WPILIB_DLLEXPORT DCMotor {
  public:
-  using radians_per_second_per_volt_t =
-      wpi::units::unit_t>>;
+  using radians_per_second_per_volt_t = wpi::units::unit_t<
+      wpi::units::compound_unit>>;
   using newton_meters_per_ampere_t =
-      wpi::units::unit_t>>;
+      wpi::units::unit_t>>;
 
   /// Voltage at which the motor constants were measured.
   wpi::units::volt_t nominalVoltage;
@@ -61,8 +61,10 @@ class WPILIB_DLLEXPORT DCMotor {
    */
   constexpr DCMotor(wpi::units::volt_t nominalVoltage,
                     wpi::units::newton_meter_t stallTorque,
-                    wpi::units::ampere_t stallCurrent, wpi::units::ampere_t freeCurrent,
-                    wpi::units::radians_per_second_t freeSpeed, int numMotors = 1)
+                    wpi::units::ampere_t stallCurrent,
+                    wpi::units::ampere_t freeCurrent,
+                    wpi::units::radians_per_second_t freeSpeed,
+                    int numMotors = 1)
       : nominalVoltage(nominalVoltage),
         stallTorque(stallTorque * numMotors),
         stallCurrent(stallCurrent * numMotors),
@@ -78,8 +80,9 @@ class WPILIB_DLLEXPORT DCMotor {
    * @param speed        The current angular velocity of the motor.
    * @param inputVoltage The voltage being applied to the motor.
    */
-  constexpr wpi::units::ampere_t Current(wpi::units::radians_per_second_t speed,
-                                    wpi::units::volt_t inputVoltage) const {
+  constexpr wpi::units::ampere_t Current(
+      wpi::units::radians_per_second_t speed,
+      wpi::units::volt_t inputVoltage) const {
     return -1.0 / Kv / R * speed + 1.0 / R * inputVoltage;
   }
 
@@ -88,7 +91,8 @@ class WPILIB_DLLEXPORT DCMotor {
    *
    * @param torque The torque produced by the motor.
    */
-  constexpr wpi::units::ampere_t Current(wpi::units::newton_meter_t torque) const {
+  constexpr wpi::units::ampere_t Current(
+      wpi::units::newton_meter_t torque) const {
     return torque / Kt;
   }
 
@@ -97,7 +101,8 @@ class WPILIB_DLLEXPORT DCMotor {
    *
    * @param current     The current drawn by the motor.
    */
-  constexpr wpi::units::newton_meter_t Torque(wpi::units::ampere_t current) const {
+  constexpr wpi::units::newton_meter_t Torque(
+      wpi::units::ampere_t current) const {
     return current * Kt;
   }
 
@@ -108,8 +113,9 @@ class WPILIB_DLLEXPORT DCMotor {
    * @param torque      The torque produced by the motor.
    * @param speed       The current angular velocity of the motor.
    */
-  constexpr wpi::units::volt_t Voltage(wpi::units::newton_meter_t torque,
-                                  wpi::units::radians_per_second_t speed) const {
+  constexpr wpi::units::volt_t Voltage(
+      wpi::units::newton_meter_t torque,
+      wpi::units::radians_per_second_t speed) const {
     return 1.0 / Kv * speed + 1.0 / Kt * R * torque;
   }
 
@@ -121,7 +127,8 @@ class WPILIB_DLLEXPORT DCMotor {
    * @param inputVoltage  The input voltage provided to the motor.
    */
   constexpr wpi::units::radians_per_second_t Speed(
-      wpi::units::newton_meter_t torque, wpi::units::volt_t inputVoltage) const {
+      wpi::units::newton_meter_t torque,
+      wpi::units::volt_t inputVoltage) const {
     return inputVoltage * Kv - 1.0 / Kt * torque * R * Kv;
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/system/plant/LinearSystemId.hpp b/wpimath/src/main/native/include/wpi/math/system/plant/LinearSystemId.hpp
index 97946cdb80..90def858f2 100644
--- a/wpimath/src/main/native/include/wpi/math/system/plant/LinearSystemId.hpp
+++ b/wpimath/src/main/native/include/wpi/math/system/plant/LinearSystemId.hpp
@@ -27,12 +27,13 @@ namespace wpi::math {
 class WPILIB_DLLEXPORT LinearSystemId {
  public:
   template 
-  using Velocity_t = wpi::units::unit_t<
-      wpi::units::compound_unit>>;
+  using Velocity_t = wpi::units::unit_t>>;
 
   template 
   using Acceleration_t = wpi::units::unit_t>,
+      wpi::units::compound_unit>,
       wpi::units::inverse>>;
 
   /**
@@ -46,10 +47,9 @@ class WPILIB_DLLEXPORT LinearSystemId {
    * @param gearing Gear ratio from motor to carriage.
    * @throws std::domain_error if mass <= 0, radius <= 0, or gearing <= 0.
    */
-  static constexpr LinearSystem<2, 1, 2> ElevatorSystem(DCMotor motor,
-                                                        wpi::units::kilogram_t mass,
-                                                        wpi::units::meter_t radius,
-                                                        double gearing) {
+  static constexpr LinearSystem<2, 1, 2> ElevatorSystem(
+      DCMotor motor, wpi::units::kilogram_t mass, wpi::units::meter_t radius,
+      double gearing) {
     if (mass <= 0_kg) {
       throw std::domain_error("mass must be greater than zero.");
     }
@@ -274,7 +274,8 @@ class WPILIB_DLLEXPORT LinearSystemId {
   static constexpr LinearSystem<2, 2, 2> IdentifyDrivetrainSystem(
       decltype(1_V / 1_mps) kVLinear, decltype(1_V / 1_mps_sq) kALinear,
       decltype(1_V / 1_rad_per_s) kVAngular,
-      decltype(1_V / 1_rad_per_s_sq) kAAngular, wpi::units::meter_t trackwidth) {
+      decltype(1_V / 1_rad_per_s_sq) kAAngular,
+      wpi::units::meter_t trackwidth) {
     if (kVLinear <= decltype(kVLinear){0}) {
       throw std::domain_error("Kv,linear must be greater than zero.");
     }
@@ -427,7 +428,8 @@ class WPILIB_DLLEXPORT LinearSystemId {
    */
   static constexpr LinearSystem<2, 2, 2> DrivetrainVelocitySystem(
       const DCMotor& motor, wpi::units::kilogram_t mass, wpi::units::meter_t r,
-      wpi::units::meter_t rb, wpi::units::kilogram_square_meter_t J, double gearing) {
+      wpi::units::meter_t rb, wpi::units::kilogram_square_meter_t J,
+      double gearing) {
     if (mass <= 0_kg) {
       throw std::domain_error("mass must be greater than zero.");
     }
@@ -448,14 +450,16 @@ class WPILIB_DLLEXPORT LinearSystemId {
               (motor.Kv * motor.R * wpi::units::math::pow<2>(r));
     auto C2 = gearing * motor.Kt / (motor.R * r);
 
-    Matrixd<2, 2> A{{((1 / mass + wpi::units::math::pow<2>(rb) / J) * C1).value(),
-                     ((1 / mass - wpi::units::math::pow<2>(rb) / J) * C1).value()},
-                    {((1 / mass - wpi::units::math::pow<2>(rb) / J) * C1).value(),
-                     ((1 / mass + wpi::units::math::pow<2>(rb) / J) * C1).value()}};
-    Matrixd<2, 2> B{{((1 / mass + wpi::units::math::pow<2>(rb) / J) * C2).value(),
-                     ((1 / mass - wpi::units::math::pow<2>(rb) / J) * C2).value()},
-                    {((1 / mass - wpi::units::math::pow<2>(rb) / J) * C2).value(),
-                     ((1 / mass + wpi::units::math::pow<2>(rb) / J) * C2).value()}};
+    Matrixd<2, 2> A{
+        {((1 / mass + wpi::units::math::pow<2>(rb) / J) * C1).value(),
+         ((1 / mass - wpi::units::math::pow<2>(rb) / J) * C1).value()},
+        {((1 / mass - wpi::units::math::pow<2>(rb) / J) * C1).value(),
+         ((1 / mass + wpi::units::math::pow<2>(rb) / J) * C1).value()}};
+    Matrixd<2, 2> B{
+        {((1 / mass + wpi::units::math::pow<2>(rb) / J) * C2).value(),
+         ((1 / mass - wpi::units::math::pow<2>(rb) / J) * C2).value()},
+        {((1 / mass - wpi::units::math::pow<2>(rb) / J) * C2).value(),
+         ((1 / mass + wpi::units::math::pow<2>(rb) / J) * C2).value()}};
     Matrixd<2, 2> C{{1.0, 0.0}, {0.0, 1.0}};
     Matrixd<2, 2> D{{0.0, 0.0}, {0.0, 0.0}};
 
diff --git a/wpimath/src/main/native/include/wpi/math/system/proto/LinearSystemProto.hpp b/wpimath/src/main/native/include/wpi/math/system/proto/LinearSystemProto.hpp
index 4248371c20..90a34e0a54 100644
--- a/wpimath/src/main/native/include/wpi/math/system/proto/LinearSystemProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/system/proto/LinearSystemProto.hpp
@@ -18,10 +18,10 @@
 template 
 struct wpi::util::Protobuf> {
   using MessageStruct = wpi_proto_ProtobufLinearSystem;
-  using InputStream =
-      wpi::util::ProtoInputStream>;
-  using OutputStream =
-      wpi::util::ProtoOutputStream>;
+  using InputStream = wpi::util::ProtoInputStream<
+      wpi::math::LinearSystem>;
+  using OutputStream = wpi::util::ProtoOutputStream<
+      wpi::math::LinearSystem>;
 
   static std::optional> Unpack(
       InputStream& stream) {
@@ -66,8 +66,9 @@ struct wpi::util::Protobuf> {
     };
   }
 
-  static bool Pack(OutputStream& stream,
-                   const wpi::math::LinearSystem& value) {
+  static bool Pack(
+      OutputStream& stream,
+      const wpi::math::LinearSystem& value) {
     wpi::util::PackCallback a{&value.A()};
     wpi::util::PackCallback b{&value.B()};
     wpi::util::PackCallback c{&value.C()};
diff --git a/wpimath/src/main/native/include/wpi/math/system/struct/LinearSystemStruct.hpp b/wpimath/src/main/native/include/wpi/math/system/struct/LinearSystemStruct.hpp
index f0cc59325b..9bea230c6f 100644
--- a/wpimath/src/main/native/include/wpi/math/system/struct/LinearSystemStruct.hpp
+++ b/wpimath/src/main/native/include/wpi/math/system/struct/LinearSystemStruct.hpp
@@ -13,10 +13,10 @@
 
 template 
 struct wpi::util::Struct> {
-  static constexpr ct_string kTypeName =
-      wpi::util::Concat("LinearSystem__"_ct_string, wpi::util::NumToCtString(),
-                  "_"_ct_string, wpi::util::NumToCtString(), "_"_ct_string,
-                  wpi::util::NumToCtString());
+  static constexpr ct_string kTypeName = wpi::util::Concat(
+      "LinearSystem__"_ct_string, wpi::util::NumToCtString(),
+      "_"_ct_string, wpi::util::NumToCtString(), "_"_ct_string,
+      wpi::util::NumToCtString());
   static constexpr std::string_view GetTypeName() { return kTypeName; }
   static constexpr size_t GetSize() {
     return wpi::util::Struct>::GetSize() +
@@ -25,10 +25,14 @@ struct wpi::util::Struct> {
            wpi::util::Struct>::GetSize();
   }
   static constexpr ct_string kSchema = wpi::util::Concat(
-      wpi::util::Struct>::kTypeName, " a;"_ct_string,
-      wpi::util::Struct>::kTypeName, " b;"_ct_string,
-      wpi::util::Struct>::kTypeName, " c;"_ct_string,
-      wpi::util::Struct>::kTypeName, " d"_ct_string);
+      wpi::util::Struct>::kTypeName,
+      " a;"_ct_string,
+      wpi::util::Struct>::kTypeName,
+      " b;"_ct_string,
+      wpi::util::Struct>::kTypeName,
+      " c;"_ct_string,
+      wpi::util::Struct>::kTypeName,
+      " d"_ct_string);
   static constexpr std::string_view GetSchema() { return kSchema; }
 
   static wpi::math::LinearSystem Unpack(
@@ -41,14 +45,19 @@ struct wpi::util::Struct> {
     constexpr size_t kDOff =
         kCOff + wpi::util::GetStructSize>();
     return wpi::math::LinearSystem{
-        wpi::util::UnpackStruct, kAOff>(data),
-        wpi::util::UnpackStruct, kBOff>(data),
-        wpi::util::UnpackStruct, kCOff>(data),
-        wpi::util::UnpackStruct, kDOff>(data)};
+        wpi::util::UnpackStruct, kAOff>(
+            data),
+        wpi::util::UnpackStruct, kBOff>(
+            data),
+        wpi::util::UnpackStruct, kCOff>(
+            data),
+        wpi::util::UnpackStruct, kDOff>(
+            data)};
   }
 
-  static void Pack(std::span data,
-                   const wpi::math::LinearSystem& value) {
+  static void Pack(
+      std::span data,
+      const wpi::math::LinearSystem& value) {
     constexpr size_t kAOff = 0;
     constexpr size_t kBOff =
         kAOff + wpi::util::GetStructSize>();
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/ExponentialProfile.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/ExponentialProfile.hpp
index 680eb8cd89..f3ee1a0981 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/ExponentialProfile.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/ExponentialProfile.hpp
@@ -42,17 +42,20 @@ class ExponentialProfile {
  public:
   using Distance_t = wpi::units::unit_t;
   using Velocity =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Velocity_t = wpi::units::unit_t;
   using Acceleration =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Input_t = wpi::units::unit_t;
   using A_t = wpi::units::unit_t>;
-  using B_t =
-      wpi::units::unit_t>>;
+  using B_t = wpi::units::unit_t<
+      wpi::units::compound_unit>>;
   using KV = wpi::units::compound_unit>;
   using kV_t = wpi::units::unit_t;
-  using KA = wpi::units::compound_unit>;
+  using KA =
+      wpi::units::compound_unit>;
   using kA_t = wpi::units::unit_t;
 
   /**
@@ -199,7 +202,7 @@ class ExponentialProfile {
    * @return The total duration of this profile.
    */
   constexpr wpi::units::second_t TimeLeftUntil(const State& current,
-                                          const State& goal) const {
+                                               const State& goal) const {
     auto timing = CalculateProfileTiming(current, goal);
 
     return timing.totalTime;
@@ -282,7 +285,7 @@ class ExponentialProfile {
     // point velocity. For case 5, we have reached inflection point velocity.
     auto epsilon = Velocity_t(1e-9);
     if (wpi::units::math::abs(u_dir * m_constraints.MaxVelocity() -
-                         inflectionPoint.velocity) < epsilon) {
+                              inflectionPoint.velocity) < epsilon) {
       auto solvableV = inflectionPoint.velocity;
       wpi::units::second_t t_to_solvable_v;
       Distance_t x_at_solvable_v;
@@ -291,7 +294,8 @@ class ExponentialProfile {
         t_to_solvable_v = 0_s;
         x_at_solvable_v = current.position;
       } else {
-        if (wpi::units::math::abs(current.velocity) > m_constraints.MaxVelocity()) {
+        if (wpi::units::math::abs(current.velocity) >
+            m_constraints.MaxVelocity()) {
           solvableV += u_dir * epsilon;
         } else {
           solvableV -= u_dir * epsilon;
@@ -335,8 +339,8 @@ class ExponentialProfile {
     auto u = input;
 
     return initial.position +
-           (-B * u * time +
-            (initial.velocity + B * u / A) * (wpi::units::math::exp(A * time) - 1)) /
+           (-B * u * time + (initial.velocity + B * u / A) *
+                                (wpi::units::math::exp(A * time) - 1)) /
                A;
   }
 
@@ -378,7 +382,9 @@ class ExponentialProfile {
     auto B = m_constraints.B;
     auto u = input;
 
-    return wpi::units::math::log((A * velocity + B * u) / (A * initial + B * u)) / A;
+    return wpi::units::math::log((A * velocity + B * u) /
+                                 (A * initial + B * u)) /
+           A;
   }
 
   /**
@@ -401,7 +407,7 @@ class ExponentialProfile {
     return initial.position + (velocity - initial.velocity) / A -
            B * u / (A * A) *
                wpi::units::math::log((A * velocity + B * u) /
-                                (A * initial.velocity + B * u));
+                                     (A * initial.velocity + B * u));
   }
 
   /**
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/Trajectory.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/Trajectory.hpp
index b9f1f78fbc..935154ed91 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/Trajectory.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/Trajectory.hpp
@@ -74,8 +74,8 @@ class WPILIB_DLLEXPORT Trajectory {
 
       // Check whether the robot is reversing at this stage.
       const auto reversing =
-          velocity < 0_mps ||
-          (wpi::units::math::abs(velocity) < 1E-9_mps && acceleration < 0_mps_sq);
+          velocity < 0_mps || (wpi::units::math::abs(velocity) < 1E-9_mps &&
+                               acceleration < 0_mps_sq);
 
       // Calculate the new velocity.
       // v = v_0 + at
@@ -95,9 +95,10 @@ class WPILIB_DLLEXPORT Trajectory {
       const double interpolationFrac =
           newS / endValue.pose.Translation().Distance(pose.Translation());
 
-      return {newT, newV, acceleration,
-              wpi::util::Lerp(pose, endValue.pose, interpolationFrac),
-              wpi::util::Lerp(curvature, endValue.curvature, interpolationFrac)};
+      return {
+          newT, newV, acceleration,
+          wpi::util::Lerp(pose, endValue.pose, interpolationFrac),
+          wpi::util::Lerp(curvature, endValue.curvature, interpolationFrac)};
     }
   };
 
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/TrajectoryConfig.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/TrajectoryConfig.hpp
index ca59dfd39b..252c44f790 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/TrajectoryConfig.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/TrajectoryConfig.hpp
@@ -115,7 +115,9 @@ class WPILIB_DLLEXPORT TrajectoryConfig {
    * Returns the starting velocity of the trajectory.
    * @return The starting velocity of the trajectory.
    */
-  wpi::units::meters_per_second_t StartVelocity() const { return m_startVelocity; }
+  wpi::units::meters_per_second_t StartVelocity() const {
+    return m_startVelocity;
+  }
 
   /**
    * Returns the ending velocity of the trajectory.
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/TrapezoidProfile.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/TrapezoidProfile.hpp
index f9bab77972..27eb091564 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/TrapezoidProfile.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/TrapezoidProfile.hpp
@@ -47,10 +47,12 @@ class TrapezoidProfile {
  public:
   using Distance_t = wpi::units::unit_t;
   using Velocity =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Velocity_t = wpi::units::unit_t;
   using Acceleration =
-      wpi::units::compound_unit>;
+      wpi::units::compound_unit>;
   using Acceleration_t = wpi::units::unit_t;
 
   /**
@@ -134,8 +136,8 @@ class TrapezoidProfile {
     m_current = Direct(current);
     goal = Direct(goal);
     if (wpi::units::math::abs(m_current.velocity) > m_constraints.maxVelocity) {
-      m_current.velocity =
-          wpi::units::math::copysign(m_constraints.maxVelocity, m_current.velocity);
+      m_current.velocity = wpi::units::math::copysign(m_constraints.maxVelocity,
+                                                      m_current.velocity);
     }
 
     // Deal with a possibly truncated motion profile (with nonzero initial or
@@ -146,7 +148,8 @@ class TrapezoidProfile {
     Distance_t cutoffDistBegin =
         cutoffBegin * cutoffBegin * m_constraints.maxAcceleration / 2.0;
 
-    wpi::units::second_t cutoffEnd = goal.velocity / m_constraints.maxAcceleration;
+    wpi::units::second_t cutoffEnd =
+        goal.velocity / m_constraints.maxAcceleration;
     Distance_t cutoffDistEnd =
         cutoffEnd * cutoffEnd * m_constraints.maxAcceleration / 2.0;
 
@@ -164,8 +167,8 @@ class TrapezoidProfile {
 
     // Handle the case where the profile never reaches full speed
     if (fullSpeedDist < Distance_t{0}) {
-      accelerationTime =
-          wpi::units::math::sqrt(fullTrapezoidDist / m_constraints.maxAcceleration);
+      accelerationTime = wpi::units::math::sqrt(fullTrapezoidDist /
+                                                m_constraints.maxAcceleration);
       fullSpeedDist = Distance_t{0};
     }
 
@@ -236,8 +239,8 @@ class TrapezoidProfile {
 
     Velocity_t decelVelocity;
     if (endAccel > 0_s) {
-      decelVelocity = wpi::units::math::sqrt(
-          wpi::units::math::abs(velocity * velocity + 2 * acceleration * accelDist));
+      decelVelocity = wpi::units::math::sqrt(wpi::units::math::abs(
+          velocity * velocity + 2 * acceleration * accelDist));
     } else {
       decelVelocity = velocity;
     }
@@ -263,11 +266,12 @@ class TrapezoidProfile {
 
     wpi::units::second_t decelTime =
         (-decelVelocity +
-         wpi::units::math::sqrt(wpi::units::math::abs(decelVelocity * decelVelocity +
-                                            2 * deceleration * decelDist))) /
+         wpi::units::math::sqrt(wpi::units::math::abs(
+             decelVelocity * decelVelocity + 2 * deceleration * decelDist))) /
         deceleration;
 
-    wpi::units::second_t fullSpeedTime = fullSpeedDist / m_constraints.maxVelocity;
+    wpi::units::second_t fullSpeedTime =
+        fullSpeedDist / m_constraints.maxVelocity;
 
     return accelTime + fullSpeedTime + decelTime;
   }
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp
index ed4eacd980..1ce41a628f 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/CentripetalAccelerationConstraint.hpp
@@ -43,7 +43,7 @@ class WPILIB_DLLEXPORT CentripetalAccelerationConstraint
     // The units library defines a unit for radians although it is technically
     // unitless.
     return wpi::units::math::sqrt(m_maxCentripetalAcceleration /
-                             wpi::units::math::abs(curvature) * 1_rad);
+                                  wpi::units::math::abs(curvature) * 1_rad);
   }
 
   constexpr MinMax MinMaxAcceleration(
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/DifferentialDriveVoltageConstraint.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/DifferentialDriveVoltageConstraint.hpp
index e70208867e..cf15dd8027 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/DifferentialDriveVoltageConstraint.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/DifferentialDriveVoltageConstraint.hpp
@@ -89,10 +89,12 @@ class WPILIB_DLLEXPORT DifferentialDriveVoltageConstraint
     if (speed == 0_mps) {
       maxChassisAcceleration =
           maxWheelAcceleration /
-          (1 + m_kinematics.trackwidth * wpi::units::math::abs(curvature) / (2_rad));
+          (1 + m_kinematics.trackwidth * wpi::units::math::abs(curvature) /
+                   (2_rad));
       minChassisAcceleration =
           minWheelAcceleration /
-          (1 + m_kinematics.trackwidth * wpi::units::math::abs(curvature) / (2_rad));
+          (1 + m_kinematics.trackwidth * wpi::units::math::abs(curvature) /
+                   (2_rad));
     } else {
       maxChassisAcceleration =
           maxWheelAcceleration /
@@ -110,7 +112,8 @@ class WPILIB_DLLEXPORT DifferentialDriveVoltageConstraint
     // wheel when this happens. We can accurately account for this by simply
     // negating the inner wheel.
 
-    if ((m_kinematics.trackwidth / 2) > 1_rad / wpi::units::math::abs(curvature)) {
+    if ((m_kinematics.trackwidth / 2) >
+        1_rad / wpi::units::math::abs(curvature)) {
       if (speed > 0_mps) {
         minChassisAcceleration = -minChassisAcceleration;
       } else if (speed < 0_mps) {
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/MecanumDriveKinematicsConstraint.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/MecanumDriveKinematicsConstraint.hpp
index 12de9c43f9..0f593c464d 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/MecanumDriveKinematicsConstraint.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/MecanumDriveKinematicsConstraint.hpp
@@ -40,8 +40,9 @@ class WPILIB_DLLEXPORT MecanumDriveKinematicsConstraint
     return wpi::units::math::hypot(normSpeeds.vx, normSpeeds.vy);
   }
 
-  MinMax MinMaxAcceleration(const Pose2d& pose, wpi::units::curvature_t curvature,
-                            wpi::units::meters_per_second_t speed) const override {
+  MinMax MinMaxAcceleration(
+      const Pose2d& pose, wpi::units::curvature_t curvature,
+      wpi::units::meters_per_second_t speed) const override {
     return {};
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/SwerveDriveKinematicsConstraint.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/SwerveDriveKinematicsConstraint.hpp
index 23386789a8..2a005a502f 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/SwerveDriveKinematicsConstraint.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/SwerveDriveKinematicsConstraint.hpp
@@ -40,8 +40,9 @@ class SwerveDriveKinematicsConstraint : public TrajectoryConstraint {
     return wpi::units::math::hypot(normSpeeds.vx, normSpeeds.vy);
   }
 
-  MinMax MinMaxAcceleration(const Pose2d& pose, wpi::units::curvature_t curvature,
-                            wpi::units::meters_per_second_t speed) const override {
+  MinMax MinMaxAcceleration(
+      const Pose2d& pose, wpi::units::curvature_t curvature,
+      wpi::units::meters_per_second_t speed) const override {
     return {};
   }
 
diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/proto/TrajectoryStateProto.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/proto/TrajectoryStateProto.hpp
index c9a2e89080..17e62a73b6 100644
--- a/wpimath/src/main/native/include/wpi/math/trajectory/proto/TrajectoryStateProto.hpp
+++ b/wpimath/src/main/native/include/wpi/math/trajectory/proto/TrajectoryStateProto.hpp
@@ -13,7 +13,10 @@ template <>
 struct WPILIB_DLLEXPORT wpi::util::Protobuf {
   using MessageStruct = wpi_proto_ProtobufTrajectoryState;
   using InputStream = wpi::util::ProtoInputStream;
-  using OutputStream = wpi::util::ProtoOutputStream;
-  static std::optional Unpack(InputStream& stream);
-  static bool Pack(OutputStream& stream, const wpi::math::Trajectory::State& value);
+  using OutputStream =
+      wpi::util::ProtoOutputStream;
+  static std::optional Unpack(
+      InputStream& stream);
+  static bool Pack(OutputStream& stream,
+                   const wpi::math::Trajectory::State& value);
 };
diff --git a/wpimath/src/main/native/include/wpi/math/util/ComputerVisionUtil.hpp b/wpimath/src/main/native/include/wpi/math/util/ComputerVisionUtil.hpp
index 3f3d598307..0af37baee3 100644
--- a/wpimath/src/main/native/include/wpi/math/util/ComputerVisionUtil.hpp
+++ b/wpimath/src/main/native/include/wpi/math/util/ComputerVisionUtil.hpp
@@ -25,13 +25,15 @@ namespace wpi::math {
  *   pose. This can either be a constant for a rigidly mounted camera, or
  *   variable if the camera is mounted to a turret. If the camera was mounted 3
  *   inches in front of the "origin" (usually physical center) of the robot,
- *   this would be wpi::math::Transform3d{3_in, 0_in, 0_in, wpi::math::Rotation3d{}}.
+ *   this would be wpi::math::Transform3d{3_in, 0_in, 0_in,
+ * wpi::math::Rotation3d{}}.
  * @return The robot's field-relative pose.
  */
 WPILIB_DLLEXPORT
-constexpr wpi::math::Pose3d ObjectToRobotPose(const wpi::math::Pose3d& objectInField,
-                                        const wpi::math::Transform3d& cameraToObject,
-                                        const wpi::math::Transform3d& robotToCamera) {
+constexpr wpi::math::Pose3d ObjectToRobotPose(
+    const wpi::math::Pose3d& objectInField,
+    const wpi::math::Transform3d& cameraToObject,
+    const wpi::math::Transform3d& robotToCamera) {
   const auto objectToCamera = cameraToObject.Inverse();
   const auto cameraToRobot = robotToCamera.Inverse();
   return objectInField + objectToCamera + cameraToRobot;
diff --git a/wpimath/src/main/native/include/wpi/math/util/MathUtil.hpp b/wpimath/src/main/native/include/wpi/math/util/MathUtil.hpp
index a04e2c35ff..40aa51cdea 100644
--- a/wpimath/src/main/native/include/wpi/math/util/MathUtil.hpp
+++ b/wpimath/src/main/native/include/wpi/math/util/MathUtil.hpp
@@ -151,7 +151,8 @@ constexpr T CopyDirectionPow(T value, double exponent,
         value);
   } else {
     return wpi::units::math::copysign(
-        gcem::pow((wpi::units::math::abs(value) / maxMagnitude).value(), exponent) *
+        gcem::pow((wpi::units::math::abs(value) / maxMagnitude).value(),
+                  exponent) *
             maxMagnitude,
         value);
   }
@@ -258,7 +259,8 @@ template 
   requires std::is_arithmetic_v || wpi::units::traits::is_unit_t_v
 constexpr bool IsNear(T expected, T actual, T tolerance, T min, T max) {
   T errorBound = (max - min) / 2.0;
-  T error = wpi::math::InputModulus(expected - actual, -errorBound, errorBound);
+  T error =
+      wpi::math::InputModulus(expected - actual, -errorBound, errorBound);
 
   if constexpr (std::is_arithmetic_v) {
     return std::abs(error) < tolerance;
@@ -274,9 +276,9 @@ constexpr bool IsNear(T expected, T actual, T tolerance, T min, T max) {
  */
 WPILIB_DLLEXPORT
 constexpr wpi::units::radian_t AngleModulus(wpi::units::radian_t angle) {
-  return InputModulus(angle,
-                                       wpi::units::radian_t{-std::numbers::pi},
-                                       wpi::units::radian_t{std::numbers::pi});
+  return InputModulus(
+      angle, wpi::units::radian_t{-std::numbers::pi},
+      wpi::units::radian_t{std::numbers::pi});
 }
 
 // floorDiv and floorMod algorithms taken from Java
@@ -326,10 +328,9 @@ constexpr std::signed_integral auto FloorMod(std::signed_integral auto x,
  * @param maxVelocity Maximum translation velocity.
  * @return Returns the next Translation2d limited to maxVelocity
  */
-constexpr Translation2d SlewRateLimit(const Translation2d& current,
-                                      const Translation2d& next,
-                                      wpi::units::second_t dt,
-                                      wpi::units::meters_per_second_t maxVelocity) {
+constexpr Translation2d SlewRateLimit(
+    const Translation2d& current, const Translation2d& next,
+    wpi::units::second_t dt, wpi::units::meters_per_second_t maxVelocity) {
   if (maxVelocity < 0_mps) {
     wpi::math::MathSharedStore::ReportError(
         "maxVelocity must be a non-negative number, got {}!", maxVelocity);
@@ -357,10 +358,9 @@ constexpr Translation2d SlewRateLimit(const Translation2d& current,
  * @param maxVelocity Maximum translation velocity.
  * @return Returns the next Translation3d limited to maxVelocity
  */
-constexpr Translation3d SlewRateLimit(const Translation3d& current,
-                                      const Translation3d& next,
-                                      wpi::units::second_t dt,
-                                      wpi::units::meters_per_second_t maxVelocity) {
+constexpr Translation3d SlewRateLimit(
+    const Translation3d& current, const Translation3d& next,
+    wpi::units::second_t dt, wpi::units::meters_per_second_t maxVelocity) {
   if (maxVelocity < 0_mps) {
     wpi::math::MathSharedStore::ReportError(
         "maxVelocity must be a non-negative number, got {}!", maxVelocity);
diff --git a/wpimath/src/main/native/include/wpi/math/util/StateSpaceUtil.hpp b/wpimath/src/main/native/include/wpi/math/util/StateSpaceUtil.hpp
index 76563bac95..6c8a07a989 100644
--- a/wpimath/src/main/native/include/wpi/math/util/StateSpaceUtil.hpp
+++ b/wpimath/src/main/native/include/wpi/math/util/StateSpaceUtil.hpp
@@ -83,8 +83,9 @@ constexpr Matrixd MakeCovMatrix(Ts... stdDevs) {
     }
   }
 
-  wpi::util::for_each([&](int i, double stdDev) { result(i, i) = stdDev * stdDev; },
-                stdDevs...);
+  wpi::util::for_each(
+      [&](int i, double stdDev) { result(i, i) = stdDev * stdDev; },
+      stdDevs...);
 
   return result;
 }
diff --git a/wpimath/src/main/native/include/wpi/units/angle.hpp b/wpimath/src/main/native/include/wpi/units/angle.hpp
index 9e1c46e690..0b9e2a4168 100644
--- a/wpimath/src/main/native/include/wpi/units/angle.hpp
+++ b/wpimath/src/main/native/include/wpi/units/angle.hpp
@@ -38,8 +38,9 @@ namespace wpi::units {
  * @sa See unit_t for more information on unit type containers.
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || defined(ENABLE_PREDEFINED_ANGLE_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(angle, radian, radians, rad,
-                              unit, wpi::units::category::angle_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    angle, radian, radians, rad,
+    unit, wpi::units::category::angle_unit>)
 UNIT_ADD(angle, degree, degrees, deg,
          unit, radians, std::ratio<1>>)
 UNIT_ADD(angle, arcminute, arcminutes, arcmin, unit, degrees>)
diff --git a/wpimath/src/main/native/include/wpi/units/angular_jerk.hpp b/wpimath/src/main/native/include/wpi/units/angular_jerk.hpp
index b9387cddb5..5de4937f06 100644
--- a/wpimath/src/main/native/include/wpi/units/angular_jerk.hpp
+++ b/wpimath/src/main/native/include/wpi/units/angular_jerk.hpp
@@ -20,7 +20,8 @@ namespace wpi::units {
  * @sa See unit_t for more information on unit type containers.
  */
 UNIT_ADD(angular_jerk, radians_per_second_cubed, radians_per_second_cubed,
-         rad_per_s_cu, unit, wpi::units::category::angular_jerk_unit>)
+         rad_per_s_cu,
+         unit, wpi::units::category::angular_jerk_unit>)
 UNIT_ADD(angular_jerk, degrees_per_second_cubed, degrees_per_second_cubed,
          deg_per_s_cu,
          compound_unit>>)
diff --git a/wpimath/src/main/native/include/wpi/units/charge.hpp b/wpimath/src/main/native/include/wpi/units/charge.hpp
index 5efd5060ab..d3c7ff53ca 100644
--- a/wpimath/src/main/native/include/wpi/units/charge.hpp
+++ b/wpimath/src/main/native/include/wpi/units/charge.hpp
@@ -41,8 +41,9 @@ namespace wpi::units {
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || \
     defined(ENABLE_PREDEFINED_CHARGE_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(charge, coulomb, coulombs, C,
-                              unit, wpi::units::category::charge_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    charge, coulomb, coulombs, C,
+    unit, wpi::units::category::charge_unit>)
 UNIT_ADD_WITH_METRIC_PREFIXES(charge, ampere_hour, ampere_hours, Ah,
                               compound_unit)
 
diff --git a/wpimath/src/main/native/include/wpi/units/constants.hpp b/wpimath/src/main/native/include/wpi/units/constants.hpp
index e11e1e9606..2686b97e1b 100644
--- a/wpimath/src/main/native/include/wpi/units/constants.hpp
+++ b/wpimath/src/main/native/include/wpi/units/constants.hpp
@@ -64,7 +64,8 @@ static constexpr const unit_t> h(
 static constexpr const unit_t<
     compound_unit>>>
     mu0(pi * 4.0e-7 * force::newton_t(1) /
-        wpi::units::math::cpow<2>(current::ampere_t(1)));  ///< vacuum permeability.
+        wpi::units::math::cpow<2>(
+            current::ampere_t(1)));  ///< vacuum permeability.
 static constexpr const unit_t<
     compound_unit>>
     epsilon0(1.0 / (mu0 * math::cpow<2>(c)));  ///< vacuum permitivity.
diff --git a/wpimath/src/main/native/include/wpi/units/curvature.hpp b/wpimath/src/main/native/include/wpi/units/curvature.hpp
index 01fbdeb425..1bcc143f88 100644
--- a/wpimath/src/main/native/include/wpi/units/curvature.hpp
+++ b/wpimath/src/main/native/include/wpi/units/curvature.hpp
@@ -9,6 +9,6 @@
 #include "wpi/units/length.hpp"
 
 namespace wpi::units {
-using curvature_t = wpi::units::unit_t<
-    wpi::units::compound_unit>>;
+using curvature_t = wpi::units::unit_t>>;
 }  // namespace wpi::units
diff --git a/wpimath/src/main/native/include/wpi/units/energy.hpp b/wpimath/src/main/native/include/wpi/units/energy.hpp
index 42ccf0103d..c3fef794f0 100644
--- a/wpimath/src/main/native/include/wpi/units/energy.hpp
+++ b/wpimath/src/main/native/include/wpi/units/energy.hpp
@@ -39,8 +39,9 @@ namespace wpi::units {
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || \
     defined(ENABLE_PREDEFINED_ENERGY_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(energy, joule, joules, J,
-                              unit, wpi::units::category::energy_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    energy, joule, joules, J,
+    unit, wpi::units::category::energy_unit>)
 UNIT_ADD_WITH_METRIC_PREFIXES(energy, calorie, calories, cal,
                               unit, joules>)
 UNIT_ADD(energy, kilowatt_hour, kilowatt_hours, kWh,
diff --git a/wpimath/src/main/native/include/wpi/units/force.hpp b/wpimath/src/main/native/include/wpi/units/force.hpp
index 7188e9690b..a83b48a2f7 100644
--- a/wpimath/src/main/native/include/wpi/units/force.hpp
+++ b/wpimath/src/main/native/include/wpi/units/force.hpp
@@ -42,8 +42,9 @@ namespace wpi::units {
  * @sa See unit_t for more information on unit type containers.
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || defined(ENABLE_PREDEFINED_FORCE_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(force, newton, newtons, N,
-                              unit, wpi::units::category::force_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    force, newton, newtons, N,
+    unit, wpi::units::category::force_unit>)
 UNIT_ADD(
     force, pound, pounds, lbf,
     compound_unit>>)
diff --git a/wpimath/src/main/native/include/wpi/units/formatter.hpp b/wpimath/src/main/native/include/wpi/units/formatter.hpp
index fcbc370cde..1c606d80e9 100644
--- a/wpimath/src/main/native/include/wpi/units/formatter.hpp
+++ b/wpimath/src/main/native/include/wpi/units/formatter.hpp
@@ -34,13 +34,14 @@ struct fmt::formatter
   auto format(const Unit& obj, FmtContext& ctx) const {
     using Units = typename Unit::unit_type;
-    using BaseUnits =
-        wpi::units::unit,
-                    typename wpi::units::traits::unit_traits::base_unit_type>;
+    using BaseUnits = wpi::units::unit<
+        std::ratio<1>,
+        typename wpi::units::traits::unit_traits::base_unit_type>;
 
     auto out = ctx.out();
 
-    out = m_underlying.format(wpi::units::convert(obj()), ctx);
+    out =
+        m_underlying.format(wpi::units::convert(obj()), ctx);
 
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::meter_ratio::num != 0) {
@@ -50,15 +51,15 @@ struct fmt::formatter::base_unit_type::meter_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::meter_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::meter_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::meter_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::meter_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::meter_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::meter_ratio::den);
     }
 
     if constexpr (wpi::units::traits::unit_traits<
@@ -88,15 +89,15 @@ struct fmt::formatter::base_unit_type::second_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::second_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::second_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::second_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::second_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::second_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::second_ratio::den);
     }
 
     if constexpr (wpi::units::traits::unit_traits<
@@ -107,15 +108,15 @@ struct fmt::formatter::base_unit_type::ampere_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::ampere_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::ampere_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::ampere_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::ampere_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::ampere_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::ampere_ratio::den);
     }
 
     if constexpr (wpi::units::traits::unit_traits<
@@ -126,15 +127,15 @@ struct fmt::formatter::base_unit_type::kelvin_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::kelvin_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::kelvin_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::kelvin_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::kelvin_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::kelvin_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::kelvin_ratio::den);
     }
 
     if constexpr (wpi::units::traits::unit_traits<
@@ -145,15 +146,15 @@ struct fmt::formatter::base_unit_type::mole_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::mole_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::mole_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::mole_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::mole_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::mole_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::mole_ratio::den);
     }
 
     if constexpr (wpi::units::traits::unit_traits<
@@ -183,15 +184,15 @@ struct fmt::formatter::base_unit_type::radian_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::radian_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::radian_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::radian_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::radian_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::radian_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::radian_ratio::den);
     }
 
     if constexpr (wpi::units::traits::unit_traits<
@@ -202,15 +203,15 @@ struct fmt::formatter::base_unit_type::byte_ratio::num != 0 &&
                   wpi::units::traits::unit_traits<
                       Units>::base_unit_type::byte_ratio::num != 1) {
-      out = fmt::format_to(
-          out, "^{}",
-          wpi::units::traits::unit_traits::base_unit_type::byte_ratio::num);
+      out = fmt::format_to(out, "^{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::byte_ratio::num);
     }
     if constexpr (wpi::units::traits::unit_traits<
                       Units>::base_unit_type::byte_ratio::den != 1) {
-      out = fmt::format_to(
-          out, "/{}",
-          wpi::units::traits::unit_traits::base_unit_type::byte_ratio::den);
+      out = fmt::format_to(out, "/{}",
+                           wpi::units::traits::unit_traits<
+                               Units>::base_unit_type::byte_ratio::den);
     }
 
     return out;
diff --git a/wpimath/src/main/native/include/wpi/units/length.hpp b/wpimath/src/main/native/include/wpi/units/length.hpp
index de174e140a..41f61d074e 100644
--- a/wpimath/src/main/native/include/wpi/units/length.hpp
+++ b/wpimath/src/main/native/include/wpi/units/length.hpp
@@ -39,8 +39,9 @@ namespace wpi::units {
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || \
     defined(ENABLE_PREDEFINED_LENGTH_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(length, meter, meters, m,
-                              unit, wpi::units::category::length_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    length, meter, meters, m,
+    unit, wpi::units::category::length_unit>)
 UNIT_ADD(length, foot, feet, ft, unit, meters>)
 UNIT_ADD(length, inch, inches, in, unit, feet>)
 UNIT_ADD(length, mil, mils, mil, unit, inches>)
diff --git a/wpimath/src/main/native/include/wpi/units/mass.hpp b/wpimath/src/main/native/include/wpi/units/mass.hpp
index 78883fb11c..7410ff013f 100644
--- a/wpimath/src/main/native/include/wpi/units/mass.hpp
+++ b/wpimath/src/main/native/include/wpi/units/mass.hpp
@@ -39,7 +39,8 @@ namespace wpi::units {
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || defined(ENABLE_PREDEFINED_MASS_UNITS)
 UNIT_ADD_WITH_METRIC_PREFIXES(
-    mass, gram, grams, g, unit, wpi::units::category::mass_unit>)
+    mass, gram, grams, g,
+    unit, wpi::units::category::mass_unit>)
 UNIT_ADD(mass, metric_ton, metric_tons, t, unit, kilograms>)
 UNIT_ADD(mass, pound, pounds, lb,
          unit, kilograms>)
diff --git a/wpimath/src/main/native/include/wpi/units/math.hpp b/wpimath/src/main/native/include/wpi/units/math.hpp
index 988e5aad9c..29f93f6e2c 100644
--- a/wpimath/src/main/native/include/wpi/units/math.hpp
+++ b/wpimath/src/main/native/include/wpi/units/math.hpp
@@ -183,10 +183,10 @@ constexpr angle::radian_t atan2(const Y y, const X x) noexcept {
                 "The quantity y/x must yield a dimensionless ratio.");
 
   // X and Y could be different length units, so normalize them
-  return angle::radian_t(
-      gcem::atan2(y.template convert<
-                      typename wpi::units::traits::unit_t_traits::unit_type>()(),
-                  x()));
+  return angle::radian_t(gcem::atan2(
+      y.template convert<
+          typename wpi::units::traits::unit_t_traits::unit_type>()(),
+      x()));
 }
 #endif
 
@@ -479,15 +479,17 @@ constexpr dimensionless::scalar_t log2(const ScalarUnit x) noexcept {
  *       factor of the returned unit type may have errors no larger than
  *       `1e-10`.
  */
-template <
-    class UnitType,
-    std::enable_if_t::value, int> = 0>
+template ::value, int> = 0>
 inline constexpr auto sqrt(const UnitType& value) noexcept -> unit_t<
-    square_root::unit_type>,
+    square_root<
+        typename wpi::units::traits::unit_t_traits::unit_type>,
     typename wpi::units::traits::unit_t_traits::underlying_type,
     linear_scale> {
   return unit_t<
-      square_root::unit_type>,
+      square_root<
+          typename wpi::units::traits::unit_t_traits::unit_type>,
       typename wpi::units::traits::unit_t_traits::underlying_type,
       linear_scale>(gcem::sqrt(value()));
 }
@@ -501,16 +503,15 @@ inline constexpr auto sqrt(const UnitType& value) noexcept -> unit_t<
  * @returns square root of the sum-of-squares of x and y in the same units as x.
  */
 template ::value,
-              int> = 0>
+          std::enable_if_t::value,
+                           int> = 0>
 inline constexpr UnitTypeLhs hypot(const UnitTypeLhs& x, const UnitTypeRhs& y) {
   static_assert(traits::is_convertible_unit_t::value,
                 "Parameters of hypot() function are not compatible units.");
   return UnitTypeLhs(gcem::hypot(
-      x(),
-      y.template convert<
-          typename wpi::units::traits::unit_t_traits::unit_type>()()));
+      x(), y.template convert::unit_type>()()));
 }
 
 //----------------------------------
@@ -563,8 +564,8 @@ constexpr UnitTypeLhs fmod(const UnitTypeLhs numer,
                 "Parameters of fmod() function are not compatible units.");
   return UnitTypeLhs(gcem::fmod(
       numer(),
-      denom.template convert<
-          typename wpi::units::traits::unit_t_traits::unit_type>()()));
+      denom.template convert::unit_type>()()));
 }
 
 /**
@@ -646,9 +647,8 @@ UnitTypeLhs fdim(const UnitTypeLhs x, const UnitTypeRhs y) noexcept {
   static_assert(traits::is_convertible_unit_t::value,
                 "Parameters of fdim() function are not compatible units.");
   return UnitTypeLhs(std::fdim(
-      x(),
-      y.template convert<
-          typename wpi::units::traits::unit_t_traits::unit_type>()()));
+      x(), y.template convert::unit_type>()()));
 }
 
 /**
@@ -668,9 +668,8 @@ constexpr UnitTypeLhs fmax(const UnitTypeLhs x, const UnitTypeRhs y) noexcept {
   static_assert(traits::is_convertible_unit_t::value,
                 "Parameters of fmax() function are not compatible units.");
   return UnitTypeLhs(gcem::max(
-      x(),
-      y.template convert<
-          typename wpi::units::traits::unit_t_traits::unit_type>()()));
+      x(), y.template convert::unit_type>()()));
 }
 
 /**
@@ -691,9 +690,8 @@ constexpr UnitTypeLhs fmin(const UnitTypeLhs x, const UnitTypeRhs y) noexcept {
   static_assert(traits::is_convertible_unit_t::value,
                 "Parameters of fmin() function are not compatible units.");
   return UnitTypeLhs(gcem::min(
-      x(),
-      y.template convert<
-          typename wpi::units::traits::unit_t_traits::unit_type>()()));
+      x(), y.template convert::unit_type>()()));
 }
 
 //----------------------------------
@@ -746,10 +744,12 @@ auto fma(const UnitTypeLhs x, const UnitMultiply y, const UnitAdd z) noexcept
   using resultType = decltype(x * y);
   static_assert(
       traits::is_convertible_unit_t<
-          compound_unit<
-              typename wpi::units::traits::unit_t_traits::unit_type,
-              typename wpi::units::traits::unit_t_traits::unit_type>,
-          typename wpi::units::traits::unit_t_traits::unit_type>::value,
+          compound_unit::unit_type,
+                        typename wpi::units::traits::unit_t_traits<
+                            UnitMultiply>::unit_type>,
+          typename wpi::units::traits::unit_t_traits::unit_type>::
+          value,
       "Unit types are not compatible.");
   return resultType(std::fma(x(), y(), resultType(z)()));
 }
diff --git a/wpimath/src/main/native/include/wpi/units/power.hpp b/wpimath/src/main/native/include/wpi/units/power.hpp
index c9a31cb70a..f4baf4f738 100644
--- a/wpimath/src/main/native/include/wpi/units/power.hpp
+++ b/wpimath/src/main/native/include/wpi/units/power.hpp
@@ -38,8 +38,9 @@ namespace wpi::units {
  * @sa See unit_t for more information on unit type containers.
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || defined(ENABLE_PREDEFINED_POWER_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(power, watt, watts, W,
-                              unit, wpi::units::category::power_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    power, watt, watts, W,
+    unit, wpi::units::category::power_unit>)
 UNIT_ADD(power, horsepower, horsepower, hp, unit, watts>)
 UNIT_ADD_DECIBEL(power, watt, dBW)
 UNIT_ADD_DECIBEL(power, milliwatt, dBm)
diff --git a/wpimath/src/main/native/include/wpi/units/time.hpp b/wpimath/src/main/native/include/wpi/units/time.hpp
index ede6f51bff..27ab07193d 100644
--- a/wpimath/src/main/native/include/wpi/units/time.hpp
+++ b/wpimath/src/main/native/include/wpi/units/time.hpp
@@ -38,8 +38,9 @@ namespace wpi::units {
  * @sa See unit_t for more information on unit type containers.
  */
 #if !defined(DISABLE_PREDEFINED_UNITS) || defined(ENABLE_PREDEFINED_TIME_UNITS)
-UNIT_ADD_WITH_METRIC_PREFIXES(time, second, seconds, s,
-                              unit, wpi::units::category::time_unit>)
+UNIT_ADD_WITH_METRIC_PREFIXES(
+    time, second, seconds, s,
+    unit, wpi::units::category::time_unit>)
 UNIT_ADD(time, minute, minutes, min, unit, seconds>)
 UNIT_ADD(time, hour, hours, hr, unit, minutes>)
 UNIT_ADD(time, day, days, d, unit, hours>)
diff --git a/wpimath/src/main/native/include/wpi/units/voltage.hpp b/wpimath/src/main/native/include/wpi/units/voltage.hpp
index 4f2b88724b..0683848409 100644
--- a/wpimath/src/main/native/include/wpi/units/voltage.hpp
+++ b/wpimath/src/main/native/include/wpi/units/voltage.hpp
@@ -40,7 +40,8 @@ namespace wpi::units {
 #if !defined(DISABLE_PREDEFINED_UNITS) || \
     defined(ENABLE_PREDEFINED_VOLTAGE_UNITS)
 UNIT_ADD_WITH_METRIC_PREFIXES(
-    voltage, volt, volts, V, unit, wpi::units::category::voltage_unit>)
+    voltage, volt, volts, V,
+    unit, wpi::units::category::voltage_unit>)
 UNIT_ADD(voltage, statvolt, statvolts, statV,
          unit, volts>)
 UNIT_ADD(voltage, abvolt, abvolts, abV, unit, volts>)
diff --git a/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp b/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp
index 7dd6c8d83e..dc152ba3d7 100644
--- a/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp
+++ b/wpimath/src/test/native/cpp/ComputerVisionUtilTest.cpp
@@ -7,13 +7,16 @@
 #include "wpi/math/util/ComputerVisionUtil.hpp"
 
 TEST(ComputerVisionUtilTest, ObjectToRobotPose) {
-  wpi::math::Pose3d robot{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 30_deg}};
-  wpi::math::Transform3d cameraToObject{wpi::math::Translation3d{1_m, 1_m, 1_m},
-                                  wpi::math::Rotation3d{0_deg, -20_deg, 45_deg}};
-  wpi::math::Transform3d robotToCamera{wpi::math::Translation3d{1_m, 0_m, 2_m},
-                                 wpi::math::Rotation3d{0_deg, 0_deg, 25_deg}};
+  wpi::math::Pose3d robot{1_m, 2_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 30_deg}};
+  wpi::math::Transform3d cameraToObject{
+      wpi::math::Translation3d{1_m, 1_m, 1_m},
+      wpi::math::Rotation3d{0_deg, -20_deg, 45_deg}};
+  wpi::math::Transform3d robotToCamera{
+      wpi::math::Translation3d{1_m, 0_m, 2_m},
+      wpi::math::Rotation3d{0_deg, 0_deg, 25_deg}};
   wpi::math::Pose3d object = robot + robotToCamera + cameraToObject;
 
-  EXPECT_EQ(robot,
-            wpi::math::ObjectToRobotPose(object, cameraToObject, robotToCamera));
+  EXPECT_EQ(robot, wpi::math::ObjectToRobotPose(object, cameraToObject,
+                                                robotToCamera));
 }
diff --git a/wpimath/src/test/native/cpp/DARETest.cpp b/wpimath/src/test/native/cpp/DARETest.cpp
index 12c26cfeca..90a807d36d 100644
--- a/wpimath/src/test/native/cpp/DARETest.cpp
+++ b/wpimath/src/test/native/cpp/DARETest.cpp
@@ -15,56 +15,72 @@
 #include "wpi/util/print.hpp"
 
 // 2x1
-extern template wpi::util::expected, wpi::math::DAREError>
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<2, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
-extern template wpi::util::expected, wpi::math::DAREError>
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<2, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
 
 // 4x1
-extern template wpi::util::expected, wpi::math::DAREError>
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<4, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
-extern template wpi::util::expected, wpi::math::DAREError>
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<4, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
 
 // 2x2
-extern template wpi::util::expected, wpi::math::DAREError>
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<2, 2>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
-extern template wpi::util::expected, wpi::math::DAREError>
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<2, 2>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
 
 // 2x3
-extern template wpi::util::expected, wpi::math::DAREError>
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<2, 3>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
-extern template wpi::util::expected, wpi::math::DAREError>
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
+extern template wpi::util::expected,
+                                    wpi::math::DAREError>
 wpi::math::DARE<2, 3>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
 
 void ExpectMatrixEqual(const Eigen::MatrixXd& lhs, const Eigen::MatrixXd& rhs,
                        double tolerance) {
@@ -134,7 +150,8 @@ TEST(DARETest, NonInvertibleA_ABQR) {
   wpi::math::Matrixd<4, 4> A{
       {0.5, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {0, 0, 0, 0}};
   wpi::math::Matrixd<4, 1> B{{0}, {0}, {0}, {1}};
-  wpi::math::Matrixd<4, 4> Q{{1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};
+  wpi::math::Matrixd<4, 4> Q{
+      {1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};
   wpi::math::Matrixd<1, 1> R{0.25};
 
   auto ret = wpi::math::DARE<4, 1>(A, B, Q, R);
@@ -153,7 +170,8 @@ TEST(DARETest, NonInvertibleA_ABQRN) {
   wpi::math::Matrixd<4, 4> A{
       {0.5, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {0, 0, 0, 0}};
   wpi::math::Matrixd<4, 1> B{{0}, {0}, {0}, {1}};
-  wpi::math::Matrixd<4, 4> Q{{1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};
+  wpi::math::Matrixd<4, 4> Q{
+      {1, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}};
   wpi::math::Matrixd<1, 1> R{0.25};
 
   wpi::math::Matrixd<4, 4> Aref{
diff --git a/wpimath/src/test/native/cpp/DARETest_Inst_2x1.cpp b/wpimath/src/test/native/cpp/DARETest_Inst_2x1.cpp
index 2219077ff6..cbd37eafd0 100644
--- a/wpimath/src/test/native/cpp/DARETest_Inst_2x1.cpp
+++ b/wpimath/src/test/native/cpp/DARETest_Inst_2x1.cpp
@@ -6,12 +6,14 @@
 
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<2, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<2, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
diff --git a/wpimath/src/test/native/cpp/DARETest_Inst_2x2.cpp b/wpimath/src/test/native/cpp/DARETest_Inst_2x2.cpp
index d881aec6ec..7f340eabc0 100644
--- a/wpimath/src/test/native/cpp/DARETest_Inst_2x2.cpp
+++ b/wpimath/src/test/native/cpp/DARETest_Inst_2x2.cpp
@@ -6,12 +6,14 @@
 
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<2, 2>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<2, 2>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
diff --git a/wpimath/src/test/native/cpp/DARETest_Inst_2x3.cpp b/wpimath/src/test/native/cpp/DARETest_Inst_2x3.cpp
index 0a23f782b2..91f6bd8ffc 100644
--- a/wpimath/src/test/native/cpp/DARETest_Inst_2x3.cpp
+++ b/wpimath/src/test/native/cpp/DARETest_Inst_2x3.cpp
@@ -6,12 +6,14 @@
 
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<2, 3>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<2, 3>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
diff --git a/wpimath/src/test/native/cpp/DARETest_Inst_4x1.cpp b/wpimath/src/test/native/cpp/DARETest_Inst_4x1.cpp
index 54e0d1ebf6..619488d1e5 100644
--- a/wpimath/src/test/native/cpp/DARETest_Inst_4x1.cpp
+++ b/wpimath/src/test/native/cpp/DARETest_Inst_4x1.cpp
@@ -7,12 +7,14 @@
 
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<4, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      bool checkPreconditions);
 template wpi::util::expected, wpi::math::DAREError>
 wpi::math::DARE<4, 1>(const Eigen::Matrix& A,
-                const Eigen::Matrix& B,
-                const Eigen::Matrix& Q,
-                const Eigen::Matrix& R,
-                const Eigen::Matrix& N, bool checkPreconditions);
+                      const Eigen::Matrix& B,
+                      const Eigen::Matrix& Q,
+                      const Eigen::Matrix& R,
+                      const Eigen::Matrix& N,
+                      bool checkPreconditions);
diff --git a/wpimath/src/test/native/cpp/EigenTest.cpp b/wpimath/src/test/native/cpp/EigenTest.cpp
index 998c1d076b..af1cbfbded 100644
--- a/wpimath/src/test/native/cpp/EigenTest.cpp
+++ b/wpimath/src/test/native/cpp/EigenTest.cpp
@@ -24,7 +24,7 @@ TEST(EigenTest, Multiplication) {
   const auto result2 = m3 * m4;
 
   wpi::math::Matrixd<2, 4> expectedResult2{{12.5, 5.55, 7.8, 14.3},
-                                     {22.13, 9.82, 13.28, 23.53}};
+                                           {22.13, 9.82, 13.28, 23.53}};
 
   EXPECT_TRUE(expectedResult2.isApprox(result2));
 }
diff --git a/wpimath/src/test/native/cpp/MathUtilTest.cpp b/wpimath/src/test/native/cpp/MathUtilTest.cpp
index d3fe98dc9f..fe76c155ca 100644
--- a/wpimath/src/test/native/cpp/MathUtilTest.cpp
+++ b/wpimath/src/test/native/cpp/MathUtilTest.cpp
@@ -55,14 +55,14 @@ TEST(MathUtilTest, ApplyDeadbandArbitraryScale) {
 
 TEST(MathUtilTest, ApplyDeadbandUnits) {
   // < 0
-  EXPECT_UNITS_EQ(-20_rad,
-                  wpi::math::ApplyDeadband(-20_rad, 1_rad, 20_rad));
+  EXPECT_UNITS_EQ(-20_rad, wpi::math::ApplyDeadband(
+                               -20_rad, 1_rad, 20_rad));
 }
 
 TEST(MathUtilTest, ApplyDeadbandLargeMaxMagnitude) {
   EXPECT_DOUBLE_EQ(
-      80.0,
-      wpi::math::ApplyDeadband(100.0, 20.0, std::numeric_limits::infinity()));
+      80.0, wpi::math::ApplyDeadband(100.0, 20.0,
+                                     std::numeric_limits::infinity()));
 }
 
 TEST(MathUtilTest, ApplyDeadband2dUnityScale) {
@@ -91,35 +91,41 @@ TEST(MathUtilTest, ApplyDeadband2dUnityScale) {
 TEST(MathUtilTest, ApplyDeadband2dArbitraryScale) {
   EXPECT_EQ((Eigen::Vector2d{{0.0}, {2.5}}),
             wpi::math::ApplyDeadband(Eigen::Vector2d{{0.0}, {2.5}}, 0.02, 2.5));
-  EXPECT_EQ((Eigen::Vector2d{{0.0}, {-2.5}}),
-            wpi::math::ApplyDeadband(Eigen::Vector2d{{0.0}, {-2.5}}, 0.02, 2.5));
-  EXPECT_EQ((Eigen::Vector2d{{-2.5}, {0.0}}),
-            wpi::math::ApplyDeadband(Eigen::Vector2d{{-2.5}, {0.0}}, 0.02, 2.5));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{0.0}, {-2.5}}),
+      wpi::math::ApplyDeadband(Eigen::Vector2d{{0.0}, {-2.5}}, 0.02, 2.5));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{-2.5}, {0.0}}),
+      wpi::math::ApplyDeadband(Eigen::Vector2d{{-2.5}, {0.0}}, 0.02, 2.5));
 
   // == 0
   EXPECT_EQ((Eigen::Vector2d{{0.0}, {0.0}}),
             wpi::math::ApplyDeadband(Eigen::Vector2d{{0.0}, {0.0}}, 0.02, 2.5));
 
   // > 0
-  EXPECT_EQ((Eigen::Vector2d{{0.0}, {0.0}}),
-            wpi::math::ApplyDeadband(Eigen::Vector2d{{0.01}, {0.0}}, 0.02, 2.5));
-  EXPECT_EQ((Eigen::Vector2d{{0.0}, {0.0}}),
-            wpi::math::ApplyDeadband(Eigen::Vector2d{{0.02}, {0.0}}, 0.02, 2.5));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{0.0}, {0.0}}),
+      wpi::math::ApplyDeadband(Eigen::Vector2d{{0.01}, {0.0}}, 0.02, 2.5));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{0.0}, {0.0}}),
+      wpi::math::ApplyDeadband(Eigen::Vector2d{{0.02}, {0.0}}, 0.02, 2.5));
   EXPECT_EQ((Eigen::Vector2d{{2.5}, {0.0}}),
             wpi::math::ApplyDeadband(Eigen::Vector2d{{2.5}, {0.0}}, 0.02, 2.5));
 }
 
 TEST(MathUtilTest, ApplyDeadband2dLargeMaxMagnitude) {
-  EXPECT_EQ((Eigen::Vector2d{{80.0}, {0.0}}),
-            (wpi::math::ApplyDeadband(Eigen::Vector2d{{100.0}, {0.0}}, 20.0,
+  EXPECT_EQ(
+      (Eigen::Vector2d{{80.0}, {0.0}}),
+      (wpi::math::ApplyDeadband(Eigen::Vector2d{{100.0}, {0.0}}, 20.0,
                                 std::numeric_limits::infinity())));
 }
 
 TEST(MathUtilTest, ApplyDeadband2dUnits) {
-  EXPECT_EQ((Eigen::Vector{0_mps, 2.5_mps}),
-            wpi::math::ApplyDeadband(
-                Eigen::Vector{0_mps, 2.5_mps},
-                0.02_mps, 2.5_mps));
+  EXPECT_EQ(
+      (Eigen::Vector{0_mps, 2.5_mps}),
+      wpi::math::ApplyDeadband(
+          Eigen::Vector{0_mps, 2.5_mps},
+          0.02_mps, 2.5_mps));
   EXPECT_EQ((Eigen::Vector{1_mps, 0_mps}),
             wpi::math::ApplyDeadband(
                 Eigen::Vector{1_mps, 0_mps},
@@ -154,9 +160,11 @@ TEST(MathUtilTest, CopyDirectionPowWithMaxMagnitude) {
   EXPECT_DOUBLE_EQ(-5.0, wpi::math::CopyDirectionPow(-5.0, 1.0, 10.0));
 
   EXPECT_DOUBLE_EQ(0.5 * 0.5 * 10, wpi::math::CopyDirectionPow(5.0, 2.0, 10.0));
-  EXPECT_DOUBLE_EQ(-0.5 * 0.5 * 10, wpi::math::CopyDirectionPow(-5.0, 2.0, 10.0));
+  EXPECT_DOUBLE_EQ(-0.5 * 0.5 * 10,
+                   wpi::math::CopyDirectionPow(-5.0, 2.0, 10.0));
 
-  EXPECT_DOUBLE_EQ(std::sqrt(0.5) * 10, wpi::math::CopyDirectionPow(5.0, 0.5, 10.0));
+  EXPECT_DOUBLE_EQ(std::sqrt(0.5) * 10,
+                   wpi::math::CopyDirectionPow(5.0, 0.5, 10.0));
   EXPECT_DOUBLE_EQ(-std::sqrt(0.5) * 10,
                    wpi::math::CopyDirectionPow(-5.0, 0.5, 10.0));
 
@@ -172,18 +180,21 @@ TEST(MathUtilTest, CopyDirectionPowWithMaxMagnitude) {
 
 TEST(MathUtilTest, CopyDirectionPowWithUnits) {
   EXPECT_UNITS_EQ(
-      0_mps, wpi::math::CopyDirectionPow(0_mps, 2.0));
+      0_mps,
+      wpi::math::CopyDirectionPow(0_mps, 2.0));
   EXPECT_UNITS_EQ(
-      1_mps, wpi::math::CopyDirectionPow(1_mps, 2.0));
-  EXPECT_UNITS_EQ(
-      -1_mps, wpi::math::CopyDirectionPow(-1_mps, 2.0));
+      1_mps,
+      wpi::math::CopyDirectionPow(1_mps, 2.0));
+  EXPECT_UNITS_EQ(-1_mps,
+                  wpi::math::CopyDirectionPow(
+                      -1_mps, 2.0));
 
-  EXPECT_UNITS_EQ(
-      wpi::units::meters_per_second_t{0.5 * 0.5 * 10},
-      wpi::math::CopyDirectionPow(5_mps, 2.0, 10_mps));
-  EXPECT_UNITS_EQ(
-      wpi::units::meters_per_second_t{-0.5 * 0.5 * 10},
-      wpi::math::CopyDirectionPow(-5_mps, 2.0, 10_mps));
+  EXPECT_UNITS_EQ(wpi::units::meters_per_second_t{0.5 * 0.5 * 10},
+                  wpi::math::CopyDirectionPow(
+                      5_mps, 2.0, 10_mps));
+  EXPECT_UNITS_EQ(wpi::units::meters_per_second_t{-0.5 * 0.5 * 10},
+                  wpi::math::CopyDirectionPow(
+                      -5_mps, 2.0, 10_mps));
 }
 
 TEST(MathUtilTest, CopyDirectionPow2d) {
@@ -221,57 +232,70 @@ TEST(MathUtilTest, CopyDirectionPow2d) {
 }
 
 TEST(MathUtilTest, CopyDirectionPow2dMaxDistance) {
-  EXPECT_EQ((Eigen::Vector2d{{5.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 1.0, 10.0));
-  EXPECT_EQ((Eigen::Vector2d{{-5.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 1.0, 10.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{5.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 1.0, 10.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{-5.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 1.0, 10.0));
 
-  EXPECT_EQ((Eigen::Vector2d{{2.5}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 2.0, 10.0));
-  EXPECT_EQ((Eigen::Vector2d{{-2.5}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 2.0, 10.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{2.5}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 2.0, 10.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{-2.5}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 2.0, 10.0));
 
-  EXPECT_EQ((Eigen::Vector2d{{std::sqrt(0.5) * 10.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 0.5, 10.0));
-  EXPECT_EQ((Eigen::Vector2d{{-std::sqrt(0.5) * 10.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 0.5, 10.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{std::sqrt(0.5) * 10.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 0.5, 10.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{-std::sqrt(0.5) * 10.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 0.5, 10.0));
 
-  EXPECT_EQ((Eigen::Vector2d{{0.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{0.0}, {0.0}}, 2.0, 5.0));
-  EXPECT_EQ((Eigen::Vector2d{{5.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 2.0, 5.0));
-  EXPECT_EQ((Eigen::Vector2d{{-5.0}, {0.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 2.0, 5.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{0.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{0.0}, {0.0}}, 2.0, 5.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{5.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{5.0}, {0.0}}, 2.0, 5.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{-5.0}, {0.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{-5.0}, {0.0}}, 2.0, 5.0));
 
-  EXPECT_EQ((Eigen::Vector2d{{0.0}, {std::pow(0.8, 0.3) * 100.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{0.0}, {80.0}}, 0.3, 100.0));
-  EXPECT_EQ((Eigen::Vector2d{{0.0}, {-std::pow(0.8, 0.3) * 100.0}}),
-            wpi::math::CopyDirectionPow(Eigen::Vector2d{{0.0}, {-80.0}}, 0.3, 100.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{0.0}, {std::pow(0.8, 0.3) * 100.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{0.0}, {80.0}}, 0.3, 100.0));
+  EXPECT_EQ(
+      (Eigen::Vector2d{{0.0}, {-std::pow(0.8, 0.3) * 100.0}}),
+      wpi::math::CopyDirectionPow(Eigen::Vector2d{{0.0}, {-80.0}}, 0.3, 100.0));
 }
 
 TEST(MathUtilTest, CopyDirectionPow2dUnits) {
-  EXPECT_EQ(
-      (Eigen::Vector{1_mps, 0_mps}),
-      wpi::math::CopyDirectionPow(
-          Eigen::Vector{1_mps, 0_mps}, 2.0));
+  EXPECT_EQ((Eigen::Vector{1_mps, 0_mps}),
+            wpi::math::CopyDirectionPow(
+                Eigen::Vector{1_mps, 0_mps},
+                2.0));
   EXPECT_EQ(
       (Eigen::Vector{-1_mps, 0_mps}),
       wpi::math::CopyDirectionPow(
-          Eigen::Vector{-1_mps, 0_mps}, 2.0));
+          Eigen::Vector{-1_mps, 0_mps},
+          2.0));
 
   EXPECT_EQ((Eigen::Vector{0_mps, 0_mps}),
             wpi::math::CopyDirectionPow(
-                Eigen::Vector{0_mps, 0_mps}, 2.0,
-                5_mps));
+                Eigen::Vector{0_mps, 0_mps},
+                2.0, 5_mps));
 
   EXPECT_EQ((Eigen::Vector{5_mps, 0_mps}),
             wpi::math::CopyDirectionPow(
-                Eigen::Vector{5_mps, 0_mps}, 2.0,
-                5_mps));
-  EXPECT_EQ((Eigen::Vector{-5_mps, 0_mps}),
-            wpi::math::CopyDirectionPow(
-                Eigen::Vector{-5_mps, 0_mps},
+                Eigen::Vector{5_mps, 0_mps},
                 2.0, 5_mps));
+  EXPECT_EQ(
+      (Eigen::Vector{-5_mps, 0_mps}),
+      wpi::math::CopyDirectionPow(
+          Eigen::Vector{-5_mps, 0_mps}, 2.0,
+          5_mps));
 }
 
 TEST(MathUtilTest, InputModulus) {
@@ -279,25 +303,29 @@ TEST(MathUtilTest, InputModulus) {
   // result of an angle reference minus the measurement.
 
   // Test symmetric range
-  EXPECT_DOUBLE_EQ(-20.0, wpi::math::InputModulus(170.0 - (-170.0), -180.0, 180.0));
   EXPECT_DOUBLE_EQ(-20.0,
-                   wpi::math::InputModulus(170.0 + 360.0 - (-170.0), -180.0, 180.0));
-  EXPECT_DOUBLE_EQ(-20.0,
-                   wpi::math::InputModulus(170.0 - (-170.0 + 360.0), -180.0, 180.0));
-  EXPECT_DOUBLE_EQ(20.0, wpi::math::InputModulus(-170.0 - 170.0, -180.0, 180.0));
+                   wpi::math::InputModulus(170.0 - (-170.0), -180.0, 180.0));
+  EXPECT_DOUBLE_EQ(
+      -20.0, wpi::math::InputModulus(170.0 + 360.0 - (-170.0), -180.0, 180.0));
+  EXPECT_DOUBLE_EQ(
+      -20.0, wpi::math::InputModulus(170.0 - (-170.0 + 360.0), -180.0, 180.0));
   EXPECT_DOUBLE_EQ(20.0,
-                   wpi::math::InputModulus(-170.0 + 360.0 - 170.0, -180.0, 180.0));
-  EXPECT_DOUBLE_EQ(20.0,
-                   wpi::math::InputModulus(-170.0 - (170.0 + 360.0), -180.0, 180.0));
+                   wpi::math::InputModulus(-170.0 - 170.0, -180.0, 180.0));
+  EXPECT_DOUBLE_EQ(
+      20.0, wpi::math::InputModulus(-170.0 + 360.0 - 170.0, -180.0, 180.0));
+  EXPECT_DOUBLE_EQ(
+      20.0, wpi::math::InputModulus(-170.0 - (170.0 + 360.0), -180.0, 180.0));
 
   // Test range starting at zero
   EXPECT_DOUBLE_EQ(340.0, wpi::math::InputModulus(170.0 - 190.0, 0.0, 360.0));
-  EXPECT_DOUBLE_EQ(340.0, wpi::math::InputModulus(170.0 + 360.0 - 190.0, 0.0, 360.0));
   EXPECT_DOUBLE_EQ(340.0,
-                   wpi::math::InputModulus(170.0 - (190.0 + 360.0), 0.0, 360.0));
+                   wpi::math::InputModulus(170.0 + 360.0 - 190.0, 0.0, 360.0));
+  EXPECT_DOUBLE_EQ(
+      340.0, wpi::math::InputModulus(170.0 - (190.0 + 360.0), 0.0, 360.0));
 
   // Test asymmetric range that doesn't start at zero
-  EXPECT_DOUBLE_EQ(-20.0, wpi::math::InputModulus(170.0 - (-170.0), -170.0, 190.0));
+  EXPECT_DOUBLE_EQ(-20.0,
+                   wpi::math::InputModulus(170.0 - (-170.0), -170.0, 190.0));
 
   // Test range with both positive endpoints
   EXPECT_DOUBLE_EQ(2.0, wpi::math::InputModulus(0.0, 1.0, 3.0));
@@ -307,31 +335,36 @@ TEST(MathUtilTest, InputModulus) {
   EXPECT_DOUBLE_EQ(2.0, wpi::math::InputModulus(4.0, 1.0, 3.0));
 
   // Test all supported types
-  EXPECT_DOUBLE_EQ(-20.0,
-                   wpi::math::InputModulus(170.0 - (-170.0), -170.0, 190.0));
+  EXPECT_DOUBLE_EQ(
+      -20.0, wpi::math::InputModulus(170.0 - (-170.0), -170.0, 190.0));
   EXPECT_EQ(-20, wpi::math::InputModulus(170 - (-170), -170, 190));
-  EXPECT_EQ(-20_deg, wpi::math::InputModulus(170_deg - (-170_deg),
-                                                        -170_deg, 190_deg));
+  EXPECT_EQ(-20_deg, wpi::math::InputModulus(
+                         170_deg - (-170_deg), -170_deg, 190_deg));
 }
 
 TEST(MathUtilTest, AngleModulus) {
+  EXPECT_UNITS_NEAR(wpi::math::AngleModulus(
+                        wpi::units::radian_t{-2000 * std::numbers::pi / 180}),
+                    wpi::units::radian_t{160 * std::numbers::pi / 180}, 1e-10);
+  EXPECT_UNITS_NEAR(wpi::math::AngleModulus(
+                        wpi::units::radian_t{358 * std::numbers::pi / 180}),
+                    wpi::units::radian_t{-2 * std::numbers::pi / 180}, 1e-10);
   EXPECT_UNITS_NEAR(
-      wpi::math::AngleModulus(wpi::units::radian_t{-2000 * std::numbers::pi / 180}),
-      wpi::units::radian_t{160 * std::numbers::pi / 180}, 1e-10);
-  EXPECT_UNITS_NEAR(
-      wpi::math::AngleModulus(wpi::units::radian_t{358 * std::numbers::pi / 180}),
-      wpi::units::radian_t{-2 * std::numbers::pi / 180}, 1e-10);
-  EXPECT_UNITS_NEAR(wpi::math::AngleModulus(wpi::units::radian_t{2.0 * std::numbers::pi}),
-                    0_rad, 1e-10);
+      wpi::math::AngleModulus(wpi::units::radian_t{2.0 * std::numbers::pi}),
+      0_rad, 1e-10);
 
-  EXPECT_UNITS_EQ(wpi::math::AngleModulus(wpi::units::radian_t{5 * std::numbers::pi}),
-                  wpi::units::radian_t{std::numbers::pi});
-  EXPECT_UNITS_EQ(wpi::math::AngleModulus(wpi::units::radian_t{-5 * std::numbers::pi}),
-                  wpi::units::radian_t{std::numbers::pi});
-  EXPECT_UNITS_EQ(wpi::math::AngleModulus(wpi::units::radian_t{std::numbers::pi / 2}),
-                  wpi::units::radian_t{std::numbers::pi / 2});
-  EXPECT_UNITS_EQ(wpi::math::AngleModulus(wpi::units::radian_t{-std::numbers::pi / 2}),
-                  wpi::units::radian_t{-std::numbers::pi / 2});
+  EXPECT_UNITS_EQ(
+      wpi::math::AngleModulus(wpi::units::radian_t{5 * std::numbers::pi}),
+      wpi::units::radian_t{std::numbers::pi});
+  EXPECT_UNITS_EQ(
+      wpi::math::AngleModulus(wpi::units::radian_t{-5 * std::numbers::pi}),
+      wpi::units::radian_t{std::numbers::pi});
+  EXPECT_UNITS_EQ(
+      wpi::math::AngleModulus(wpi::units::radian_t{std::numbers::pi / 2}),
+      wpi::units::radian_t{std::numbers::pi / 2});
+  EXPECT_UNITS_EQ(
+      wpi::math::AngleModulus(wpi::units::radian_t{-std::numbers::pi / 2}),
+      wpi::units::radian_t{-std::numbers::pi / 2});
 }
 
 TEST(MathUtilTest, IsNear) {
diff --git a/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp b/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp
index 2ad89c20d9..1db8693332 100644
--- a/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp
+++ b/wpimath/src/test/native/cpp/StateSpaceUtilTest.cpp
@@ -8,7 +8,8 @@
 #include "wpi/math/util/StateSpaceUtil.hpp"
 
 TEST(StateSpaceUtilTest, CostParameterPack) {
-  constexpr wpi::math::Matrixd<3, 3> mat = wpi::math::MakeCostMatrix(1.0, 2.0, 3.0);
+  constexpr wpi::math::Matrixd<3, 3> mat =
+      wpi::math::MakeCostMatrix(1.0, 2.0, 3.0);
   EXPECT_NEAR(mat(0, 0), 1.0, 1e-3);
   EXPECT_NEAR(mat(0, 1), 0.0, 1e-3);
   EXPECT_NEAR(mat(0, 2), 0.0, 1e-3);
@@ -21,7 +22,8 @@ TEST(StateSpaceUtilTest, CostParameterPack) {
 }
 
 TEST(StateSpaceUtilTest, CostArray) {
-  constexpr wpi::math::Matrixd<3, 3> mat = wpi::math::MakeCostMatrix<3>({1.0, 2.0, 3.0});
+  constexpr wpi::math::Matrixd<3, 3> mat =
+      wpi::math::MakeCostMatrix<3>({1.0, 2.0, 3.0});
   EXPECT_NEAR(mat(0, 0), 1.0, 1e-3);
   EXPECT_NEAR(mat(0, 1), 0.0, 1e-3);
   EXPECT_NEAR(mat(0, 2), 0.0, 1e-3);
@@ -47,7 +49,8 @@ TEST(StateSpaceUtilTest, CostDynamic) {
 }
 
 TEST(StateSpaceUtilTest, CovParameterPack) {
-  constexpr wpi::math::Matrixd<3, 3> mat = wpi::math::MakeCovMatrix(1.0, 2.0, 3.0);
+  constexpr wpi::math::Matrixd<3, 3> mat =
+      wpi::math::MakeCovMatrix(1.0, 2.0, 3.0);
   EXPECT_NEAR(mat(0, 0), 1.0, 1e-3);
   EXPECT_NEAR(mat(0, 1), 0.0, 1e-3);
   EXPECT_NEAR(mat(0, 2), 0.0, 1e-3);
@@ -60,7 +63,8 @@ TEST(StateSpaceUtilTest, CovParameterPack) {
 }
 
 TEST(StateSpaceUtilTest, CovArray) {
-  constexpr wpi::math::Matrixd<3, 3> mat = wpi::math::MakeCovMatrix<3>({1.0, 2.0, 3.0});
+  constexpr wpi::math::Matrixd<3, 3> mat =
+      wpi::math::MakeCovMatrix<3>({1.0, 2.0, 3.0});
   EXPECT_NEAR(mat(0, 0), 1.0, 1e-3);
   EXPECT_NEAR(mat(0, 1), 0.0, 1e-3);
   EXPECT_NEAR(mat(0, 2), 0.0, 1e-3);
@@ -105,23 +109,23 @@ TEST(StateSpaceUtilTest, IsStabilizable) {
 
   // First eigenvalue is uncontrollable and unstable.
   // Second eigenvalue is controllable and stable.
-  EXPECT_FALSE(
-      (wpi::math::IsStabilizable<2, 1>(wpi::math::Matrixd<2, 2>{{1.2, 0}, {0, 0.5}}, B)));
+  EXPECT_FALSE((wpi::math::IsStabilizable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{1.2, 0}, {0, 0.5}}, B)));
 
   // First eigenvalue is uncontrollable and marginally stable.
   // Second eigenvalue is controllable and stable.
-  EXPECT_FALSE(
-      (wpi::math::IsStabilizable<2, 1>(wpi::math::Matrixd<2, 2>{{1, 0}, {0, 0.5}}, B)));
+  EXPECT_FALSE((wpi::math::IsStabilizable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{1, 0}, {0, 0.5}}, B)));
 
   // First eigenvalue is uncontrollable and stable.
   // Second eigenvalue is controllable and stable.
-  EXPECT_TRUE(
-      (wpi::math::IsStabilizable<2, 1>(wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 0.5}}, B)));
+  EXPECT_TRUE((wpi::math::IsStabilizable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 0.5}}, B)));
 
   // First eigenvalue is uncontrollable and stable.
   // Second eigenvalue is controllable and unstable.
-  EXPECT_TRUE(
-      (wpi::math::IsStabilizable<2, 1>(wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 1.2}}, B)));
+  EXPECT_TRUE((wpi::math::IsStabilizable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 1.2}}, B)));
 }
 
 TEST(StateSpaceUtilTest, IsDetectable) {
@@ -129,21 +133,21 @@ TEST(StateSpaceUtilTest, IsDetectable) {
 
   // First eigenvalue is unobservable and unstable.
   // Second eigenvalue is observable and stable.
-  EXPECT_FALSE(
-      (wpi::math::IsDetectable<2, 1>(wpi::math::Matrixd<2, 2>{{1.2, 0}, {0, 0.5}}, C)));
+  EXPECT_FALSE((wpi::math::IsDetectable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{1.2, 0}, {0, 0.5}}, C)));
 
   // First eigenvalue is unobservable and marginally stable.
   // Second eigenvalue is observable and stable.
-  EXPECT_FALSE(
-      (wpi::math::IsDetectable<2, 1>(wpi::math::Matrixd<2, 2>{{1, 0}, {0, 0.5}}, C)));
+  EXPECT_FALSE((wpi::math::IsDetectable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{1, 0}, {0, 0.5}}, C)));
 
   // First eigenvalue is unobservable and stable.
   // Second eigenvalue is observable and stable.
-  EXPECT_TRUE(
-      (wpi::math::IsDetectable<2, 1>(wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 0.5}}, C)));
+  EXPECT_TRUE((wpi::math::IsDetectable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 0.5}}, C)));
 
   // First eigenvalue is unobservable and stable.
   // Second eigenvalue is observable and unstable.
-  EXPECT_TRUE(
-      (wpi::math::IsDetectable<2, 1>(wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 1.2}}, C)));
+  EXPECT_TRUE((wpi::math::IsDetectable<2, 1>(
+      wpi::math::Matrixd<2, 2>{{0.2, 0}, {0, 1.2}}, C)));
 }
diff --git a/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp
index dd5873e787..b0fd8f09c8 100644
--- a/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/ArmFeedforwardTest.cpp
@@ -35,18 +35,20 @@ using Kg_unit = decltype(1_V);
  * @param dt The simulation time.
  * @return The final state as a 2-vector of angle and angular velocity.
  */
-wpi::math::Matrixd<2, 1> Simulate(Ks_unit Ks, Kv_unit Kv, Ka_unit Ka, Kg_unit Kg,
-                            wpi::units::radian_t currentAngle,
-                            wpi::units::radians_per_second_t currentVelocity,
-                            wpi::units::volt_t input, wpi::units::second_t dt) {
+wpi::math::Matrixd<2, 1> Simulate(
+    Ks_unit Ks, Kv_unit Kv, Ka_unit Ka, Kg_unit Kg,
+    wpi::units::radian_t currentAngle,
+    wpi::units::radians_per_second_t currentVelocity, wpi::units::volt_t input,
+    wpi::units::second_t dt) {
   wpi::math::Matrixd<2, 2> A{{0.0, 1.0}, {0.0, -Kv.value() / Ka.value()}};
   wpi::math::Matrixd<2, 1> B{{0.0}, {1.0 / Ka.value()}};
 
   return wpi::math::RK4(
       [&](const wpi::math::Matrixd<2, 1>& x,
           const wpi::math::Matrixd<1, 1>& u) -> wpi::math::Matrixd<2, 1> {
-        wpi::math::Matrixd<2, 1> c{0.0, -Ks.value() / Ka.value() * wpi::util::sgn(x(1)) -
-                                      Kg.value() / Ka.value() * std::cos(x(0))};
+        wpi::math::Matrixd<2, 1> c{
+            0.0, -Ks.value() / Ka.value() * wpi::util::sgn(x(1)) -
+                     Kg.value() / Ka.value() * std::cos(x(0))};
         return A * x + B * u + c;
       },
       wpi::math::Matrixd<2, 1>{currentAngle.value(), currentVelocity.value()},
diff --git a/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp
index 2e2a26577c..93227a758f 100644
--- a/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/ControlAffinePlantInversionFeedforwardTest.cpp
@@ -21,7 +21,7 @@ Vectord<2> StateDynamics(const Vectord<2>& x) {
 
 TEST(ControlAffinePlantInversionFeedforwardTest, Calculate) {
   wpi::math::ControlAffinePlantInversionFeedforward<2, 1> feedforward{&Dynamics,
-                                                                20_ms};
+                                                                      20_ms};
 
   Vectord<2> r{2, 2};
   Vectord<2> nextR{3, 3};
diff --git a/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp b/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp
index 5ea7f9c631..17ed3a4f09 100644
--- a/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/DifferentialDriveAccelerationLimiterTest.cpp
@@ -38,7 +38,7 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
     Vectord<2> accels =
         plant.A() * xAccelLimiter + plant.B() * Vectord<2>{-12.0, 12.0};
     wpi::units::radians_per_second_squared_t alpha{(accels(1) - accels(0)) /
-                                              trackwidth.value()};
+                                                   trackwidth.value()};
     EXPECT_GT(wpi::units::math::abs(alpha), maxAlpha);
   }
 
@@ -46,10 +46,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
   Vectord<2> u{12.0, 12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -57,7 +57,7 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
         plant.A() * xAccelLimiter + plant.B() * Vectord<2>{left, right};
     wpi::units::meters_per_second_squared_t a{(accels(0) + accels(1)) / 2.0};
     wpi::units::radians_per_second_squared_t alpha{(accels(1) - accels(0)) /
-                                              trackwidth.value()};
+                                                   trackwidth.value()};
     EXPECT_LE(wpi::units::math::abs(a), maxA);
     EXPECT_LE(wpi::units::math::abs(alpha), maxAlpha);
   }
@@ -66,10 +66,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
   u = Vectord<2>{-12.0, -12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -77,7 +77,7 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
         plant.A() * xAccelLimiter + plant.B() * Vectord<2>{left, right};
     wpi::units::meters_per_second_squared_t a{(accels(0) + accels(1)) / 2.0};
     wpi::units::radians_per_second_squared_t alpha{(accels(1) - accels(0)) /
-                                              trackwidth.value()};
+                                                   trackwidth.value()};
     EXPECT_LE(wpi::units::math::abs(a), maxA);
     EXPECT_LE(wpi::units::math::abs(alpha), maxAlpha);
   }
@@ -86,10 +86,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
   u = Vectord<2>{-12.0, 12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -97,7 +97,7 @@ TEST(DifferentialDriveAccelerationLimiterTest, LowLimits) {
         plant.A() * xAccelLimiter + plant.B() * Vectord<2>{left, right};
     wpi::units::meters_per_second_squared_t a{(accels(0) + accels(1)) / 2.0};
     wpi::units::radians_per_second_squared_t alpha{(accels(1) - accels(0)) /
-                                              trackwidth.value()};
+                                                   trackwidth.value()};
     EXPECT_LE(wpi::units::math::abs(a), maxA);
     EXPECT_LE(wpi::units::math::abs(alpha), maxAlpha);
   }
@@ -125,10 +125,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, HighLimits) {
   Vectord<2> u{12.0, 12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -142,10 +142,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, HighLimits) {
   u = Vectord<2>{-12.0, -12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -159,10 +159,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, HighLimits) {
   u = Vectord<2>{-12.0, 12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -203,10 +203,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, SeparateMinMaxLowLimits) {
   Vectord<2> u{12.0, 12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
@@ -221,10 +221,10 @@ TEST(DifferentialDriveAccelerationLimiterTest, SeparateMinMaxLowLimits) {
   u = Vectord<2>{-12.0, -12.0};
   for (auto t = 0_s; t < 3_s; t += dt) {
     x = plant.CalculateX(x, u, dt);
-    auto [left, right] =
-        accelLimiter.Calculate(wpi::units::meters_per_second_t{xAccelLimiter(0)},
-                               wpi::units::meters_per_second_t{xAccelLimiter(1)},
-                               wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
+    auto [left, right] = accelLimiter.Calculate(
+        wpi::units::meters_per_second_t{xAccelLimiter(0)},
+        wpi::units::meters_per_second_t{xAccelLimiter(1)},
+        wpi::units::volt_t{u(0)}, wpi::units::volt_t{u(1)});
     xAccelLimiter =
         plant.CalculateX(xAccelLimiter, Vectord<2>{left, right}, dt);
 
diff --git a/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp
index c08962358b..fd838efb5e 100644
--- a/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/DifferentialDriveFeedforwardTest.cpp
@@ -60,7 +60,7 @@ TEST(DifferentialDriveFeedforwardTest, CalculateWithoutTrackwidth) {
       kVLinear, kALinear, kVAngular, kAAngular};
   wpi::math::LinearSystem<2, 2, 2> plant =
       wpi::math::LinearSystemId::IdentifyDrivetrainSystem(kVLinear, kALinear,
-                                                    kVAngular, kAAngular);
+                                                          kVAngular, kAAngular);
   for (auto currentLeftVelocity = -4_mps; currentLeftVelocity <= 4_mps;
        currentLeftVelocity += 2_mps) {
     for (auto currentRightVelocity = -4_mps; currentRightVelocity <= 4_mps;
diff --git a/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp b/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp
index 2f2fa11bd6..7a4eaf723a 100644
--- a/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/LTVDifferentialDriveControllerTest.cpp
@@ -18,7 +18,7 @@
 
 static constexpr wpi::units::meter_t kTolerance{1 / 12.0};
 static constexpr wpi::units::radian_t kAngularTolerance{2.0 * std::numbers::pi /
-                                                   180.0};
+                                                        180.0};
 
 /**
  * States of the drivetrain system.
@@ -49,7 +49,8 @@ static auto plant = wpi::math::LinearSystemId::IdentifyDrivetrainSystem(
     kLinearV, kLinearA, kAngularV, kAngularA);
 static constexpr auto kTrackwidth = 0.9_m;
 
-wpi::math::Vectord<5> Dynamics(const wpi::math::Vectord<5>& x, const wpi::math::Vectord<2>& u) {
+wpi::math::Vectord<5> Dynamics(const wpi::math::Vectord<5>& x,
+                               const wpi::math::Vectord<2>& u) {
   double v = (x(State::kLeftVelocity) + x(State::kRightVelocity)) / 2.0;
 
   wpi::math::Vectord<5> xdot;
@@ -81,22 +82,22 @@ TEST(LTVDifferentialDriveControllerTest, ReachesReference) {
   auto totalTime = trajectory.TotalTime();
   for (size_t i = 0; i < (totalTime / kDt).value(); ++i) {
     auto state = trajectory.Sample(kDt * i);
-    robotPose =
-        wpi::math::Pose2d{wpi::units::meter_t{x(State::kX)}, wpi::units::meter_t{x(State::kY)},
-                    wpi::units::radian_t{x(State::kHeading)}};
+    robotPose = wpi::math::Pose2d{wpi::units::meter_t{x(State::kX)},
+                                  wpi::units::meter_t{x(State::kY)},
+                                  wpi::units::radian_t{x(State::kHeading)}};
     auto [leftVoltage, rightVoltage] = controller.Calculate(
         robotPose, wpi::units::meters_per_second_t{x(State::kLeftVelocity)},
         wpi::units::meters_per_second_t{x(State::kRightVelocity)}, state);
 
-    x = wpi::math::RKDP(&Dynamics, x,
-                  wpi::math::Vectord<2>{leftVoltage.value(), rightVoltage.value()},
-                  kDt);
+    x = wpi::math::RKDP(
+        &Dynamics, x,
+        wpi::math::Vectord<2>{leftVoltage.value(), rightVoltage.value()}, kDt);
   }
 
   auto& endPose = trajectory.States().back().pose;
   EXPECT_NEAR_UNITS(endPose.X(), robotPose.X(), kTolerance);
   EXPECT_NEAR_UNITS(endPose.Y(), robotPose.Y(), kTolerance);
   EXPECT_NEAR_UNITS(wpi::math::AngleModulus(endPose.Rotation().Radians() -
-                                      robotPose.Rotation().Radians()),
+                                            robotPose.Rotation().Radians()),
                     0_rad, kAngularTolerance);
 }
diff --git a/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp b/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp
index ae92929172..a20b9a02f7 100644
--- a/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/LTVUnicycleControllerTest.cpp
@@ -14,12 +14,13 @@
 
 static constexpr wpi::units::meter_t kTolerance{1 / 12.0};
 static constexpr wpi::units::radian_t kAngularTolerance{2.0 * std::numbers::pi /
-                                                   180.0};
+                                                        180.0};
 
 TEST(LTVUnicycleControllerTest, ReachesReference) {
   constexpr wpi::units::second_t kDt = 20_ms;
 
-  wpi::math::LTVUnicycleController controller{{0.0625, 0.125, 2.5}, {4.0, 4.0}, kDt};
+  wpi::math::LTVUnicycleController controller{
+      {0.0625, 0.125, 2.5}, {4.0, 4.0}, kDt};
   wpi::math::Pose2d robotPose{2.7_m, 23_m, 0_deg};
 
   auto waypoints = std::vector{wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
@@ -33,13 +34,14 @@ TEST(LTVUnicycleControllerTest, ReachesReference) {
     auto [vx, vy, omega] = controller.Calculate(robotPose, state);
     static_cast(vy);
 
-    robotPose = robotPose + wpi::math::Twist2d{vx * kDt, 0_m, omega * kDt}.Exp();
+    robotPose =
+        robotPose + wpi::math::Twist2d{vx * kDt, 0_m, omega * kDt}.Exp();
   }
 
   auto& endPose = trajectory.States().back().pose;
   EXPECT_NEAR_UNITS(endPose.X(), robotPose.X(), kTolerance);
   EXPECT_NEAR_UNITS(endPose.Y(), robotPose.Y(), kTolerance);
   EXPECT_NEAR_UNITS(wpi::math::AngleModulus(endPose.Rotation().Radians() -
-                                      robotPose.Rotation().Radians()),
+                                            robotPose.Rotation().Radians()),
                     0_rad, kAngularTolerance);
 }
diff --git a/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp b/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp
index aa9372faba..5f9630f5cb 100644
--- a/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/LinearQuadraticRegulatorTest.cpp
@@ -50,8 +50,8 @@ TEST(LinearQuadraticRegulatorTest, ArmGains) {
     // Gear ratio
     constexpr double G = 100.0;
 
-    return wpi::math::LinearSystemId::SingleJointedArmSystem(motors,
-                                                       1.0 / 3.0 * m * r * r, G)
+    return wpi::math::LinearSystemId::SingleJointedArmSystem(
+               motors, 1.0 / 3.0 * m * r * r, G)
         .Slice(0);
   }();
 
diff --git a/wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp b/wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp
index 77b943ccac..a1fdd7400b 100644
--- a/wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/ProfiledPIDInputOutputTest.cpp
@@ -26,8 +26,9 @@ TEST(ProfiledPIDInputOutputTest, ContinuousInput1) {
   EXPECT_LT(controller.Calculate(kMeasurement, kGoal), 0.0);
 
   // Error must be less than half the input range at all times
-  EXPECT_LT(wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
-            180_deg);
+  EXPECT_LT(
+      wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
+      180_deg);
 }
 
 TEST(ProfiledPIDInputOutputTest, ContinuousInput2) {
@@ -46,8 +47,9 @@ TEST(ProfiledPIDInputOutputTest, ContinuousInput2) {
   EXPECT_LT(controller.Calculate(kMeasurement, kGoal), 0.0);
 
   // Error must be less than half the input range at all times
-  EXPECT_LT(wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
-            wpi::units::radian_t{std::numbers::pi});
+  EXPECT_LT(
+      wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
+      wpi::units::radian_t{std::numbers::pi});
 }
 
 TEST(ProfiledPIDInputOutputTest, ContinuousInput3) {
@@ -66,8 +68,9 @@ TEST(ProfiledPIDInputOutputTest, ContinuousInput3) {
   EXPECT_LT(controller.Calculate(kMeasurement, kGoal), 0.0);
 
   // Error must be less than half the input range at all times
-  EXPECT_LT(wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
-            wpi::units::radian_t{std::numbers::pi});
+  EXPECT_LT(
+      wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
+      wpi::units::radian_t{std::numbers::pi});
 }
 
 TEST(ProfiledPIDInputOutputTest, ContinuousInput4) {
@@ -75,8 +78,8 @@ TEST(ProfiledPIDInputOutputTest, ContinuousInput4) {
       0.0, 0.0, 0.0, {360_deg_per_s, 180_deg_per_s_sq}};
 
   controller.SetP(1);
-  controller.EnableContinuousInput(0_rad,
-                                   wpi::units::radian_t{2.0 * std::numbers::pi});
+  controller.EnableContinuousInput(
+      0_rad, wpi::units::radian_t{2.0 * std::numbers::pi});
 
   static constexpr wpi::units::radian_t kSetpoint{2.78};
   static constexpr wpi::units::radian_t kMeasurement{3.12};
@@ -86,8 +89,9 @@ TEST(ProfiledPIDInputOutputTest, ContinuousInput4) {
   EXPECT_LT(controller.Calculate(kMeasurement, kGoal), 0.0);
 
   // Error must be less than half the input range at all times
-  EXPECT_LT(wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
-            wpi::units::radian_t{std::numbers::pi});
+  EXPECT_LT(
+      wpi::units::math::abs(controller.GetSetpoint().position - kMeasurement),
+      wpi::units::radian_t{std::numbers::pi});
 }
 
 TEST(ProfiledPIDInputOutputTest, ProportionalGainOutput) {
diff --git a/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp b/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp
index 8531adc129..fe2d6a5cd9 100644
--- a/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/SimpleMotorFeedforwardTest.cpp
@@ -47,7 +47,8 @@ TEST(SimpleMotorFeedforwardTest, NegativeGains) {
   constexpr auto Kv = -3_V / 1_mps;
   constexpr auto Ka = -0.6_V / 1_mps_sq;
   constexpr wpi::units::second_t dt = 0_ms;
-  wpi::math::SimpleMotorFeedforward simpleMotor{Ks, Kv, Ka, dt};
+  wpi::math::SimpleMotorFeedforward simpleMotor{Ks, Kv, Ka,
+                                                                   dt};
   EXPECT_EQ(simpleMotor.GetKv().value(), 0);
   EXPECT_EQ(simpleMotor.GetKa().value(), 0);
   EXPECT_EQ(simpleMotor.GetDt().value(), 0.02);
diff --git a/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp b/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp
index f79cfbd40a..d447afae29 100644
--- a/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/proto/DifferentialDriveWheelVoltagesProtoTest.cpp
@@ -11,7 +11,8 @@ using namespace wpi::math;
 
 namespace {
 
-using ProtoType = wpi::util::Protobuf;
+using ProtoType =
+    wpi::util::Protobuf;
 
 const DifferentialDriveWheelVoltages kExpectedData =
     DifferentialDriveWheelVoltages{0.174_V, 0.191_V};
diff --git a/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp b/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp
index 8babb9fad9..3c4d88b08c 100644
--- a/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/proto/SimpleMotorFeedforwardProtoTest.cpp
@@ -17,7 +17,8 @@ struct SimpleMotorFeedforwardProtoTestData {
   using Type = SimpleMotorFeedforward;
 
   inline static const Type kTestData = {
-      wpi::units::volt_t{0.4}, wpi::units::volt_t{4.0} / (wpi::units::unit_t{1} / 1_s),
+      wpi::units::volt_t{0.4},
+      wpi::units::volt_t{4.0} / (wpi::units::unit_t{1} / 1_s),
       wpi::units::volt_t{0.7} / (wpi::units::unit_t{1} / 1_s / 1_s), 25_ms};
 
   static void CheckEq(const Type& testData, const Type& data) {
diff --git a/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp b/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp
index 2eeb8152fd..4af8e6e1aa 100644
--- a/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp
+++ b/wpimath/src/test/native/cpp/controller/struct/SimpleMotorFeedforwardStructTest.cpp
@@ -17,7 +17,8 @@ struct SimpleMotorFeedforwardStructTestData {
   using Type = SimpleMotorFeedforward;
 
   inline static const Type kTestData = {
-      wpi::units::volt_t{0.4}, wpi::units::volt_t{4.0} / (wpi::units::unit_t{1} / 1_s),
+      wpi::units::volt_t{0.4},
+      wpi::units::volt_t{4.0} / (wpi::units::unit_t{1} / 1_s),
       wpi::units::volt_t{0.7} / (wpi::units::unit_t{1} / 1_s / 1_s), 25_ms};
 
   static void CheckEq(const Type& testData, const Type& data) {
diff --git a/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp b/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp
index eee38e77d8..7a38ae44ad 100644
--- a/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/AngleStatisticsTest.cpp
@@ -18,8 +18,9 @@ TEST(AngleStatisticsTest, Mean) {
   Eigen::Vector3d weights;
   weights.fill(1.0 / sigmas.cols());
 
-  EXPECT_TRUE(Eigen::Vector3d(0.7333333, 0.01163323, 1)
-                  .isApprox(wpi::math::AngleMean<3, 3>(sigmas, weights, 1), 1e-3));
+  EXPECT_TRUE(
+      Eigen::Vector3d(0.7333333, 0.01163323, 1)
+          .isApprox(wpi::math::AngleMean<3, 3>(sigmas, weights, 1), 1e-3));
 }
 
 TEST(AngleStatisticsTest, Mean_DynamicSize) {
@@ -31,10 +32,11 @@ TEST(AngleStatisticsTest, Mean_DynamicSize) {
   Eigen::VectorXd weights{3};
   weights.fill(1.0 / sigmas.cols());
 
-  EXPECT_TRUE(Eigen::Vector3d(0.7333333, 0.01163323, 1)
-                  .isApprox(wpi::math::AngleMean(
-                                sigmas, weights, 1),
-                            1e-3));
+  EXPECT_TRUE(
+      Eigen::Vector3d(0.7333333, 0.01163323, 1)
+          .isApprox(wpi::math::AngleMean(
+                        sigmas, weights, 1),
+                    1e-3));
 }
 
 TEST(AngleStatisticsTest, Residual) {
@@ -57,7 +59,8 @@ TEST(AngleStatisticsTest, Add) {
   Eigen::Vector3d a{1, 1 * std::numbers::pi / 180, 2};
   Eigen::Vector3d b{1, 359 * std::numbers::pi / 180, 1};
 
-  EXPECT_TRUE(wpi::math::AngleAdd<3>(a, b, 1).isApprox(Eigen::Vector3d{2, 0, 3}));
+  EXPECT_TRUE(
+      wpi::math::AngleAdd<3>(a, b, 1).isApprox(Eigen::Vector3d{2, 0, 3}));
 }
 
 TEST(AngleStatisticsTest, Add_DynamicSize) {
diff --git a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp
index 43ce31e41c..490be7dff7 100644
--- a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimator3dTest.cpp
@@ -45,7 +45,8 @@ void testFollowTrajectory(
   wpi::units::second_t t = 0_s;
 
   std::vector> visionPoses;
-  std::vector>
+  std::vector<
+      std::tuple>
       visionLog;
 
   double maxError = -std::numeric_limits::max();
@@ -66,9 +67,10 @@ void testFollowTrajectory(
         visionPoses.back().first + kVisionUpdateRate < t) {
       auto visionPose =
           visionMeasurementGenerator(groundTruthState) +
-          wpi::math::Transform2d{wpi::math::Translation2d{distribution(generator) * 0.1_m,
-                                              distribution(generator) * 0.1_m},
-                           wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
+          wpi::math::Transform2d{
+              wpi::math::Translation2d{distribution(generator) * 0.1_m,
+                                       distribution(generator) * 0.1_m},
+              wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
       visionPoses.push_back({t, visionPose});
     }
 
@@ -92,9 +94,10 @@ void testFollowTrajectory(
 
     auto xhat = estimator.UpdateWithTime(
         t,
-        wpi::math::Rotation3d{groundTruthState.pose.Rotation() +
-                        wpi::math::Rotation2d{distribution(generator) * 0.05_rad} -
-                        trajectory.InitialPose().Rotation()},
+        wpi::math::Rotation3d{
+            groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad} -
+            trajectory.InitialPose().Rotation()},
         leftDistance, rightDistance);
 
     if (debug) {
@@ -119,7 +122,8 @@ void testFollowTrajectory(
   }
 
   if (debug) {
-    wpi::util::print("apply_time, measured_time, vision_x, vision_y, vision_theta\n");
+    wpi::util::print(
+        "apply_time, measured_time, vision_x, vision_y, vision_theta\n");
 
     wpi::units::second_t apply_time;
     wpi::units::second_t measure_time;
@@ -127,9 +131,9 @@ void testFollowTrajectory(
     for (auto record : visionLog) {
       std::tie(apply_time, measure_time, vision_pose) = record;
       wpi::util::print("{}, {}, {}, {}, {}\n", apply_time.value(),
-                 measure_time.value(), vision_pose.X().value(),
-                 vision_pose.Y().value(),
-                 vision_pose.Rotation().Radians().value());
+                       measure_time.value(), vision_pose.X().value(),
+                       vision_pose.Y().value(),
+                       vision_pose.Rotation().Radians().value());
     }
   }
 
@@ -155,49 +159,55 @@ void testFollowTrajectory(
 TEST(DifferentialDrivePoseEstimator3dTest, Accuracy) {
   wpi::math::DifferentialDriveKinematics kinematics{1.0_m};
 
-  wpi::math::DifferentialDrivePoseEstimator3d estimator{kinematics,
-                                                  wpi::math::Rotation3d{},
-                                                  0_m,
-                                                  0_m,
-                                                  wpi::math::Pose3d{},
-                                                  {0.02, 0.02, 0.02, 0.01},
-                                                  {0.1, 0.1, 0.1, 0.1}};
+  wpi::math::DifferentialDrivePoseEstimator3d estimator{
+      kinematics,
+      wpi::math::Rotation3d{},
+      0_m,
+      0_m,
+      wpi::math::Pose3d{},
+      {0.02, 0.02, 0.02, 0.01},
+      {0.1, 0.1, 0.1, 0.1}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
 
   testFollowTrajectory(
       kinematics, estimator, trajectory,
       [&](wpi::math::Trajectory::State& state) {
         return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                  state.velocity * state.curvature};
+                                        state.velocity * state.curvature};
       },
       [&](wpi::math::Trajectory::State& state) { return state.pose; },
-      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
-      100_ms, 250_ms, true, false);
+      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
+      20_ms, 100_ms, 250_ms, true, false);
 }
 
 TEST(DifferentialDrivePoseEstimator3dTest, BadInitialPose) {
   wpi::math::DifferentialDriveKinematics kinematics{1.0_m};
 
-  wpi::math::DifferentialDrivePoseEstimator3d estimator{kinematics,
-                                                  wpi::math::Rotation3d{},
-                                                  0_m,
-                                                  0_m,
-                                                  wpi::math::Pose3d{},
-                                                  {0.02, 0.02, 0.02, 0.01},
-                                                  {0.1, 0.1, 0.1, 0.1}};
+  wpi::math::DifferentialDrivePoseEstimator3d estimator{
+      kinematics,
+      wpi::math::Rotation3d{},
+      0_m,
+      0_m,
+      wpi::math::Pose3d{},
+      {0.02, 0.02, 0.02, 0.01},
+      {0.1, 0.1, 0.1, 0.1}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
 
   for (wpi::units::degree_t offset_direction_degs = 0_deg;
        offset_direction_degs < 360_deg; offset_direction_degs += 45_deg) {
@@ -206,21 +216,21 @@ TEST(DifferentialDrivePoseEstimator3dTest, BadInitialPose) {
       auto pose_offset = wpi::math::Rotation2d{offset_direction_degs};
       auto heading_offset = wpi::math::Rotation2d{offset_heading_degs};
 
-      auto initial_pose =
-          trajectory.InitialPose() +
-          wpi::math::Transform2d{wpi::math::Translation2d{pose_offset.Cos() * 1_m,
-                                              pose_offset.Sin() * 1_m},
-                           heading_offset};
+      auto initial_pose = trajectory.InitialPose() +
+                          wpi::math::Transform2d{
+                              wpi::math::Translation2d{pose_offset.Cos() * 1_m,
+                                                       pose_offset.Sin() * 1_m},
+                              heading_offset};
 
       testFollowTrajectory(
           kinematics, estimator, trajectory,
           [&](wpi::math::Trajectory::State& state) {
             return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                      state.velocity * state.curvature};
+                                            state.velocity * state.curvature};
           },
           [&](wpi::math::Trajectory::State& state) { return state.pose; },
-          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms,
-          250_ms, false, false);
+          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
+          100_ms, 250_ms, false, false);
     }
   }
 }
@@ -238,7 +248,8 @@ TEST(DifferentialDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
       wpi::math::Rotation3d{},
       0_m,
       0_m,
-      wpi::math::Pose3d{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 270_deg}},
+      wpi::math::Pose3d{1_m, 2_m, 0_m,
+                        wpi::math::Rotation3d{0_deg, 0_deg, 270_deg}},
       {0.02, 0.02, 0.02, 0.01},
       {0.1, 0.1, 0.1, 0.1}};
 
@@ -246,11 +257,16 @@ TEST(DifferentialDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
 
   for (int i = 0; i < 1000; i++) {
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{0_m, 0_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}, 0_s);
+        wpi::math::Pose3d{0_m, 0_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}},
+        0_s);
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{3_m, 1_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}}, 0_s);
+        wpi::math::Pose3d{3_m, 1_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}},
+        0_s);
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{2_m, 4_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}},
+        wpi::math::Pose3d{2_m, 4_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}},
         0_s);
   }
 
@@ -289,8 +305,13 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::DifferentialDriveKinematics kinematics{1_m};
 
   wpi::math::DifferentialDrivePoseEstimator3d estimator{
-      kinematics,           wpi::math::Rotation3d{},       0_m, 0_m, wpi::math::Pose3d{},
-      {0.1, 0.1, 0.1, 0.1}, {0.45, 0.45, 0.45, 0.45}};
+      kinematics,
+      wpi::math::Rotation3d{},
+      0_m,
+      0_m,
+      wpi::math::Pose3d{},
+      {0.1, 0.1, 0.1, 0.1},
+      {0.45, 0.45, 0.45, 0.45}};
 
   // Add enough measurements to fill up the buffer
   for (auto time = 0_s; time < 4_s; time += 20_ms) {
@@ -301,8 +322,9 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
 
   // Apply a vision measurement from 3 seconds ago
   estimator.AddVisionMeasurement(
-      wpi::math::Pose3d{10_m, 10_m, 0_m, wpi::math::Rotation3d{0_rad, 0_rad, 0.1_rad}}, 1_s,
-      {0.1, 0.1, 0.1, 0.1});
+      wpi::math::Pose3d{10_m, 10_m, 0_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 0.1_rad}},
+      1_s, {0.1, 0.1, 0.1, 0.1});
 
   EXPECT_NEAR(odometryPose.X().value(),
               estimator.GetEstimatedPosition().X().value(), 1e-6);
@@ -320,9 +342,13 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
 
 TEST(DifferentialDrivePoseEstimator3dTest, TestSampleAt) {
   wpi::math::DifferentialDriveKinematics kinematics{1_m};
-  wpi::math::DifferentialDrivePoseEstimator3d estimator{
-      kinematics,           wpi::math::Rotation3d{},   0_m, 0_m, wpi::math::Pose3d{},
-      {1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0}};
+  wpi::math::DifferentialDrivePoseEstimator3d estimator{kinematics,
+                                                        wpi::math::Rotation3d{},
+                                                        0_m,
+                                                        0_m,
+                                                        wpi::math::Pose3d{},
+                                                        {1.0, 1.0, 1.0, 1.0},
+                                                        {1.0, 1.0, 1.0, 1.0}};
 
   // Returns empty when null
   EXPECT_EQ(std::nullopt, estimator.SampleAt(1_s));
@@ -331,35 +357,45 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestSampleAt) {
   // Add a tiny tolerance for the upper bound because of floating point rounding
   // error
   for (double time = 1; time <= 2 + 1e-9; time += 0.02) {
-    estimator.UpdateWithTime(wpi::units::second_t{time}, wpi::math::Rotation3d{},
-                             wpi::units::meter_t{time}, wpi::units::meter_t{time});
+    estimator.UpdateWithTime(wpi::units::second_t{time},
+                             wpi::math::Rotation3d{}, wpi::units::meter_t{time},
+                             wpi::units::meter_t{time});
   }
 
   // Sample at an added time
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
   // Sample between updates (test interpolation)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
   // Sampling before the oldest value returns the oldest value
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(0.5_s));
   // Sampling after the newest value returns the newest value
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(2.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(2.5_s));
 
   // Add a vision measurement after the odometry measurements (while keeping all
   // of the old odometry measurements)
   estimator.AddVisionMeasurement(
-      wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}}, 2.2_s);
+      wpi::math::Pose3d{2_m, 0_m, 0_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
+      2.2_s);
 
   // Make sure nothing changed (except the newest value)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(0.5_s));
 
   // Add a vision measurement before the odometry measurements that's still in
   // the buffer
@@ -367,13 +403,17 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestSampleAt) {
       wpi::math::Pose3d{1_m, 0.2_m, 0_m, wpi::math::Rotation3d{}}, 0.9_s);
 
   // Everything should be the same except Y is 0.1 (halfway between 0 and 0.2)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(0.5_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{2_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{2_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(2.5_s));
 }
 
@@ -384,7 +424,8 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestReset) {
       wpi::math::Rotation3d{},
       0_m,
       0_m,
-      wpi::math::Pose3d{-1_m, -1_m, -1_m, wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
+      wpi::math::Pose3d{-1_m, -1_m, -1_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
       {1.0, 1.0, 1.0, 1.0},
       {1.0, 1.0, 1.0, 1.0}};
 
@@ -397,8 +438,9 @@ TEST(DifferentialDrivePoseEstimator3dTest, TestReset) {
   EXPECT_DOUBLE_EQ(1, estimator.GetEstimatedPosition().Rotation().Z().value());
 
   // Test reset position
-  estimator.ResetPosition(wpi::math::Rotation3d{}, 1_m, 1_m,
-                          wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}});
+  estimator.ResetPosition(
+      wpi::math::Rotation3d{}, 1_m, 1_m,
+      wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}});
 
   EXPECT_DOUBLE_EQ(1, estimator.GetEstimatedPosition().X().value());
   EXPECT_DOUBLE_EQ(0, estimator.GetEstimatedPosition().Y().value());
diff --git a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp
index 988a0c88b2..591fa59d57 100644
--- a/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/DifferentialDrivePoseEstimatorTest.cpp
@@ -46,7 +46,8 @@ void testFollowTrajectory(
   wpi::units::second_t t = 0_s;
 
   std::vector> visionPoses;
-  std::vector>
+  std::vector<
+      std::tuple>
       visionLog;
 
   double maxError = -std::numeric_limits::max();
@@ -67,9 +68,10 @@ void testFollowTrajectory(
         visionPoses.back().first + kVisionUpdateRate < t) {
       auto visionPose =
           visionMeasurementGenerator(groundTruthState) +
-          wpi::math::Transform2d{wpi::math::Translation2d{distribution(generator) * 0.1_m,
-                                              distribution(generator) * 0.1_m},
-                           wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
+          wpi::math::Transform2d{
+              wpi::math::Translation2d{distribution(generator) * 0.1_m,
+                                       distribution(generator) * 0.1_m},
+              wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
       visionPoses.push_back({t, visionPose});
     }
 
@@ -119,7 +121,8 @@ void testFollowTrajectory(
   }
 
   if (debug) {
-    wpi::util::print("apply_time, measured_time, vision_x, vision_y, vision_theta\n");
+    wpi::util::print(
+        "apply_time, measured_time, vision_x, vision_y, vision_theta\n");
 
     wpi::units::second_t apply_time;
     wpi::units::second_t measure_time;
@@ -127,9 +130,9 @@ void testFollowTrajectory(
     for (auto record : visionLog) {
       std::tie(apply_time, measure_time, vision_pose) = record;
       wpi::util::print("{}, {}, {}, {}, {}\n", apply_time.value(),
-                 measure_time.value(), vision_pose.X().value(),
-                 vision_pose.Y().value(),
-                 vision_pose.Rotation().Radians().value());
+                       measure_time.value(), vision_pose.X().value(),
+                       vision_pose.Y().value(),
+                       vision_pose.Rotation().Radians().value());
     }
   }
 
@@ -151,41 +154,53 @@ void testFollowTrajectory(
 TEST(DifferentialDrivePoseEstimatorTest, Accuracy) {
   wpi::math::DifferentialDriveKinematics kinematics{1.0_m};
 
-  wpi::math::DifferentialDrivePoseEstimator estimator{
-      kinematics,         wpi::math::Rotation2d{}, 0_m, 0_m, wpi::math::Pose2d{},
-      {0.02, 0.02, 0.01}, {0.1, 0.1, 0.1}};
+  wpi::math::DifferentialDrivePoseEstimator estimator{kinematics,
+                                                      wpi::math::Rotation2d{},
+                                                      0_m,
+                                                      0_m,
+                                                      wpi::math::Pose2d{},
+                                                      {0.02, 0.02, 0.01},
+                                                      {0.1, 0.1, 0.1}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
 
   testFollowTrajectory(
       kinematics, estimator, trajectory,
       [&](wpi::math::Trajectory::State& state) {
         return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                  state.velocity * state.curvature};
+                                        state.velocity * state.curvature};
       },
       [&](wpi::math::Trajectory::State& state) { return state.pose; },
-      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
-      100_ms, 250_ms, true, false);
+      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
+      20_ms, 100_ms, 250_ms, true, false);
 }
 
 TEST(DifferentialDrivePoseEstimatorTest, BadInitialPose) {
   wpi::math::DifferentialDriveKinematics kinematics{1.0_m};
 
-  wpi::math::DifferentialDrivePoseEstimator estimator{
-      kinematics,         wpi::math::Rotation2d{}, 0_m, 0_m, wpi::math::Pose2d{},
-      {0.02, 0.02, 0.01}, {0.1, 0.1, 0.1}};
+  wpi::math::DifferentialDrivePoseEstimator estimator{kinematics,
+                                                      wpi::math::Rotation2d{},
+                                                      0_m,
+                                                      0_m,
+                                                      wpi::math::Pose2d{},
+                                                      {0.02, 0.02, 0.01},
+                                                      {0.1, 0.1, 0.1}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2_mps_sq));
 
   for (wpi::units::degree_t offset_direction_degs = 0_deg;
        offset_direction_degs < 360_deg; offset_direction_degs += 45_deg) {
@@ -194,21 +209,21 @@ TEST(DifferentialDrivePoseEstimatorTest, BadInitialPose) {
       auto pose_offset = wpi::math::Rotation2d{offset_direction_degs};
       auto heading_offset = wpi::math::Rotation2d{offset_heading_degs};
 
-      auto initial_pose =
-          trajectory.InitialPose() +
-          wpi::math::Transform2d{wpi::math::Translation2d{pose_offset.Cos() * 1_m,
-                                              pose_offset.Sin() * 1_m},
-                           heading_offset};
+      auto initial_pose = trajectory.InitialPose() +
+                          wpi::math::Transform2d{
+                              wpi::math::Translation2d{pose_offset.Cos() * 1_m,
+                                                       pose_offset.Sin() * 1_m},
+                              heading_offset};
 
       testFollowTrajectory(
           kinematics, estimator, trajectory,
           [&](wpi::math::Trajectory::State& state) {
             return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                      state.velocity * state.curvature};
+                                            state.velocity * state.curvature};
           },
           [&](wpi::math::Trajectory::State& state) { return state.pose; },
-          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms,
-          250_ms, false, false);
+          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
+          100_ms, 250_ms, false, false);
     }
   }
 }
@@ -285,7 +300,8 @@ TEST(DifferentialDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
 
   // Apply a vision measurement from 3 seconds ago
   estimator.AddVisionMeasurement(
-      wpi::math::Pose2d{wpi::math::Translation2d{10_m, 10_m}, wpi::math::Rotation2d{0.1_rad}},
+      wpi::math::Pose2d{wpi::math::Translation2d{10_m, 10_m},
+                        wpi::math::Rotation2d{0.1_rad}},
       1_s, {0.1, 0.1, 0.1});
 
   EXPECT_NEAR(odometryPose.X().value(),
@@ -310,16 +326,19 @@ TEST(DifferentialDrivePoseEstimatorTest, TestSampleAt) {
   // Add a tiny tolerance for the upper bound because of floating point rounding
   // error
   for (double time = 1; time <= 2 + 1e-9; time += 0.02) {
-    estimator.UpdateWithTime(wpi::units::second_t{time}, wpi::math::Rotation2d{},
-                             wpi::units::meter_t{time}, wpi::units::meter_t{time});
+    estimator.UpdateWithTime(wpi::units::second_t{time},
+                             wpi::math::Rotation2d{}, wpi::units::meter_t{time},
+                             wpi::units::meter_t{time});
   }
 
   // Sample at an added time
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
   // Sample between updates (test interpolation)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
   // Sampling before the oldest value returns the oldest value
   EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0_m, wpi::math::Rotation2d{}}),
             estimator.SampleAt(0.5_s));
@@ -329,31 +348,37 @@ TEST(DifferentialDrivePoseEstimatorTest, TestSampleAt) {
 
   // Add a vision measurement after the odometry measurements (while keeping all
   // of the old odometry measurements)
-  estimator.AddVisionMeasurement(wpi::math::Pose2d{2_m, 0_m, wpi::math::Rotation2d{1_rad}},
-                                 2.2_s);
+  estimator.AddVisionMeasurement(
+      wpi::math::Pose2d{2_m, 0_m, wpi::math::Rotation2d{1_rad}}, 2.2_s);
 
   // Make sure nothing changed (except the newest value)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
   EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0_m, wpi::math::Rotation2d{}}),
             estimator.SampleAt(0.5_s));
 
   // Add a vision measurement before the odometry measurements that's still in
   // the buffer
-  estimator.AddVisionMeasurement(wpi::math::Pose2d{1_m, 0.2_m, wpi::math::Rotation2d{}},
-                                 0.9_s);
+  estimator.AddVisionMeasurement(
+      wpi::math::Pose2d{1_m, 0.2_m, wpi::math::Rotation2d{}}, 0.9_s);
 
   // Everything should be the same except Y is 0.1 (halfway between 0 and 0.2)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(0.5_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{2_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(2.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{2_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(2.5_s));
 }
 
 TEST(DifferentialDrivePoseEstimatorTest, TestReset) {
diff --git a/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp b/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp
index 9af0aedb81..83c2ad3875 100644
--- a/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/ExtendedKalmanFilterTest.cpp
@@ -18,7 +18,8 @@
 
 namespace {
 
-wpi::math::Vectord<5> Dynamics(const wpi::math::Vectord<5>& x, const wpi::math::Vectord<2>& u) {
+wpi::math::Vectord<5> Dynamics(const wpi::math::Vectord<5>& x,
+                               const wpi::math::Vectord<2>& u) {
   auto motors = wpi::math::DCMotor::CIM(2);
 
   // constexpr double Glow = 15.32;       // Low gear ratio
@@ -50,12 +51,14 @@ wpi::math::Vectord<5> Dynamics(const wpi::math::Vectord<5>& x, const wpi::math::
 }
 
 wpi::math::Vectord<3> LocalMeasurementModel(
-    const wpi::math::Vectord<5>& x, [[maybe_unused]] const wpi::math::Vectord<2>& u) {
+    const wpi::math::Vectord<5>& x,
+    [[maybe_unused]] const wpi::math::Vectord<2>& u) {
   return wpi::math::Vectord<3>{x(2), x(3), x(4)};
 }
 
 wpi::math::Vectord<5> GlobalMeasurementModel(
-    const wpi::math::Vectord<5>& x, [[maybe_unused]] const wpi::math::Vectord<2>& u) {
+    const wpi::math::Vectord<5>& x,
+    [[maybe_unused]] const wpi::math::Vectord<2>& u) {
   return wpi::math::Vectord<5>{x(0), x(1), x(2), x(3), x(4)};
 }
 }  // namespace
@@ -64,10 +67,10 @@ TEST(ExtendedKalmanFilterTest, Init) {
   constexpr wpi::units::second_t dt = 5_ms;
 
   wpi::math::ExtendedKalmanFilter<5, 2, 3> observer{Dynamics,
-                                              LocalMeasurementModel,
-                                              {0.5, 0.5, 10.0, 1.0, 1.0},
-                                              {0.0001, 0.01, 0.01},
-                                              dt};
+                                                    LocalMeasurementModel,
+                                                    {0.5, 0.5, 10.0, 1.0, 1.0},
+                                                    {0.0001, 0.01, 0.01},
+                                                    dt};
   wpi::math::Vectord<2> u{12.0, 12.0};
   observer.Predict(u, dt);
 
@@ -84,22 +87,22 @@ TEST(ExtendedKalmanFilterTest, Convergence) {
   constexpr auto rb = 0.8382_m / 2.0;  // Robot radius
 
   wpi::math::ExtendedKalmanFilter<5, 2, 3> observer{Dynamics,
-                                              LocalMeasurementModel,
-                                              {0.5, 0.5, 10.0, 1.0, 1.0},
-                                              {0.0001, 0.5, 0.5},
-                                              dt};
+                                                    LocalMeasurementModel,
+                                                    {0.5, 0.5, 10.0, 1.0, 1.0},
+                                                    {0.0001, 0.5, 0.5},
+                                                    dt};
 
-  auto waypoints =
-      std::vector{wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
-                               wpi::math::Pose2d{24.73_m, 19.68_m, 5.846_rad}};
+  auto waypoints = std::vector{
+      wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
+      wpi::math::Pose2d{24.73_m, 19.68_m, 5.846_rad}};
   auto trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
       waypoints, {8.8_mps, 0.1_mps_sq});
 
   wpi::math::Vectord<5> r = wpi::math::Vectord<5>::Zero();
   wpi::math::Vectord<2> u = wpi::math::Vectord<2>::Zero();
 
-  auto B = wpi::math::NumericalJacobianU<5, 5, 2>(Dynamics, wpi::math::Vectord<5>::Zero(),
-                                            wpi::math::Vectord<2>::Zero());
+  auto B = wpi::math::NumericalJacobianU<5, 5, 2>(
+      Dynamics, wpi::math::Vectord<5>::Zero(), wpi::math::Vectord<2>::Zero());
 
   observer.SetXhat(wpi::math::Vectord<5>{
       trajectory.InitialPose().Translation().X().value(),
@@ -119,10 +122,12 @@ TEST(ExtendedKalmanFilterTest, Convergence) {
         ref.pose.Rotation().Radians().value(), vl.value(), vr.value()};
 
     auto localY = LocalMeasurementModel(nextR, wpi::math::Vectord<2>::Zero());
-    observer.Correct(u, localY + wpi::math::MakeWhiteNoiseVector(0.0001, 0.5, 0.5));
+    observer.Correct(
+        u, localY + wpi::math::MakeWhiteNoiseVector(0.0001, 0.5, 0.5));
 
     wpi::math::Vectord<5> rdot = (nextR - r) / dt.value();
-    u = B.householderQr().solve(rdot - Dynamics(r, wpi::math::Vectord<2>::Zero()));
+    u = B.householderQr().solve(rdot -
+                                Dynamics(r, wpi::math::Vectord<2>::Zero()));
 
     observer.Predict(u, dt);
 
diff --git a/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp b/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp
index 9fabc5479d..21366f928a 100644
--- a/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/KalmanFilterTest.cpp
@@ -16,6 +16,7 @@
 
 TEST(KalmanFilterTest, Flywheel) {
   auto motor = wpi::math::DCMotor::NEO();
-  auto flywheel = wpi::math::LinearSystemId::FlywheelSystem(motor, 1_kg_sq_m, 1.0);
+  auto flywheel =
+      wpi::math::LinearSystemId::FlywheelSystem(motor, 1_kg_sq_m, 1.0);
   wpi::math::KalmanFilter<1, 1, 1> kf{flywheel, {1}, {1}, 5_ms};
 }
diff --git a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp
index 5dbd7eff32..52c19139c2 100644
--- a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimator3dTest.cpp
@@ -38,14 +38,16 @@ void testFollowTrajectory(
   wpi::units::second_t t = 0_s;
 
   std::vector> visionPoses;
-  std::vector>
+  std::vector<
+      std::tuple>
       visionLog;
 
   double maxError = -std::numeric_limits::max();
   double errorSum = 0;
 
   if (debug) {
-    wpi::util::print("time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
+    wpi::util::print(
+        "time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
   }
 
   while (t < trajectory.TotalTime()) {
@@ -57,9 +59,10 @@ void testFollowTrajectory(
         visionPoses.back().first + kVisionUpdateRate < t) {
       auto visionPose =
           visionMeasurementGenerator(groundTruthState) +
-          wpi::math::Transform2d{wpi::math::Translation2d{distribution(generator) * 0.1_m,
-                                              distribution(generator) * 0.1_m},
-                           wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
+          wpi::math::Transform2d{
+              wpi::math::Translation2d{distribution(generator) * 0.1_m,
+                                       distribution(generator) * 0.1_m},
+              wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
       visionPoses.push_back({t, visionPose});
     }
 
@@ -85,9 +88,10 @@ void testFollowTrajectory(
 
     auto xhat = estimator.UpdateWithTime(
         t,
-        wpi::math::Rotation3d{groundTruthState.pose.Rotation() +
-                        wpi::math::Rotation2d{distribution(generator) * 0.05_rad} -
-                        trajectory.InitialPose().Rotation()},
+        wpi::math::Rotation3d{
+            groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad} -
+            trajectory.InitialPose().Rotation()},
         wheelPositions);
 
     if (debug) {
@@ -111,7 +115,8 @@ void testFollowTrajectory(
   }
 
   if (debug) {
-    wpi::util::print("apply_time, measured_time, vision_x, vision_y, vision_theta\n");
+    wpi::util::print(
+        "apply_time, measured_time, vision_x, vision_y, vision_theta\n");
 
     wpi::units::second_t apply_time;
     wpi::units::second_t measure_time;
@@ -119,9 +124,9 @@ void testFollowTrajectory(
     for (auto record : visionLog) {
       std::tie(apply_time, measure_time, vision_pose) = record;
       wpi::util::print("{}, {}, {}, {}, {}\n", apply_time.value(),
-                 measure_time.value(), vision_pose.X().value(),
-                 vision_pose.Y().value(),
-                 vision_pose.Rotation().Radians().value());
+                       measure_time.value(), vision_pose.X().value(),
+                       vision_pose.Y().value(),
+                       vision_pose.Rotation().Radians().value());
     }
   }
 
@@ -147,49 +152,55 @@ void testFollowTrajectory(
 TEST(MecanumDrivePoseEstimator3dTest, AccuracyFacingTrajectory) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
   wpi::math::MecanumDrivePoseEstimator3d estimator{
-      kinematics,    wpi::math::Rotation3d{},    wheelPositions,
-      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1}, {0.45, 0.45, 0.45, 0.45}};
+      kinematics,          wpi::math::Rotation3d{}, wheelPositions,
+      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1},    {0.45, 0.45, 0.45, 0.45}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
 
   testFollowTrajectory(
       kinematics, estimator, trajectory,
       [&](wpi::math::Trajectory::State& state) {
         return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                  state.velocity * state.curvature};
+                                        state.velocity * state.curvature};
       },
       [&](wpi::math::Trajectory::State& state) { return state.pose; },
-      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
-      100_ms, 250_ms, true, false);
+      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
+      20_ms, 100_ms, 250_ms, true, false);
 }
 
 TEST(MecanumDrivePoseEstimator3dTest, BadInitialPose) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
   wpi::math::MecanumDrivePoseEstimator3d estimator{
-      kinematics,    wpi::math::Rotation3d{},    wheelPositions,
-      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1}, {0.45, 0.45, 0.45, 0.1}};
+      kinematics,          wpi::math::Rotation3d{}, wheelPositions,
+      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1},    {0.45, 0.45, 0.45, 0.1}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
 
   for (wpi::units::degree_t offset_direction_degs = 0_deg;
        offset_direction_degs < 360_deg; offset_direction_degs += 45_deg) {
@@ -198,21 +209,21 @@ TEST(MecanumDrivePoseEstimator3dTest, BadInitialPose) {
       auto pose_offset = wpi::math::Rotation2d{offset_direction_degs};
       auto heading_offset = wpi::math::Rotation2d{offset_heading_degs};
 
-      auto initial_pose =
-          trajectory.InitialPose() +
-          wpi::math::Transform2d{wpi::math::Translation2d{pose_offset.Cos() * 1_m,
-                                              pose_offset.Sin() * 1_m},
-                           heading_offset};
+      auto initial_pose = trajectory.InitialPose() +
+                          wpi::math::Transform2d{
+                              wpi::math::Translation2d{pose_offset.Cos() * 1_m,
+                                                       pose_offset.Sin() * 1_m},
+                              heading_offset};
 
       testFollowTrajectory(
           kinematics, estimator, trajectory,
           [&](wpi::math::Trajectory::State& state) {
             return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                      state.velocity * state.curvature};
+                                            state.velocity * state.curvature};
           },
           [&](wpi::math::Trajectory::State& state) { return state.pose; },
-          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms,
-          250_ms, false, false);
+          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
+          100_ms, 250_ms, false, false);
     }
   }
 }
@@ -225,7 +236,8 @@ TEST(MecanumDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
   // pose would converge to that measurement.
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
@@ -233,7 +245,8 @@ TEST(MecanumDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
       kinematics,
       wpi::math::Rotation3d{},
       wheelPositions,
-      wpi::math::Pose3d{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 270_deg}},
+      wpi::math::Pose3d{1_m, 2_m, 0_m,
+                        wpi::math::Rotation3d{0_deg, 0_deg, 270_deg}},
       {0.1, 0.1, 0.1, 0.1},
       {0.45, 0.45, 0.45, 0.1}};
 
@@ -241,11 +254,16 @@ TEST(MecanumDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
 
   for (int i = 0; i < 1000; i++) {
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{0_m, 0_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}, 0_s);
+        wpi::math::Pose3d{0_m, 0_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}},
+        0_s);
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{3_m, 1_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}}, 0_s);
+        wpi::math::Pose3d{3_m, 1_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}},
+        0_s);
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{2_m, 4_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}},
+        wpi::math::Pose3d{2_m, 4_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}},
         0_s);
   }
 
@@ -283,11 +301,16 @@ TEST(MecanumDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
 TEST(MecanumDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDrivePoseEstimator3d estimator{
-      kinematics,    wpi::math::Rotation3d{},    wpi::math::MecanumDriveWheelPositions{},
-      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1}, {0.45, 0.45, 0.45, 0.45}};
+      kinematics,
+      wpi::math::Rotation3d{},
+      wpi::math::MecanumDriveWheelPositions{},
+      wpi::math::Pose3d{},
+      {0.1, 0.1, 0.1, 0.1},
+      {0.45, 0.45, 0.45, 0.45}};
 
   // Add enough measurements to fill up the buffer
   for (auto time = 0_s; time < 4_s; time += 20_ms) {
@@ -299,8 +322,9 @@ TEST(MecanumDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
 
   // Apply a vision measurement from 3 seconds ago
   estimator.AddVisionMeasurement(
-      wpi::math::Pose3d{10_m, 10_m, 0_m, wpi::math::Rotation3d{0_rad, 0_rad, 0.1_rad}}, 1_s,
-      {0.1, 0.1, 0.1, 0.1});
+      wpi::math::Pose3d{10_m, 10_m, 0_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 0.1_rad}},
+      1_s, {0.1, 0.1, 0.1, 0.1});
 
   EXPECT_NEAR(odometryPose.X().value(),
               estimator.GetEstimatedPosition().X().value(), 1e-6);
@@ -319,10 +343,15 @@ TEST(MecanumDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
 TEST(MecanumDrivePoseEstimator3dTest, TestSampleAt) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::MecanumDrivePoseEstimator3d estimator{
-      kinematics,    wpi::math::Rotation3d{},    wpi::math::MecanumDriveWheelPositions{},
-      wpi::math::Pose3d{}, {1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0}};
+      kinematics,
+      wpi::math::Rotation3d{},
+      wpi::math::MecanumDriveWheelPositions{},
+      wpi::math::Pose3d{},
+      {1.0, 1.0, 1.0, 1.0},
+      {1.0, 1.0, 1.0, 1.0}};
 
   // Returns empty when null
   EXPECT_EQ(std::nullopt, estimator.SampleAt(1_s));
@@ -332,37 +361,46 @@ TEST(MecanumDrivePoseEstimator3dTest, TestSampleAt) {
   // error
   for (double time = 1; time <= 2 + 1e-9; time += 0.02) {
     wpi::math::MecanumDriveWheelPositions wheelPositions{
-        wpi::units::meter_t{time}, wpi::units::meter_t{time}, wpi::units::meter_t{time},
-        wpi::units::meter_t{time}};
-    estimator.UpdateWithTime(wpi::units::second_t{time}, wpi::math::Rotation3d{},
-                             wheelPositions);
+        wpi::units::meter_t{time}, wpi::units::meter_t{time},
+        wpi::units::meter_t{time}, wpi::units::meter_t{time}};
+    estimator.UpdateWithTime(wpi::units::second_t{time},
+                             wpi::math::Rotation3d{}, wheelPositions);
   }
 
   // Sample at an added time
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
   // Sample between updates (test interpolation)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
   // Sampling before the oldest value returns the oldest value
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(0.5_s));
   // Sampling after the newest value returns the newest value
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(2.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(2.5_s));
 
   // Add a vision measurement after the odometry measurements (while keeping all
   // of the old odometry measurements)
   estimator.AddVisionMeasurement(
-      wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}}, 2.2_s);
+      wpi::math::Pose3d{2_m, 0_m, 0_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
+      2.2_s);
 
   // Make sure nothing changed (except the newest value)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(0.5_s));
 
   // Add a vision measurement before the odometry measurements that's still in
   // the buffer
@@ -370,25 +408,31 @@ TEST(MecanumDrivePoseEstimator3dTest, TestSampleAt) {
       wpi::math::Pose3d{1_m, 0.2_m, 0_m, wpi::math::Rotation3d{}}, 0.9_s);
 
   // Everything should be the same except Y is 0.1 (halfway between 0 and 0.2)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(0.5_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{2_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{2_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(2.5_s));
 }
 
 TEST(MecanumDrivePoseEstimator3dTest, TestReset) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::MecanumDrivePoseEstimator3d estimator{
       kinematics,
       wpi::math::Rotation3d{},
       wpi::math::MecanumDriveWheelPositions{},
-      wpi::math::Pose3d{-1_m, -1_m, -1_m, wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
+      wpi::math::Pose3d{-1_m, -1_m, -1_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
       {1.0, 1.0, 1.0, 1.0},
       {1.0, 1.0, 1.0, 1.0}};
 
@@ -401,8 +445,9 @@ TEST(MecanumDrivePoseEstimator3dTest, TestReset) {
   EXPECT_DOUBLE_EQ(1, estimator.GetEstimatedPosition().Rotation().Z().value());
 
   // Test reset position
-  estimator.ResetPosition(wpi::math::Rotation3d{}, {1_m, 1_m, 1_m, 1_m},
-                          wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}});
+  estimator.ResetPosition(
+      wpi::math::Rotation3d{}, {1_m, 1_m, 1_m, 1_m},
+      wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}});
 
   EXPECT_DOUBLE_EQ(1, estimator.GetEstimatedPosition().X().value());
   EXPECT_DOUBLE_EQ(0, estimator.GetEstimatedPosition().Y().value());
diff --git a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp
index a305bc0bd2..aea20babc3 100644
--- a/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/MecanumDrivePoseEstimatorTest.cpp
@@ -30,7 +30,8 @@ void testFollowTrajectory(
     const bool debug) {
   wpi::math::MecanumDriveWheelPositions wheelPositions{};
 
-  estimator.ResetPosition(wpi::math::Rotation2d{}, wheelPositions, startingPose);
+  estimator.ResetPosition(wpi::math::Rotation2d{}, wheelPositions,
+                          startingPose);
 
   std::default_random_engine generator;
   std::normal_distribution distribution(0.0, 1.0);
@@ -38,14 +39,16 @@ void testFollowTrajectory(
   wpi::units::second_t t = 0_s;
 
   std::vector> visionPoses;
-  std::vector>
+  std::vector<
+      std::tuple>
       visionLog;
 
   double maxError = -std::numeric_limits::max();
   double errorSum = 0;
 
   if (debug) {
-    wpi::util::print("time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
+    wpi::util::print(
+        "time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
   }
 
   while (t < trajectory.TotalTime()) {
@@ -57,9 +60,10 @@ void testFollowTrajectory(
         visionPoses.back().first + kVisionUpdateRate < t) {
       auto visionPose =
           visionMeasurementGenerator(groundTruthState) +
-          wpi::math::Transform2d{wpi::math::Translation2d{distribution(generator) * 0.1_m,
-                                              distribution(generator) * 0.1_m},
-                           wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
+          wpi::math::Transform2d{
+              wpi::math::Translation2d{distribution(generator) * 0.1_m,
+                                       distribution(generator) * 0.1_m},
+              wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
       visionPoses.push_back({t, visionPose});
     }
 
@@ -90,11 +94,11 @@ void testFollowTrajectory(
         wheelPositions);
 
     if (debug) {
-      wpi::util::print("{}, {}, {}, {}, {}, {}, {}\n", t.value(), xhat.X().value(),
-                 xhat.Y().value(), xhat.Rotation().Radians().value(),
-                 groundTruthState.pose.X().value(),
-                 groundTruthState.pose.Y().value(),
-                 groundTruthState.pose.Rotation().Radians().value());
+      wpi::util::print(
+          "{}, {}, {}, {}, {}, {}, {}\n", t.value(), xhat.X().value(),
+          xhat.Y().value(), xhat.Rotation().Radians().value(),
+          groundTruthState.pose.X().value(), groundTruthState.pose.Y().value(),
+          groundTruthState.pose.Rotation().Radians().value());
     }
 
     double error = groundTruthState.pose.Translation()
@@ -110,7 +114,8 @@ void testFollowTrajectory(
   }
 
   if (debug) {
-    wpi::util::print("apply_time, measured_time, vision_x, vision_y, vision_theta\n");
+    wpi::util::print(
+        "apply_time, measured_time, vision_x, vision_y, vision_theta\n");
 
     wpi::units::second_t apply_time;
     wpi::units::second_t measure_time;
@@ -118,9 +123,9 @@ void testFollowTrajectory(
     for (auto record : visionLog) {
       std::tie(apply_time, measure_time, vision_pose) = record;
       wpi::util::print("{}, {}, {}, {}, {}\n", apply_time.value(),
-                 measure_time.value(), vision_pose.X().value(),
-                 vision_pose.Y().value(),
-                 vision_pose.Rotation().Radians().value());
+                       measure_time.value(), vision_pose.X().value(),
+                       vision_pose.Y().value(),
+                       vision_pose.Rotation().Radians().value());
     }
   }
 
@@ -142,49 +147,55 @@ void testFollowTrajectory(
 TEST(MecanumDrivePoseEstimatorTest, AccuracyFacingTrajectory) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
-  wpi::math::MecanumDrivePoseEstimator estimator{kinematics,      wpi::math::Rotation2d{},
-                                           wheelPositions,  wpi::math::Pose2d{},
-                                           {0.1, 0.1, 0.1}, {0.45, 0.45, 0.45}};
+  wpi::math::MecanumDrivePoseEstimator estimator{
+      kinematics,          wpi::math::Rotation2d{}, wheelPositions,
+      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},         {0.45, 0.45, 0.45}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
 
   testFollowTrajectory(
       kinematics, estimator, trajectory,
       [&](wpi::math::Trajectory::State& state) {
         return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                  state.velocity * state.curvature};
+                                        state.velocity * state.curvature};
       },
       [&](wpi::math::Trajectory::State& state) { return state.pose; },
-      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
-      100_ms, 250_ms, true, false);
+      trajectory.InitialPose(), {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
+      20_ms, 100_ms, 250_ms, true, false);
 }
 
 TEST(MecanumDrivePoseEstimatorTest, BadInitialPose) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
-  wpi::math::MecanumDrivePoseEstimator estimator{kinematics,      wpi::math::Rotation2d{},
-                                           wheelPositions,  wpi::math::Pose2d{},
-                                           {0.1, 0.1, 0.1}, {0.45, 0.45, 0.1}};
+  wpi::math::MecanumDrivePoseEstimator estimator{
+      kinematics,          wpi::math::Rotation2d{}, wheelPositions,
+      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},         {0.45, 0.45, 0.1}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2.0_mps, 2.0_mps_sq));
 
   for (wpi::units::degree_t offset_direction_degs = 0_deg;
        offset_direction_degs < 360_deg; offset_direction_degs += 45_deg) {
@@ -193,21 +204,21 @@ TEST(MecanumDrivePoseEstimatorTest, BadInitialPose) {
       auto pose_offset = wpi::math::Rotation2d{offset_direction_degs};
       auto heading_offset = wpi::math::Rotation2d{offset_heading_degs};
 
-      auto initial_pose =
-          trajectory.InitialPose() +
-          wpi::math::Transform2d{wpi::math::Translation2d{pose_offset.Cos() * 1_m,
-                                              pose_offset.Sin() * 1_m},
-                           heading_offset};
+      auto initial_pose = trajectory.InitialPose() +
+                          wpi::math::Transform2d{
+                              wpi::math::Translation2d{pose_offset.Cos() * 1_m,
+                                                       pose_offset.Sin() * 1_m},
+                              heading_offset};
 
       testFollowTrajectory(
           kinematics, estimator, trajectory,
           [&](wpi::math::Trajectory::State& state) {
             return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                      state.velocity * state.curvature};
+                                            state.velocity * state.curvature};
           },
           [&](wpi::math::Trajectory::State& state) { return state.pose; },
-          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms,
-          250_ms, false, false);
+          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
+          100_ms, 250_ms, false, false);
     }
   }
 }
@@ -220,14 +231,18 @@ TEST(MecanumDrivePoseEstimatorTest, SimultaneousVisionMeasurements) {
   // pose would converge to that measurement.
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
   wpi::math::MecanumDrivePoseEstimator estimator{
-      kinematics,      wpi::math::Rotation2d{},
-      wheelPositions,  wpi::math::Pose2d{1_m, 2_m, wpi::math::Rotation2d{270_deg}},
-      {0.1, 0.1, 0.1}, {0.45, 0.45, 0.1}};
+      kinematics,
+      wpi::math::Rotation2d{},
+      wheelPositions,
+      wpi::math::Pose2d{1_m, 2_m, wpi::math::Rotation2d{270_deg}},
+      {0.1, 0.1, 0.1},
+      {0.45, 0.45, 0.1}};
 
   estimator.UpdateWithTime(0_s, wpi::math::Rotation2d{}, wheelPositions);
 
@@ -271,11 +286,16 @@ TEST(MecanumDrivePoseEstimatorTest, SimultaneousVisionMeasurements) {
 TEST(MecanumDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDrivePoseEstimator estimator{
-      kinematics,    wpi::math::Rotation2d{}, wpi::math::MecanumDriveWheelPositions{},
-      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},   {0.45, 0.45, 0.45}};
+      kinematics,
+      wpi::math::Rotation2d{},
+      wpi::math::MecanumDriveWheelPositions{},
+      wpi::math::Pose2d{},
+      {0.1, 0.1, 0.1},
+      {0.45, 0.45, 0.45}};
 
   // Add enough measurements to fill up the buffer
   for (auto time = 0_s; time < 4_s; time += 20_ms) {
@@ -287,7 +307,8 @@ TEST(MecanumDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
 
   // Apply a vision measurement from 3 seconds ago
   estimator.AddVisionMeasurement(
-      wpi::math::Pose2d{wpi::math::Translation2d{10_m, 10_m}, wpi::math::Rotation2d{0.1_rad}},
+      wpi::math::Pose2d{wpi::math::Translation2d{10_m, 10_m},
+                        wpi::math::Rotation2d{0.1_rad}},
       1_s, {0.1, 0.1, 0.1});
 
   EXPECT_NEAR(odometryPose.X().value(),
@@ -302,10 +323,15 @@ TEST(MecanumDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
 TEST(MecanumDrivePoseEstimatorTest, TestSampleAt) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::MecanumDrivePoseEstimator estimator{
-      kinematics,    wpi::math::Rotation2d{}, wpi::math::MecanumDriveWheelPositions{},
-      wpi::math::Pose2d{}, {1.0, 1.0, 1.0},   {1.0, 1.0, 1.0}};
+      kinematics,
+      wpi::math::Rotation2d{},
+      wpi::math::MecanumDriveWheelPositions{},
+      wpi::math::Pose2d{},
+      {1.0, 1.0, 1.0},
+      {1.0, 1.0, 1.0}};
 
   // Returns empty when null
   EXPECT_EQ(std::nullopt, estimator.SampleAt(1_s));
@@ -315,18 +341,20 @@ TEST(MecanumDrivePoseEstimatorTest, TestSampleAt) {
   // error
   for (double time = 1; time <= 2 + 1e-9; time += 0.02) {
     wpi::math::MecanumDriveWheelPositions wheelPositions{
-        wpi::units::meter_t{time}, wpi::units::meter_t{time}, wpi::units::meter_t{time},
-        wpi::units::meter_t{time}};
-    estimator.UpdateWithTime(wpi::units::second_t{time}, wpi::math::Rotation2d{},
-                             wheelPositions);
+        wpi::units::meter_t{time}, wpi::units::meter_t{time},
+        wpi::units::meter_t{time}, wpi::units::meter_t{time}};
+    estimator.UpdateWithTime(wpi::units::second_t{time},
+                             wpi::math::Rotation2d{}, wheelPositions);
   }
 
   // Sample at an added time
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
   // Sample between updates (test interpolation)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
   // Sampling before the oldest value returns the oldest value
   EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0_m, wpi::math::Rotation2d{}}),
             estimator.SampleAt(0.5_s));
@@ -336,37 +364,44 @@ TEST(MecanumDrivePoseEstimatorTest, TestSampleAt) {
 
   // Add a vision measurement after the odometry measurements (while keeping all
   // of the old odometry measurements)
-  estimator.AddVisionMeasurement(wpi::math::Pose2d{2_m, 0_m, wpi::math::Rotation2d{1_rad}},
-                                 2.2_s);
+  estimator.AddVisionMeasurement(
+      wpi::math::Pose2d{2_m, 0_m, wpi::math::Rotation2d{1_rad}}, 2.2_s);
 
   // Make sure nothing changed (except the newest value)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
   EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0_m, wpi::math::Rotation2d{}}),
             estimator.SampleAt(0.5_s));
 
   // Add a vision measurement before the odometry measurements that's still in
   // the buffer
-  estimator.AddVisionMeasurement(wpi::math::Pose2d{1_m, 0.2_m, wpi::math::Rotation2d{}},
-                                 0.9_s);
+  estimator.AddVisionMeasurement(
+      wpi::math::Pose2d{1_m, 0.2_m, wpi::math::Rotation2d{}}, 0.9_s);
 
   // Everything should be the same except Y is 0.1 (halfway between 0 and 0.2)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(0.5_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{2_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(2.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{2_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(2.5_s));
 }
 
 TEST(MecanumDrivePoseEstimatorTest, TestReset) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::MecanumDrivePoseEstimator estimator{
       kinematics,
       wpi::math::Rotation2d{},
diff --git a/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp b/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp
index ef3ed99e6e..698974d46a 100644
--- a/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp
@@ -9,11 +9,13 @@
 TEST(MerweScaledSigmaPointsTest, ZeroMean) {
   wpi::math::MerweScaledSigmaPoints<2> sigmaPoints;
   auto points = sigmaPoints.SquareRootSigmaPoints(
-      wpi::math::Vectord<2>{0.0, 0.0}, wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}});
+      wpi::math::Vectord<2>{0.0, 0.0},
+      wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}});
 
   EXPECT_TRUE(
-      (points - wpi::math::Matrixd<2, 5>{{0.0, 0.00173205, 0.0, -0.00173205, 0.0},
-                                   {0.0, 0.0, 0.00173205, 0.0, -0.00173205}})
+      (points -
+       wpi::math::Matrixd<2, 5>{{0.0, 0.00173205, 0.0, -0.00173205, 0.0},
+                                {0.0, 0.0, 0.00173205, 0.0, -0.00173205}})
           .norm() < 1e-3);
 }
 
@@ -25,6 +27,6 @@ TEST(MerweScaledSigmaPointsTest, NonzeroMean) {
 
   EXPECT_TRUE(
       (points - wpi::math::Matrixd<2, 5>{{1.0, 1.00173205, 1.0, 0.998268, 1.0},
-                                   {2.0, 2.0, 2.00548, 2.0, 1.99452}})
+                                         {2.0, 2.0, 2.00548, 2.0, 1.99452}})
           .norm() < 1e-3);
 }
diff --git a/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp b/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp
index 7c8239ade0..06725c78bb 100644
--- a/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/MerweUKFTest.cpp
@@ -26,7 +26,7 @@ namespace {
 
 // First test system, differential drive
 wpi::math::Vectord<5> DriveDynamics(const wpi::math::Vectord<5>& x,
-                              const wpi::math::Vectord<2>& u) {
+                                    const wpi::math::Vectord<2>& u) {
   auto motors = wpi::math::DCMotor::CIM(2);
 
   // constexpr double Glow = 15.32;    // Low gear ratio
@@ -58,12 +58,14 @@ wpi::math::Vectord<5> DriveDynamics(const wpi::math::Vectord<5>& x,
 }
 
 wpi::math::Vectord<3> DriveLocalMeasurementModel(
-    const wpi::math::Vectord<5>& x, [[maybe_unused]] const wpi::math::Vectord<2>& u) {
+    const wpi::math::Vectord<5>& x,
+    [[maybe_unused]] const wpi::math::Vectord<2>& u) {
   return wpi::math::Vectord<3>{x(2), x(3), x(4)};
 }
 
 wpi::math::Vectord<5> DriveGlobalMeasurementModel(
-    const wpi::math::Vectord<5>& x, [[maybe_unused]] const wpi::math::Vectord<2>& u) {
+    const wpi::math::Vectord<5>& x,
+    [[maybe_unused]] const wpi::math::Vectord<2>& u) {
   return wpi::math::Vectord<5>{x(0), x(1), x(2), x(3), x(4)};
 }
 
@@ -71,15 +73,15 @@ TEST(MerweUKFTest, DriveInit) {
   constexpr wpi::units::second_t dt = 5_ms;
 
   wpi::math::MerweUKF<5, 2, 3> observer{DriveDynamics,
-                                  DriveLocalMeasurementModel,
-                                  {0.5, 0.5, 10.0, 1.0, 1.0},
-                                  {0.0001, 0.01, 0.01},
-                                  wpi::math::AngleMean<5, 2 * 5 + 1>(2),
-                                  wpi::math::AngleMean<3, 2 * 5 + 1>(0),
-                                  wpi::math::AngleResidual<5>(2),
-                                  wpi::math::AngleResidual<3>(0),
-                                  wpi::math::AngleAdd<5>(2),
-                                  dt};
+                                        DriveLocalMeasurementModel,
+                                        {0.5, 0.5, 10.0, 1.0, 1.0},
+                                        {0.0001, 0.01, 0.01},
+                                        wpi::math::AngleMean<5, 2 * 5 + 1>(2),
+                                        wpi::math::AngleMean<3, 2 * 5 + 1>(0),
+                                        wpi::math::AngleResidual<5>(2),
+                                        wpi::math::AngleResidual<3>(0),
+                                        wpi::math::AngleAdd<5>(2),
+                                        dt};
   wpi::math::Vectord<2> u{12.0, 12.0};
   observer.Predict(u, dt);
 
@@ -88,9 +90,10 @@ TEST(MerweUKFTest, DriveInit) {
 
   auto globalY = DriveGlobalMeasurementModel(observer.Xhat(), u);
   auto R = wpi::math::MakeCovMatrix(0.01, 0.01, 0.0001, 0.01, 0.01);
-  observer.Correct<5>(u, globalY, DriveGlobalMeasurementModel, R,
-                      wpi::math::AngleMean<5, 2 * 5 + 1>(2), wpi::math::AngleResidual<5>(2),
-                      wpi::math::AngleResidual<5>(2), wpi::math::AngleAdd<5>(2));
+  observer.Correct<5>(
+      u, globalY, DriveGlobalMeasurementModel, R,
+      wpi::math::AngleMean<5, 2 * 5 + 1>(2), wpi::math::AngleResidual<5>(2),
+      wpi::math::AngleResidual<5>(2), wpi::math::AngleAdd<5>(2));
 }
 
 TEST(MerweUKFTest, DriveConvergence) {
@@ -98,19 +101,19 @@ TEST(MerweUKFTest, DriveConvergence) {
   constexpr auto rb = 0.8382_m / 2.0;  // Robot radius
 
   wpi::math::MerweUKF<5, 2, 3> observer{DriveDynamics,
-                                  DriveLocalMeasurementModel,
-                                  {0.5, 0.5, 10.0, 1.0, 1.0},
-                                  {0.0001, 0.5, 0.5},
-                                  wpi::math::AngleMean<5, 2 * 5 + 1>(2),
-                                  wpi::math::AngleMean<3, 2 * 5 + 1>(0),
-                                  wpi::math::AngleResidual<5>(2),
-                                  wpi::math::AngleResidual<3>(0),
-                                  wpi::math::AngleAdd<5>(2),
-                                  dt};
+                                        DriveLocalMeasurementModel,
+                                        {0.5, 0.5, 10.0, 1.0, 1.0},
+                                        {0.0001, 0.5, 0.5},
+                                        wpi::math::AngleMean<5, 2 * 5 + 1>(2),
+                                        wpi::math::AngleMean<3, 2 * 5 + 1>(0),
+                                        wpi::math::AngleResidual<5>(2),
+                                        wpi::math::AngleResidual<3>(0),
+                                        wpi::math::AngleAdd<5>(2),
+                                        dt};
 
-  auto waypoints =
-      std::vector{wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
-                               wpi::math::Pose2d{24.73_m, 19.68_m, 5.846_rad}};
+  auto waypoints = std::vector{
+      wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
+      wpi::math::Pose2d{24.73_m, 19.68_m, 5.846_rad}};
   auto trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
       waypoints, {8.8_mps, 0.1_mps_sq});
 
@@ -118,7 +121,8 @@ TEST(MerweUKFTest, DriveConvergence) {
   wpi::math::Vectord<2> u = wpi::math::Vectord<2>::Zero();
 
   auto B = wpi::math::NumericalJacobianU<5, 5, 2>(
-      DriveDynamics, wpi::math::Vectord<5>::Zero(), wpi::math::Vectord<2>::Zero());
+      DriveDynamics, wpi::math::Vectord<5>::Zero(),
+      wpi::math::Vectord<2>::Zero());
 
   observer.SetXhat(wpi::math::Vectord<5>{
       trajectory.InitialPose().Translation().X().value(),
@@ -139,12 +143,14 @@ TEST(MerweUKFTest, DriveConvergence) {
         ref.pose.Translation().X().value(), ref.pose.Translation().Y().value(),
         ref.pose.Rotation().Radians().value(), vl.value(), vr.value()};
 
-    auto localY = DriveLocalMeasurementModel(trueXhat, wpi::math::Vectord<2>::Zero());
-    observer.Correct(u, localY + wpi::math::MakeWhiteNoiseVector(0.0001, 0.5, 0.5));
+    auto localY =
+        DriveLocalMeasurementModel(trueXhat, wpi::math::Vectord<2>::Zero());
+    observer.Correct(
+        u, localY + wpi::math::MakeWhiteNoiseVector(0.0001, 0.5, 0.5));
 
     wpi::math::Vectord<5> rdot = (nextR - r) / dt.value();
-    u = B.householderQr().solve(rdot -
-                                DriveDynamics(r, wpi::math::Vectord<2>::Zero()));
+    u = B.householderQr().solve(
+        rdot - DriveDynamics(r, wpi::math::Vectord<2>::Zero()));
 
     observer.Predict(u, dt);
 
@@ -158,7 +164,8 @@ TEST(MerweUKFTest, DriveConvergence) {
   auto globalY = DriveGlobalMeasurementModel(trueXhat, u);
   auto R = wpi::math::MakeCovMatrix(0.01, 0.01, 0.0001, 0.5, 0.5);
   observer.Correct<5>(u, globalY, DriveGlobalMeasurementModel, R,
-                      wpi::math::AngleMean<5, 2 * 5 + 1>(2), wpi::math::AngleResidual<5>(2),
+                      wpi::math::AngleMean<5, 2 * 5 + 1>(2),
+                      wpi::math::AngleResidual<5>(2),
                       wpi::math::AngleResidual<5>(2), wpi::math::AngleAdd<5>(2)
 
   );
@@ -176,8 +183,9 @@ TEST(MerweUKFTest, DriveConvergence) {
 
 TEST(MerweUKFTest, LinearUKF) {
   constexpr wpi::units::second_t dt = 20_ms;
-  auto plant = wpi::math::LinearSystemId::IdentifyVelocitySystem(
-      0.02_V / 1_mps, 0.006_V / 1_mps_sq);
+  auto plant =
+      wpi::math::LinearSystemId::IdentifyVelocitySystem(
+          0.02_V / 1_mps, 0.006_V / 1_mps_sq);
   wpi::math::MerweUKF<1, 1, 1> observer{
       [&](const wpi::math::Vectord<1>& x, const wpi::math::Vectord<1>& u) {
         return plant.A() * x + plant.B() * u;
@@ -209,8 +217,12 @@ TEST(MerweUKFTest, RoundTripP) {
   constexpr wpi::units::second_t dt = 5_ms;
 
   wpi::math::MerweUKF<2, 2, 2> observer{
-      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) { return x; },
-      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) { return x; },
+      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) {
+        return x;
+      },
+      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) {
+        return x;
+      },
       {0.0, 0.0},
       {0.0, 0.0},
       dt};
@@ -223,7 +235,7 @@ TEST(MerweUKFTest, RoundTripP) {
 
 // Second system, single motor feedforward estimator
 wpi::math::Vectord<4> MotorDynamics(const wpi::math::Vectord<4>& x,
-                              const wpi::math::Vectord<1>& u) {
+                                    const wpi::math::Vectord<1>& u) {
   double v = x(1);
   double kV = x(2);
   double kA = x(3);
@@ -235,7 +247,7 @@ wpi::math::Vectord<4> MotorDynamics(const wpi::math::Vectord<4>& x,
 }
 
 wpi::math::Vectord<3> MotorMeasurementModel(const wpi::math::Vectord<4>& x,
-                                      const wpi::math::Vectord<1>& u) {
+                                            const wpi::math::Vectord<1>& u) {
   double p = x(0);
   double v = x(1);
   double kV = x(2);
@@ -271,9 +283,9 @@ TEST(MerweUKFTest, MotorConvergence) {
   states[0] = wpi::math::Vectord<4>{{0.0}, {0.0}, {true_kV}, {true_kA}};
 
   constexpr wpi::math::Matrixd<4, 4> A{{0.0, 1.0, 0.0, 0.0},
-                                 {0.0, -true_kV / true_kA, 0.0, 0.0},
-                                 {0.0, 0.0, 0.0, 0.0},
-                                 {0.0, 0.0, 0.0, 0.0}};
+                                       {0.0, -true_kV / true_kA, 0.0, 0.0},
+                                       {0.0, 0.0, 0.0, 0.0},
+                                       {0.0, 0.0, 0.0, 0.0}};
   constexpr wpi::math::Matrixd<4, 1> B{{0.0}, {1.0 / true_kA}, {0.0}, {0.0}};
 
   wpi::math::Matrixd<4, 4> discA;
@@ -291,7 +303,8 @@ TEST(MerweUKFTest, MotorConvergence) {
   wpi::math::Vectord<4> P0{0.001, 0.001, 10, 10};
 
   wpi::math::MerweUKF<4, 1, 3> observer{
-      MotorDynamics, MotorMeasurementModel, wpi::util::array{0.1, 1.0, 1e-10, 1e-10},
+      MotorDynamics, MotorMeasurementModel,
+      wpi::util::array{0.1, 1.0, 1e-10, 1e-10},
       wpi::util::array{pos_stddev, vel_stddev, accel_stddev}, dt};
 
   observer.SetXhat(wpi::math::Vectord<4>{0.0, 0.0, 2.0, 2.0});
diff --git a/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp b/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp
index f2cb0380f7..5d3e47d348 100644
--- a/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/S3SigmaPointsTest.cpp
@@ -29,11 +29,13 @@ TEST(S3SigmaPointsTest, Simplex) {
 TEST(S3SigmaPointsTest, ZeroMean) {
   wpi::math::S3SigmaPoints<2> sigmaPoints;
   auto points = sigmaPoints.SquareRootSigmaPoints(
-      wpi::math::Vectord<2>{0.0, 0.0}, wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}});
+      wpi::math::Vectord<2>{0.0, 0.0},
+      wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}});
 
   EXPECT_TRUE(
-      (points - wpi::math::Matrixd<2, 4>{{0.0, -0.00122474, 0.00122474, 0.0},
-                                   {0.0, -0.00070711, -0.00070711, 0.00141421}})
+      (points -
+       wpi::math::Matrixd<2, 4>{{0.0, -0.00122474, 0.00122474, 0.0},
+                                {0.0, -0.00070711, -0.00070711, 0.00141421}})
           .norm() < 1e-7);
 }
 
@@ -44,7 +46,8 @@ TEST(S3SigmaPointsTest, NonzeroMean) {
       wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, std::sqrt(10.0)}});
 
   EXPECT_TRUE(
-      (points - wpi::math::Matrixd<2, 4>{{1.0, 0.99877526, 1.00122474, 1.0},
-                                   {2.0, 1.99776393, 1.99776393, 2.00447214}})
+      (points -
+       wpi::math::Matrixd<2, 4>{{1.0, 0.99877526, 1.00122474, 1.0},
+                                {2.0, 1.99776393, 1.99776393, 2.00447214}})
           .norm() < 1e-7);
 }
diff --git a/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp b/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp
index 226b4d366d..7d4c4df576 100644
--- a/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/S3UKFTest.cpp
@@ -26,7 +26,7 @@ namespace {
 
 // First test system, differential drive
 wpi::math::Vectord<5> DriveDynamics(const wpi::math::Vectord<5>& x,
-                              const wpi::math::Vectord<2>& u) {
+                                    const wpi::math::Vectord<2>& u) {
   auto motors = wpi::math::DCMotor::CIM(2);
 
   // constexpr double Glow = 15.32;    // Low gear ratio
@@ -58,12 +58,14 @@ wpi::math::Vectord<5> DriveDynamics(const wpi::math::Vectord<5>& x,
 }
 
 wpi::math::Vectord<3> DriveLocalMeasurementModel(
-    const wpi::math::Vectord<5>& x, [[maybe_unused]] const wpi::math::Vectord<2>& u) {
+    const wpi::math::Vectord<5>& x,
+    [[maybe_unused]] const wpi::math::Vectord<2>& u) {
   return wpi::math::Vectord<3>{x(2), x(3), x(4)};
 }
 
 wpi::math::Vectord<5> DriveGlobalMeasurementModel(
-    const wpi::math::Vectord<5>& x, [[maybe_unused]] const wpi::math::Vectord<2>& u) {
+    const wpi::math::Vectord<5>& x,
+    [[maybe_unused]] const wpi::math::Vectord<2>& u) {
   return wpi::math::Vectord<5>{x(0), x(1), x(2), x(3), x(4)};
 }
 
@@ -71,15 +73,15 @@ TEST(S3UKFTest, DriveInit) {
   constexpr auto dt = 5_ms;
 
   wpi::math::S3UKF<5, 2, 3> observer{DriveDynamics,
-                               DriveLocalMeasurementModel,
-                               {0.5, 0.5, 10.0, 1.0, 1.0},
-                               {0.0001, 0.01, 0.01},
-                               wpi::math::AngleMean<5, 5 + 2>(2),
-                               wpi::math::AngleMean<3, 5 + 2>(0),
-                               wpi::math::AngleResidual<5>(2),
-                               wpi::math::AngleResidual<3>(0),
-                               wpi::math::AngleAdd<5>(2),
-                               dt};
+                                     DriveLocalMeasurementModel,
+                                     {0.5, 0.5, 10.0, 1.0, 1.0},
+                                     {0.0001, 0.01, 0.01},
+                                     wpi::math::AngleMean<5, 5 + 2>(2),
+                                     wpi::math::AngleMean<3, 5 + 2>(0),
+                                     wpi::math::AngleResidual<5>(2),
+                                     wpi::math::AngleResidual<3>(0),
+                                     wpi::math::AngleAdd<5>(2),
+                                     dt};
   wpi::math::Vectord<2> u{12.0, 12.0};
   observer.Predict(u, dt);
 
@@ -88,9 +90,10 @@ TEST(S3UKFTest, DriveInit) {
 
   auto globalY = DriveGlobalMeasurementModel(observer.Xhat(), u);
   auto R = wpi::math::MakeCovMatrix(0.01, 0.01, 0.0001, 0.01, 0.01);
-  observer.Correct<5>(u, globalY, DriveGlobalMeasurementModel, R,
-                      wpi::math::AngleMean<5, 5 + 2>(2), wpi::math::AngleResidual<5>(2),
-                      wpi::math::AngleResidual<5>(2), wpi::math::AngleAdd<5>(2));
+  observer.Correct<5>(
+      u, globalY, DriveGlobalMeasurementModel, R,
+      wpi::math::AngleMean<5, 5 + 2>(2), wpi::math::AngleResidual<5>(2),
+      wpi::math::AngleResidual<5>(2), wpi::math::AngleAdd<5>(2));
 }
 
 TEST(S3UKFTest, DriveConvergence) {
@@ -98,19 +101,19 @@ TEST(S3UKFTest, DriveConvergence) {
   constexpr auto rb = 0.8382_m / 2.0;  // Robot radius
 
   wpi::math::S3UKF<5, 2, 3> observer{DriveDynamics,
-                               DriveLocalMeasurementModel,
-                               {0.5, 0.5, 10.0, 1.0, 1.0},
-                               {0.0001, 0.5, 0.5},
-                               wpi::math::AngleMean<5, 5 + 2>(2),
-                               wpi::math::AngleMean<3, 5 + 2>(0),
-                               wpi::math::AngleResidual<5>(2),
-                               wpi::math::AngleResidual<3>(0),
-                               wpi::math::AngleAdd<5>(2),
-                               dt};
+                                     DriveLocalMeasurementModel,
+                                     {0.5, 0.5, 10.0, 1.0, 1.0},
+                                     {0.0001, 0.5, 0.5},
+                                     wpi::math::AngleMean<5, 5 + 2>(2),
+                                     wpi::math::AngleMean<3, 5 + 2>(0),
+                                     wpi::math::AngleResidual<5>(2),
+                                     wpi::math::AngleResidual<3>(0),
+                                     wpi::math::AngleAdd<5>(2),
+                                     dt};
 
-  auto waypoints =
-      std::vector{wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
-                               wpi::math::Pose2d{24.73_m, 19.68_m, 5.846_rad}};
+  auto waypoints = std::vector{
+      wpi::math::Pose2d{2.75_m, 22.521_m, 0_rad},
+      wpi::math::Pose2d{24.73_m, 19.68_m, 5.846_rad}};
   auto trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
       waypoints, {8.8_mps, 0.1_mps_sq});
 
@@ -118,7 +121,8 @@ TEST(S3UKFTest, DriveConvergence) {
   wpi::math::Vectord<2> u = wpi::math::Vectord<2>::Zero();
 
   auto B = wpi::math::NumericalJacobianU<5, 5, 2>(
-      DriveDynamics, wpi::math::Vectord<5>::Zero(), wpi::math::Vectord<2>::Zero());
+      DriveDynamics, wpi::math::Vectord<5>::Zero(),
+      wpi::math::Vectord<2>::Zero());
 
   observer.SetXhat(wpi::math::Vectord<5>{
       trajectory.InitialPose().Translation().X().value(),
@@ -139,12 +143,14 @@ TEST(S3UKFTest, DriveConvergence) {
         ref.pose.Translation().X().value(), ref.pose.Translation().Y().value(),
         ref.pose.Rotation().Radians().value(), vl.value(), vr.value()};
 
-    auto localY = DriveLocalMeasurementModel(trueXhat, wpi::math::Vectord<2>::Zero());
-    observer.Correct(u, localY + wpi::math::MakeWhiteNoiseVector(0.0001, 0.5, 0.5));
+    auto localY =
+        DriveLocalMeasurementModel(trueXhat, wpi::math::Vectord<2>::Zero());
+    observer.Correct(
+        u, localY + wpi::math::MakeWhiteNoiseVector(0.0001, 0.5, 0.5));
 
     wpi::math::Vectord<5> rdot = (nextR - r) / dt.value();
-    u = B.householderQr().solve(rdot -
-                                DriveDynamics(r, wpi::math::Vectord<2>::Zero()));
+    u = B.householderQr().solve(
+        rdot - DriveDynamics(r, wpi::math::Vectord<2>::Zero()));
 
     observer.Predict(u, dt);
 
@@ -158,7 +164,8 @@ TEST(S3UKFTest, DriveConvergence) {
   auto globalY = DriveGlobalMeasurementModel(trueXhat, u);
   auto R = wpi::math::MakeCovMatrix(0.01, 0.01, 0.0001, 0.5, 0.5);
   observer.Correct<5>(u, globalY, DriveGlobalMeasurementModel, R,
-                      wpi::math::AngleMean<5, 5 + 2>(2), wpi::math::AngleResidual<5>(2),
+                      wpi::math::AngleMean<5, 5 + 2>(2),
+                      wpi::math::AngleResidual<5>(2),
                       wpi::math::AngleResidual<5>(2), wpi::math::AngleAdd<5>(2)
 
   );
@@ -176,8 +183,9 @@ TEST(S3UKFTest, DriveConvergence) {
 
 TEST(S3UKFTest, LinearUKF) {
   constexpr wpi::units::second_t dt = 20_ms;
-  auto plant = wpi::math::LinearSystemId::IdentifyVelocitySystem(
-      0.02_V / 1_mps, 0.006_V / 1_mps_sq);
+  auto plant =
+      wpi::math::LinearSystemId::IdentifyVelocitySystem(
+          0.02_V / 1_mps, 0.006_V / 1_mps_sq);
   wpi::math::S3UKF<1, 1, 1> observer{
       [&](const wpi::math::Vectord<1>& x, const wpi::math::Vectord<1>& u) {
         return plant.A() * x + plant.B() * u;
@@ -209,8 +217,12 @@ TEST(S3UKFTest, RoundTripP) {
   constexpr auto dt = 5_ms;
 
   wpi::math::S3UKF<2, 2, 2> observer{
-      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) { return x; },
-      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) { return x; },
+      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) {
+        return x;
+      },
+      [](const wpi::math::Vectord<2>& x, const wpi::math::Vectord<2>& u) {
+        return x;
+      },
       {0.0, 0.0},
       {0.0, 0.0},
       dt};
@@ -223,7 +235,7 @@ TEST(S3UKFTest, RoundTripP) {
 
 // Second system, single motor feedforward estimator
 wpi::math::Vectord<4> MotorDynamics(const wpi::math::Vectord<4>& x,
-                              const wpi::math::Vectord<1>& u) {
+                                    const wpi::math::Vectord<1>& u) {
   double v = x(1);
   double kV = x(2);
   double kA = x(3);
@@ -235,7 +247,7 @@ wpi::math::Vectord<4> MotorDynamics(const wpi::math::Vectord<4>& x,
 }
 
 wpi::math::Vectord<3> MotorMeasurementModel(const wpi::math::Vectord<4>& x,
-                                      const wpi::math::Vectord<1>& u) {
+                                            const wpi::math::Vectord<1>& u) {
   double p = x(0);
   double v = x(1);
   double kV = x(2);
@@ -271,9 +283,9 @@ TEST(S3UKFTest, MotorConvergence) {
   states[0] = wpi::math::Vectord<4>{{0.0}, {0.0}, {true_kV}, {true_kA}};
 
   constexpr wpi::math::Matrixd<4, 4> A{{0.0, 1.0, 0.0, 0.0},
-                                 {0.0, -true_kV / true_kA, 0.0, 0.0},
-                                 {0.0, 0.0, 0.0, 0.0},
-                                 {0.0, 0.0, 0.0, 0.0}};
+                                       {0.0, -true_kV / true_kA, 0.0, 0.0},
+                                       {0.0, 0.0, 0.0, 0.0},
+                                       {0.0, 0.0, 0.0, 0.0}};
   constexpr wpi::math::Matrixd<4, 1> B{{0.0}, {1.0 / true_kA}, {0.0}, {0.0}};
 
   wpi::math::Matrixd<4, 4> discA;
@@ -291,7 +303,8 @@ TEST(S3UKFTest, MotorConvergence) {
   wpi::math::Vectord<4> P0{0.001, 0.001, 10, 10};
 
   wpi::math::S3UKF<4, 1, 3> observer{
-      MotorDynamics, MotorMeasurementModel, wpi::util::array{0.1, 1.0, 1e-10, 1e-10},
+      MotorDynamics, MotorMeasurementModel,
+      wpi::util::array{0.1, 1.0, 1e-10, 1e-10},
       wpi::util::array{pos_stddev, vel_stddev, accel_stddev}, dt};
 
   observer.SetXhat(wpi::math::Vectord<4>{0.0, 0.0, 2.0, 2.0});
diff --git a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp
index c9d4de2219..7130b70afc 100644
--- a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimator3dTest.cpp
@@ -29,7 +29,8 @@ void testFollowTrajectory(
     const wpi::units::second_t dt, const wpi::units::second_t kVisionUpdateRate,
     const wpi::units::second_t kVisionUpdateDelay, const bool checkError,
     const bool debug) {
-  wpi::util::array positions{wpi::util::empty_array};
+  wpi::util::array positions{
+      wpi::util::empty_array};
 
   estimator.ResetPosition(wpi::math::Rotation3d{}, positions,
                           wpi::math::Pose3d{startingPose});
@@ -40,14 +41,16 @@ void testFollowTrajectory(
   wpi::units::second_t t = 0_s;
 
   std::vector> visionPoses;
-  std::vector>
+  std::vector<
+      std::tuple>
       visionLog;
 
   double maxError = -std::numeric_limits::max();
   double errorSum = 0;
 
   if (debug) {
-    wpi::util::print("time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
+    wpi::util::print(
+        "time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
   }
 
   while (t < trajectory.TotalTime()) {
@@ -59,9 +62,10 @@ void testFollowTrajectory(
         visionPoses.back().first + kVisionUpdateRate < t) {
       auto visionPose =
           visionMeasurementGenerator(groundTruthState) +
-          wpi::math::Transform2d{wpi::math::Translation2d{distribution(generator) * 0.1_m,
-                                              distribution(generator) * 0.1_m},
-                           wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
+          wpi::math::Transform2d{
+              wpi::math::Translation2d{distribution(generator) * 0.1_m,
+                                       distribution(generator) * 0.1_m},
+              wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
       visionPoses.push_back({t, visionPose});
     }
 
@@ -87,9 +91,10 @@ void testFollowTrajectory(
 
     auto xhat = estimator.UpdateWithTime(
         t,
-        wpi::math::Rotation3d{groundTruthState.pose.Rotation() +
-                        wpi::math::Rotation2d{distribution(generator) * 0.05_rad} -
-                        trajectory.InitialPose().Rotation()},
+        wpi::math::Rotation3d{
+            groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad} -
+            trajectory.InitialPose().Rotation()},
         positions);
 
     if (debug) {
@@ -113,7 +118,8 @@ void testFollowTrajectory(
   }
 
   if (debug) {
-    wpi::util::print("apply_time, measured_time, vision_x, vision_y, vision_theta\n");
+    wpi::util::print(
+        "apply_time, measured_time, vision_x, vision_y, vision_theta\n");
 
     wpi::units::second_t apply_time;
     wpi::units::second_t measure_time;
@@ -121,9 +127,9 @@ void testFollowTrajectory(
     for (auto record : visionLog) {
       std::tie(apply_time, measure_time, vision_pose) = record;
       wpi::util::print("{}, {}, {}, {}, {}\n", apply_time.value(),
-                 measure_time.value(), vision_pose.X().value(),
-                 vision_pose.Y().value(),
-                 vision_pose.Rotation().Radians().value());
+                       measure_time.value(), vision_pose.X().value(),
+                       vision_pose.Y().value(),
+                       vision_pose.Rotation().Radians().value());
     }
   }
 
@@ -149,7 +155,8 @@ void testFollowTrajectory(
 TEST(SwerveDrivePoseEstimator3dTest, AccuracyFacingTrajectory) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -157,31 +164,35 @@ TEST(SwerveDrivePoseEstimator3dTest, AccuracyFacingTrajectory) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator3d<4> estimator{
-      kinematics,    wpi::math::Rotation3d{},    {fl, fr, bl, br},
-      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1}, {0.45, 0.45, 0.45, 0.45}};
+      kinematics,          wpi::math::Rotation3d{}, {fl, fr, bl, br},
+      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1},    {0.45, 0.45, 0.45, 0.45}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
 
   testFollowTrajectory(
       kinematics, estimator, trajectory,
       [&](wpi::math::Trajectory::State& state) {
         return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                  state.velocity * state.curvature};
+                                        state.velocity * state.curvature};
       },
       [&](wpi::math::Trajectory::State& state) { return state.pose; },
-      {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
-      20_ms, 100_ms, 250_ms, true, false);
+      {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
+      {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms, 250_ms, true,
+      false);
 }
 
 TEST(SwerveDrivePoseEstimator3dTest, BadInitialPose) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -189,15 +200,17 @@ TEST(SwerveDrivePoseEstimator3dTest, BadInitialPose) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator3d<4> estimator{
-      kinematics,    wpi::math::Rotation3d{},    {fl, fr, bl, br},
-      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1}, {0.9, 0.9, 0.9, 0.9}};
+      kinematics,          wpi::math::Rotation3d{}, {fl, fr, bl, br},
+      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1},    {0.9, 0.9, 0.9, 0.9}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
 
   for (wpi::units::degree_t offset_direction_degs = 0_deg;
        offset_direction_degs < 360_deg; offset_direction_degs += 45_deg) {
@@ -206,21 +219,21 @@ TEST(SwerveDrivePoseEstimator3dTest, BadInitialPose) {
       auto pose_offset = wpi::math::Rotation2d{offset_direction_degs};
       auto heading_offset = wpi::math::Rotation2d{offset_heading_degs};
 
-      auto initial_pose =
-          trajectory.InitialPose() +
-          wpi::math::Transform2d{wpi::math::Translation2d{pose_offset.Cos() * 1_m,
-                                              pose_offset.Sin() * 1_m},
-                           heading_offset};
+      auto initial_pose = trajectory.InitialPose() +
+                          wpi::math::Transform2d{
+                              wpi::math::Translation2d{pose_offset.Cos() * 1_m,
+                                                       pose_offset.Sin() * 1_m},
+                              heading_offset};
 
       testFollowTrajectory(
           kinematics, estimator, trajectory,
           [&](wpi::math::Trajectory::State& state) {
             return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                      state.velocity * state.curvature};
+                                            state.velocity * state.curvature};
           },
           [&](wpi::math::Trajectory::State& state) { return state.pose; },
-          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms,
-          250_ms, false, false);
+          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
+          100_ms, 250_ms, false, false);
     }
   }
 }
@@ -233,7 +246,8 @@ TEST(SwerveDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
   // pose would converge to that measurement.
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -244,7 +258,8 @@ TEST(SwerveDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
       kinematics,
       wpi::math::Rotation3d{},
       {fl, fr, bl, br},
-      wpi::math::Pose3d{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 270_deg}},
+      wpi::math::Pose3d{1_m, 2_m, 0_m,
+                        wpi::math::Rotation3d{0_deg, 0_deg, 270_deg}},
       {0.1, 0.1, 0.1, 0.1},
       {0.45, 0.45, 0.45, 0.45}};
 
@@ -252,11 +267,16 @@ TEST(SwerveDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
 
   for (int i = 0; i < 1000; i++) {
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{0_m, 0_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}}, 0_s);
+        wpi::math::Pose3d{0_m, 0_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 0_deg}},
+        0_s);
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{3_m, 1_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}}, 0_s);
+        wpi::math::Pose3d{3_m, 1_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}},
+        0_s);
     estimator.AddVisionMeasurement(
-        wpi::math::Pose3d{2_m, 4_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}},
+        wpi::math::Pose3d{2_m, 4_m, 0_m,
+                          wpi::math::Rotation3d{0_deg, 0_deg, 180_deg}},
         0_s);
   }
 
@@ -294,7 +314,8 @@ TEST(SwerveDrivePoseEstimator3dTest, SimultaneousVisionMeasurements) {
 TEST(SwerveDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -302,8 +323,8 @@ TEST(SwerveDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator3d<4> estimator{
-      kinematics,    wpi::math::Rotation3d{},    {fl, fr, bl, br},
-      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1}, {0.45, 0.45, 0.45, 0.45}};
+      kinematics,          wpi::math::Rotation3d{}, {fl, fr, bl, br},
+      wpi::math::Pose3d{}, {0.1, 0.1, 0.1, 0.1},    {0.45, 0.45, 0.45, 0.45}};
 
   // Add enough measurements to fill up the buffer
   for (auto time = 0_s; time < 4_s; time += 20_ms) {
@@ -314,8 +335,9 @@ TEST(SwerveDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
 
   // Apply a vision measurement from 3 seconds ago
   estimator.AddVisionMeasurement(
-      wpi::math::Pose3d{10_m, 10_m, 0_m, wpi::math::Rotation3d{0_rad, 0_rad, 0.1_rad}}, 1_s,
-      {0.1, 0.1, 0.1, 0.1});
+      wpi::math::Pose3d{10_m, 10_m, 0_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 0.1_rad}},
+      1_s, {0.1, 0.1, 0.1, 0.1});
 
   EXPECT_NEAR(odometryPose.X().value(),
               estimator.GetEstimatedPosition().X().value(), 1e-6);
@@ -334,7 +356,8 @@ TEST(SwerveDrivePoseEstimator3dTest, TestDiscardStaleVisionMeasurements) {
 TEST(SwerveDrivePoseEstimator3dTest, TestSampleAt) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::SwerveDrivePoseEstimator3d estimator{
       kinematics,
       wpi::math::Rotation3d{},
@@ -352,39 +375,52 @@ TEST(SwerveDrivePoseEstimator3dTest, TestSampleAt) {
   // error
   for (double time = 1; time <= 2 + 1e-9; time += 0.02) {
     wpi::util::array wheelPositions{
-        {wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}},
-         wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}},
-         wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}},
-         wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}}}};
-    estimator.UpdateWithTime(wpi::units::second_t{time}, wpi::math::Rotation3d{},
-                             wheelPositions);
+        {wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}},
+         wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}},
+         wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}},
+         wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}}}};
+    estimator.UpdateWithTime(wpi::units::second_t{time},
+                             wpi::math::Rotation3d{}, wheelPositions);
   }
 
   // Sample at an added time
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
   // Sample between updates (test interpolation)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
   // Sampling before the oldest value returns the oldest value
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(0.5_s));
   // Sampling after the newest value returns the newest value
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(2.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(2.5_s));
 
   // Add a vision measurement after the odometry measurements (while keeping all
   // of the old odometry measurements)
   estimator.AddVisionMeasurement(
-      wpi::math::Pose3d{2_m, 0_m, 0_m, wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}}, 2.2_s);
+      wpi::math::Pose3d{2_m, 0_m, 0_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
+      2.2_s);
 
   // Make sure nothing changed (except the newest value)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
-            estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose3d{1_m, 0_m, 0_m, wpi::math::Rotation3d{}}),
+      estimator.SampleAt(0.5_s));
 
   // Add a vision measurement before the odometry measurements that's still in
   // the buffer
@@ -392,26 +428,32 @@ TEST(SwerveDrivePoseEstimator3dTest, TestSampleAt) {
       wpi::math::Pose3d{1_m, 0.2_m, 0_m, wpi::math::Rotation3d{}}, 0.9_s);
 
   // Everything should be the same except Y is 0.1 (halfway between 0 and 0.2)
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.02_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.02_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1.01_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1.01_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{1_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{1_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(0.5_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose3d{2_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
+  EXPECT_EQ(std::optional(
+                wpi::math::Pose3d{2_m, 0.1_m, 0_m, wpi::math::Rotation3d{}}),
             estimator.SampleAt(2.5_s));
 }
 
 TEST(SwerveDrivePoseEstimator3dTest, TestReset) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::SwerveDrivePoseEstimator3d estimator{
       kinematics,
       wpi::math::Rotation3d{},
       {wpi::math::SwerveModulePosition{}, wpi::math::SwerveModulePosition{},
        wpi::math::SwerveModulePosition{}, wpi::math::SwerveModulePosition{}},
-      wpi::math::Pose3d{-1_m, -1_m, -1_m, wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
+      wpi::math::Pose3d{-1_m, -1_m, -1_m,
+                        wpi::math::Rotation3d{0_rad, 0_rad, 1_rad}},
       {1.0, 1.0, 1.0, 1.0},
       {1.0, 1.0, 1.0, 1.0}};
 
@@ -425,7 +467,8 @@ TEST(SwerveDrivePoseEstimator3dTest, TestReset) {
 
   // Test reset position
   {
-    wpi::math::SwerveModulePosition modulePosition{1_m, wpi::math::Rotation2d{}};
+    wpi::math::SwerveModulePosition modulePosition{1_m,
+                                                   wpi::math::Rotation2d{}};
     estimator.ResetPosition(
         wpi::math::Rotation3d{},
         {modulePosition, modulePosition, modulePosition, modulePosition},
@@ -441,9 +484,10 @@ TEST(SwerveDrivePoseEstimator3dTest, TestReset) {
 
   // Test orientation and wheel positions
   {
-    wpi::math::SwerveModulePosition modulePosition{2_m, wpi::math::Rotation2d{}};
+    wpi::math::SwerveModulePosition modulePosition{2_m,
+                                                   wpi::math::Rotation2d{}};
     estimator.Update(wpi::math::Rotation3d{}, {modulePosition, modulePosition,
-                                         modulePosition, modulePosition});
+                                               modulePosition, modulePosition});
   }
 
   EXPECT_DOUBLE_EQ(2, estimator.GetEstimatedPosition().X().value());
@@ -466,9 +510,10 @@ TEST(SwerveDrivePoseEstimator3dTest, TestReset) {
 
   // Test orientation
   {
-    wpi::math::SwerveModulePosition modulePosition{3_m, wpi::math::Rotation2d{}};
+    wpi::math::SwerveModulePosition modulePosition{3_m,
+                                                   wpi::math::Rotation2d{}};
     estimator.Update(wpi::math::Rotation3d{}, {modulePosition, modulePosition,
-                                         modulePosition, modulePosition});
+                                               modulePosition, modulePosition});
   }
 
   EXPECT_DOUBLE_EQ(2, estimator.GetEstimatedPosition().X().value());
diff --git a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp
index c6f0cbf56e..e15b72bede 100644
--- a/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp
+++ b/wpimath/src/test/native/cpp/estimator/SwerveDrivePoseEstimatorTest.cpp
@@ -30,7 +30,8 @@ void testFollowTrajectory(
     const wpi::units::second_t dt, const wpi::units::second_t kVisionUpdateRate,
     const wpi::units::second_t kVisionUpdateDelay, const bool checkError,
     const bool debug) {
-  wpi::util::array positions{wpi::util::empty_array};
+  wpi::util::array positions{
+      wpi::util::empty_array};
 
   estimator.ResetPosition(wpi::math::Rotation2d{}, positions, startingPose);
 
@@ -40,14 +41,16 @@ void testFollowTrajectory(
   wpi::units::second_t t = 0_s;
 
   std::vector> visionPoses;
-  std::vector>
+  std::vector<
+      std::tuple>
       visionLog;
 
   double maxError = -std::numeric_limits::max();
   double errorSum = 0;
 
   if (debug) {
-    wpi::util::print("time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
+    wpi::util::print(
+        "time, est_x, est_y, est_theta, true_x, true_y, true_theta\n");
   }
 
   while (t < trajectory.TotalTime()) {
@@ -59,9 +62,10 @@ void testFollowTrajectory(
         visionPoses.back().first + kVisionUpdateRate < t) {
       auto visionPose =
           visionMeasurementGenerator(groundTruthState) +
-          wpi::math::Transform2d{wpi::math::Translation2d{distribution(generator) * 0.1_m,
-                                              distribution(generator) * 0.1_m},
-                           wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
+          wpi::math::Transform2d{
+              wpi::math::Translation2d{distribution(generator) * 0.1_m,
+                                       distribution(generator) * 0.1_m},
+              wpi::math::Rotation2d{distribution(generator) * 0.05_rad}};
       visionPoses.push_back({t, visionPose});
     }
 
@@ -92,11 +96,11 @@ void testFollowTrajectory(
         positions);
 
     if (debug) {
-      wpi::util::print("{}, {}, {}, {}, {}, {}, {}\n", t.value(), xhat.X().value(),
-                 xhat.Y().value(), xhat.Rotation().Radians().value(),
-                 groundTruthState.pose.X().value(),
-                 groundTruthState.pose.Y().value(),
-                 groundTruthState.pose.Rotation().Radians().value());
+      wpi::util::print(
+          "{}, {}, {}, {}, {}, {}, {}\n", t.value(), xhat.X().value(),
+          xhat.Y().value(), xhat.Rotation().Radians().value(),
+          groundTruthState.pose.X().value(), groundTruthState.pose.Y().value(),
+          groundTruthState.pose.Rotation().Radians().value());
     }
 
     double error = groundTruthState.pose.Translation()
@@ -112,7 +116,8 @@ void testFollowTrajectory(
   }
 
   if (debug) {
-    wpi::util::print("apply_time, measured_time, vision_x, vision_y, vision_theta\n");
+    wpi::util::print(
+        "apply_time, measured_time, vision_x, vision_y, vision_theta\n");
 
     wpi::units::second_t apply_time;
     wpi::units::second_t measure_time;
@@ -120,9 +125,9 @@ void testFollowTrajectory(
     for (auto record : visionLog) {
       std::tie(apply_time, measure_time, vision_pose) = record;
       wpi::util::print("{}, {}, {}, {}, {}\n", apply_time.value(),
-                 measure_time.value(), vision_pose.X().value(),
-                 vision_pose.Y().value(),
-                 vision_pose.Rotation().Radians().value());
+                       measure_time.value(), vision_pose.X().value(),
+                       vision_pose.Y().value(),
+                       vision_pose.Rotation().Radians().value());
     }
   }
 
@@ -144,7 +149,8 @@ void testFollowTrajectory(
 TEST(SwerveDrivePoseEstimatorTest, AccuracyFacingTrajectory) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -152,31 +158,35 @@ TEST(SwerveDrivePoseEstimatorTest, AccuracyFacingTrajectory) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator<4> estimator{
-      kinematics,    wpi::math::Rotation2d{}, {fl, fr, bl, br},
-      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},   {0.45, 0.45, 0.45}};
+      kinematics,          wpi::math::Rotation2d{}, {fl, fr, bl, br},
+      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},         {0.45, 0.45, 0.45}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
 
   testFollowTrajectory(
       kinematics, estimator, trajectory,
       [&](wpi::math::Trajectory::State& state) {
         return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                  state.velocity * state.curvature};
+                                        state.velocity * state.curvature};
       },
       [&](wpi::math::Trajectory::State& state) { return state.pose; },
-      {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
-      20_ms, 100_ms, 250_ms, true, false);
+      {0_m, 0_m, wpi::math::Rotation2d{45_deg}},
+      {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms, 250_ms, true,
+      false);
 }
 
 TEST(SwerveDrivePoseEstimatorTest, BadInitialPose) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -184,15 +194,17 @@ TEST(SwerveDrivePoseEstimatorTest, BadInitialPose) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator<4> estimator{
-      kinematics,    wpi::math::Rotation2d{}, {fl, fr, bl, br},
-      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},   {0.9, 0.9, 0.9}};
+      kinematics,          wpi::math::Rotation2d{}, {fl, fr, bl, br},
+      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},         {0.9, 0.9, 0.9}};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(2_mps, 2.0_mps_sq));
 
   for (wpi::units::degree_t offset_direction_degs = 0_deg;
        offset_direction_degs < 360_deg; offset_direction_degs += 45_deg) {
@@ -201,21 +213,21 @@ TEST(SwerveDrivePoseEstimatorTest, BadInitialPose) {
       auto pose_offset = wpi::math::Rotation2d{offset_direction_degs};
       auto heading_offset = wpi::math::Rotation2d{offset_heading_degs};
 
-      auto initial_pose =
-          trajectory.InitialPose() +
-          wpi::math::Transform2d{wpi::math::Translation2d{pose_offset.Cos() * 1_m,
-                                              pose_offset.Sin() * 1_m},
-                           heading_offset};
+      auto initial_pose = trajectory.InitialPose() +
+                          wpi::math::Transform2d{
+                              wpi::math::Translation2d{pose_offset.Cos() * 1_m,
+                                                       pose_offset.Sin() * 1_m},
+                              heading_offset};
 
       testFollowTrajectory(
           kinematics, estimator, trajectory,
           [&](wpi::math::Trajectory::State& state) {
             return wpi::math::ChassisSpeeds{state.velocity, 0_mps,
-                                      state.velocity * state.curvature};
+                                            state.velocity * state.curvature};
           },
           [&](wpi::math::Trajectory::State& state) { return state.pose; },
-          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms, 100_ms,
-          250_ms, false, false);
+          initial_pose, {0_m, 0_m, wpi::math::Rotation2d{45_deg}}, 20_ms,
+          100_ms, 250_ms, false, false);
     }
   }
 }
@@ -228,7 +240,8 @@ TEST(SwerveDrivePoseEstimatorTest, SimultaneousVisionMeasurements) {
   // pose would converge to that measurement.
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -236,9 +249,12 @@ TEST(SwerveDrivePoseEstimatorTest, SimultaneousVisionMeasurements) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator<4> estimator{
-      kinematics,       wpi::math::Rotation2d{},
-      {fl, fr, bl, br}, wpi::math::Pose2d{1_m, 2_m, wpi::math::Rotation2d{270_deg}},
-      {0.1, 0.1, 0.1},  {0.45, 0.45, 0.45}};
+      kinematics,
+      wpi::math::Rotation2d{},
+      {fl, fr, bl, br},
+      wpi::math::Pose2d{1_m, 2_m, wpi::math::Rotation2d{270_deg}},
+      {0.1, 0.1, 0.1},
+      {0.45, 0.45, 0.45}};
 
   estimator.UpdateWithTime(0_s, wpi::math::Rotation2d{}, {fl, fr, bl, br});
 
@@ -282,7 +298,8 @@ TEST(SwerveDrivePoseEstimatorTest, SimultaneousVisionMeasurements) {
 TEST(SwerveDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::SwerveModulePosition fl;
   wpi::math::SwerveModulePosition fr;
@@ -290,8 +307,8 @@ TEST(SwerveDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
   wpi::math::SwerveModulePosition br;
 
   wpi::math::SwerveDrivePoseEstimator<4> estimator{
-      kinematics,    wpi::math::Rotation2d{}, {fl, fr, bl, br},
-      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},   {0.45, 0.45, 0.45}};
+      kinematics,          wpi::math::Rotation2d{}, {fl, fr, bl, br},
+      wpi::math::Pose2d{}, {0.1, 0.1, 0.1},         {0.45, 0.45, 0.45}};
 
   // Add enough measurements to fill up the buffer
   for (auto time = 0_s; time < 4_s; time += 20_ms) {
@@ -302,7 +319,8 @@ TEST(SwerveDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
 
   // Apply a vision measurement from 3 seconds ago
   estimator.AddVisionMeasurement(
-      wpi::math::Pose2d{wpi::math::Translation2d{10_m, 10_m}, wpi::math::Rotation2d{0.1_rad}},
+      wpi::math::Pose2d{wpi::math::Translation2d{10_m, 10_m},
+                        wpi::math::Rotation2d{0.1_rad}},
       1_s, {0.1, 0.1, 0.1});
 
   EXPECT_NEAR(odometryPose.X().value(),
@@ -317,7 +335,8 @@ TEST(SwerveDrivePoseEstimatorTest, TestDiscardStaleVisionMeasurements) {
 TEST(SwerveDrivePoseEstimatorTest, TestSampleAt) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::SwerveDrivePoseEstimator estimator{
       kinematics,
       wpi::math::Rotation2d{},
@@ -335,20 +354,26 @@ TEST(SwerveDrivePoseEstimatorTest, TestSampleAt) {
   // error
   for (double time = 1; time <= 2 + 1e-9; time += 0.02) {
     wpi::util::array wheelPositions{
-        {wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}},
-         wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}},
-         wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}},
-         wpi::math::SwerveModulePosition{wpi::units::meter_t{time}, wpi::math::Rotation2d{}}}};
-    estimator.UpdateWithTime(wpi::units::second_t{time}, wpi::math::Rotation2d{},
-                             wheelPositions);
+        {wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}},
+         wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}},
+         wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}},
+         wpi::math::SwerveModulePosition{wpi::units::meter_t{time},
+                                         wpi::math::Rotation2d{}}}};
+    estimator.UpdateWithTime(wpi::units::second_t{time},
+                             wpi::math::Rotation2d{}, wheelPositions);
   }
 
   // Sample at an added time
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
   // Sample between updates (test interpolation)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
   // Sampling before the oldest value returns the oldest value
   EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0_m, wpi::math::Rotation2d{}}),
             estimator.SampleAt(0.5_s));
@@ -358,37 +383,44 @@ TEST(SwerveDrivePoseEstimatorTest, TestSampleAt) {
 
   // Add a vision measurement after the odometry measurements (while keeping all
   // of the old odometry measurements)
-  estimator.AddVisionMeasurement(wpi::math::Pose2d{2_m, 0_m, wpi::math::Rotation2d{1_rad}},
-                                 2.2_s);
+  estimator.AddVisionMeasurement(
+      wpi::math::Pose2d{2_m, 0_m, wpi::math::Rotation2d{1_rad}}, 2.2_s);
 
   // Make sure nothing changed (except the newest value)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
   EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0_m, wpi::math::Rotation2d{}}),
             estimator.SampleAt(0.5_s));
 
   // Add a vision measurement before the odometry measurements that's still in
   // the buffer
-  estimator.AddVisionMeasurement(wpi::math::Pose2d{1_m, 0.2_m, wpi::math::Rotation2d{}},
-                                 0.9_s);
+  estimator.AddVisionMeasurement(
+      wpi::math::Pose2d{1_m, 0.2_m, wpi::math::Rotation2d{}}, 0.9_s);
 
   // Everything should be the same except Y is 0.1 (halfway between 0 and 0.2)
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.02_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.02_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1.01_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(1.01_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{1_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(0.5_s));
-  EXPECT_EQ(std::optional(wpi::math::Pose2d{2_m, 0.1_m, wpi::math::Rotation2d{}}),
-            estimator.SampleAt(2.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.02_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.02_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1.01_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(1.01_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{1_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(0.5_s));
+  EXPECT_EQ(
+      std::optional(wpi::math::Pose2d{2_m, 0.1_m, wpi::math::Rotation2d{}}),
+      estimator.SampleAt(2.5_s));
 }
 
 TEST(SwerveDrivePoseEstimatorTest, TestReset) {
   wpi::math::SwerveDriveKinematics<4> kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
   wpi::math::SwerveDrivePoseEstimator estimator{
       kinematics,
       wpi::math::Rotation2d{},
@@ -406,7 +438,8 @@ TEST(SwerveDrivePoseEstimatorTest, TestReset) {
 
   // Test reset position
   {
-    wpi::math::SwerveModulePosition modulePosition{1_m, wpi::math::Rotation2d{}};
+    wpi::math::SwerveModulePosition modulePosition{1_m,
+                                                   wpi::math::Rotation2d{}};
     estimator.ResetPosition(
         wpi::math::Rotation2d{},
         {modulePosition, modulePosition, modulePosition, modulePosition},
@@ -420,9 +453,10 @@ TEST(SwerveDrivePoseEstimatorTest, TestReset) {
 
   // Test orientation and wheel positions
   {
-    wpi::math::SwerveModulePosition modulePosition{2_m, wpi::math::Rotation2d{}};
+    wpi::math::SwerveModulePosition modulePosition{2_m,
+                                                   wpi::math::Rotation2d{}};
     estimator.Update(wpi::math::Rotation2d{}, {modulePosition, modulePosition,
-                                         modulePosition, modulePosition});
+                                               modulePosition, modulePosition});
   }
 
   EXPECT_DOUBLE_EQ(2, estimator.GetEstimatedPosition().X().value());
@@ -441,9 +475,10 @@ TEST(SwerveDrivePoseEstimatorTest, TestReset) {
 
   // Test orientation
   {
-    wpi::math::SwerveModulePosition modulePosition{3_m, wpi::math::Rotation2d{}};
+    wpi::math::SwerveModulePosition modulePosition{3_m,
+                                                   wpi::math::Rotation2d{}};
     estimator.Update(wpi::math::Rotation2d{}, {modulePosition, modulePosition,
-                                         modulePosition, modulePosition});
+                                               modulePosition, modulePosition});
   }
 
   EXPECT_DOUBLE_EQ(2, estimator.GetEstimatedPosition().X().value());
diff --git a/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp b/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp
index 29e5403b99..4fb211bca9 100644
--- a/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp
+++ b/wpimath/src/test/native/cpp/filter/DebouncerTest.cpp
@@ -13,7 +13,8 @@ static wpi::units::second_t now = 0_s;
 class DebouncerTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    WPI_SetNowImpl([] { return wpi::units::microsecond_t{now}.to(); });
+    WPI_SetNowImpl(
+        [] { return wpi::units::microsecond_t{now}.to(); });
   }
 
   void TearDown() override { WPI_SetNowImpl(nullptr); }
@@ -31,7 +32,8 @@ TEST_F(DebouncerTest, DebounceRising) {
 }
 
 TEST_F(DebouncerTest, DebounceFalling) {
-  wpi::math::Debouncer debouncer{20_ms, wpi::math::Debouncer::DebounceType::kFalling};
+  wpi::math::Debouncer debouncer{20_ms,
+                                 wpi::math::Debouncer::DebounceType::kFalling};
 
   debouncer.Calculate(true);
   EXPECT_TRUE(debouncer.Calculate(false));
@@ -42,7 +44,8 @@ TEST_F(DebouncerTest, DebounceFalling) {
 }
 
 TEST_F(DebouncerTest, DebounceBoth) {
-  wpi::math::Debouncer debouncer{20_ms, wpi::math::Debouncer::DebounceType::kBoth};
+  wpi::math::Debouncer debouncer{20_ms,
+                                 wpi::math::Debouncer::DebounceType::kBoth};
 
   debouncer.Calculate(false);
   EXPECT_FALSE(debouncer.Calculate(true));
@@ -58,7 +61,8 @@ TEST_F(DebouncerTest, DebounceBoth) {
 }
 
 TEST_F(DebouncerTest, DebounceParams) {
-  wpi::math::Debouncer debouncer{20_ms, wpi::math::Debouncer::DebounceType::kBoth};
+  wpi::math::Debouncer debouncer{20_ms,
+                                 wpi::math::Debouncer::DebounceType::kBoth};
 
   EXPECT_TRUE(debouncer.GetDebounceTime() == 20_ms);
   EXPECT_TRUE(debouncer.GetDebounceType() ==
diff --git a/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp b/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp
index 32e0cc4f9f..3f30838c67 100644
--- a/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp
+++ b/wpimath/src/test/native/cpp/filter/LinearFilterOutputTest.cpp
@@ -59,7 +59,7 @@ class LinearFilterOutputTest
         break;
       case kTestHighPass:
         return wpi::math::LinearFilter::HighPass(kHighPassTimeConstant,
-                                                   kFilterStep);
+                                                         kFilterStep);
         break;
       case kTestMovAvg:
         return wpi::math::LinearFilter::MovingAverage(kMovAvgTaps);
@@ -121,8 +121,8 @@ INSTANTIATE_TEST_SUITE_P(Tests, LinearFilterOutputTest,
                                          kTestMovAvg, kTestPulse));
 
 template 
-void AssertCentralResults(F&& f, DfDx&& dfdx, wpi::units::second_t h, double min,
-                          double max) {
+void AssertCentralResults(F&& f, DfDx&& dfdx, wpi::units::second_t h,
+                          double min, double max) {
   static_assert(Samples % 2 != 0, "Number of samples must be odd.");
 
   // Generate stencil points from -(samples - 1)/2 to (samples - 1)/2
@@ -132,8 +132,8 @@ void AssertCentralResults(F&& f, DfDx&& dfdx, wpi::units::second_t h, double min
   }
 
   auto filter =
-      wpi::math::LinearFilter::FiniteDifference(stencil,
-                                                                       h);
+      wpi::math::LinearFilter::FiniteDifference(
+          stencil, h);
 
   for (int i = min / h.value(); i < max / h.value(); ++i) {
     // Let filter initialize
@@ -153,11 +153,11 @@ void AssertCentralResults(F&& f, DfDx&& dfdx, wpi::units::second_t h, double min
 }
 
 template 
-void AssertBackwardResults(F&& f, DfDx&& dfdx, wpi::units::second_t h, double min,
-                           double max) {
+void AssertBackwardResults(F&& f, DfDx&& dfdx, wpi::units::second_t h,
+                           double min, double max) {
   auto filter =
-      wpi::math::LinearFilter::BackwardFiniteDifference(
-          h);
+      wpi::math::LinearFilter::BackwardFiniteDifference(h);
 
   for (int i = min / h.value(); i < max / h.value(); ++i) {
     // Let filter initialize
diff --git a/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp b/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp
index 9c94fbb720..d531b0987d 100644
--- a/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp
+++ b/wpimath/src/test/native/cpp/filter/SlewRateLimiterTest.cpp
@@ -15,7 +15,8 @@ static wpi::units::second_t now = 0_s;
 class SlewRateLimiterTest : public ::testing::Test {
  protected:
   void SetUp() override {
-    WPI_SetNowImpl([] { return wpi::units::microsecond_t{now}.to(); });
+    WPI_SetNowImpl(
+        [] { return wpi::units::microsecond_t{now}.to(); });
   }
 
   void TearDown() override { WPI_SetNowImpl(nullptr); }
diff --git a/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp
index 13bb08e3f9..b4de673983 100644
--- a/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp
+++ b/wpimath/src/test/native/cpp/geometry/Pose3dTest.cpp
@@ -92,8 +92,8 @@ TEST(Pose3dTest, RotateAround) {
 
   EXPECT_NEAR(-5.0, rotated.X().value(), 1e-9);
   EXPECT_NEAR(0.0, rotated.Y().value(), 1e-9);
-  EXPECT_NEAR(wpi::units::radian_t{180_deg}.value(), rotated.Rotation().Z().value(),
-              1e-9);
+  EXPECT_NEAR(wpi::units::radian_t{180_deg}.value(),
+              rotated.Rotation().Z().value(), 1e-9);
 }
 
 TEST(Pose3dTest, Equality) {
diff --git a/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp
index d9b4551b1b..81279d5824 100644
--- a/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp
+++ b/wpimath/src/test/native/cpp/geometry/Rotation3dTest.cpp
@@ -14,9 +14,11 @@
 using namespace wpi::math;
 
 TEST(Rotation3dTest, GimbalLockAccuracy) {
-  auto rot1 = Rotation3d{0_rad, 0_rad, wpi::units::radian_t{std::numbers::pi / 2}};
+  auto rot1 =
+      Rotation3d{0_rad, 0_rad, wpi::units::radian_t{std::numbers::pi / 2}};
   auto rot2 = Rotation3d{wpi::units::radian_t{std::numbers::pi}, 0_rad, 0_rad};
-  auto rot3 = Rotation3d{-wpi::units::radian_t{std::numbers::pi / 2}, 0_rad, 0_rad};
+  auto rot3 =
+      Rotation3d{-wpi::units::radian_t{std::numbers::pi / 2}, 0_rad, 0_rad};
   const auto result1 = rot1 + rot2 + rot3;
   const auto expected1 =
       Rotation3d{0_rad, -wpi::units::radian_t{std::numbers::pi / 2},
@@ -51,21 +53,24 @@ TEST(Rotation3dTest, GimbalLockAccuracy) {
 TEST(Rotation3dTest, InitAxisAngleAndRollPitchYaw) {
   const Eigen::Vector3d xAxis{1.0, 0.0, 0.0};
   const Rotation3d rot1{xAxis, wpi::units::radian_t{std::numbers::pi / 3}};
-  const Rotation3d rot2{wpi::units::radian_t{std::numbers::pi / 3}, 0_rad, 0_rad};
+  const Rotation3d rot2{wpi::units::radian_t{std::numbers::pi / 3}, 0_rad,
+                        0_rad};
   const Rotation3d rvec1{Eigen::Vector3d{xAxis * std::numbers::pi / 3}};
   EXPECT_EQ(rot1, rot2);
   EXPECT_EQ(rot1, rvec1);
 
   const Eigen::Vector3d yAxis{0.0, 1.0, 0.0};
   const Rotation3d rot3{yAxis, wpi::units::radian_t{std::numbers::pi / 3}};
-  const Rotation3d rot4{0_rad, wpi::units::radian_t{std::numbers::pi / 3}, 0_rad};
+  const Rotation3d rot4{0_rad, wpi::units::radian_t{std::numbers::pi / 3},
+                        0_rad};
   const Rotation3d rvec2{Eigen::Vector3d{yAxis * std::numbers::pi / 3}};
   EXPECT_EQ(rot3, rot4);
   EXPECT_EQ(rot3, rvec2);
 
   const Eigen::Vector3d zAxis{0.0, 0.0, 1.0};
   const Rotation3d rot5{zAxis, wpi::units::radian_t{std::numbers::pi / 3}};
-  const Rotation3d rot6{0_rad, 0_rad, wpi::units::radian_t{std::numbers::pi / 3}};
+  const Rotation3d rot6{0_rad, 0_rad,
+                        wpi::units::radian_t{std::numbers::pi / 3}};
   const Rotation3d rvec3{Eigen::Vector3d{zAxis * std::numbers::pi / 3}};
   EXPECT_EQ(rot5, rot6);
   EXPECT_EQ(rot5, rvec3);
@@ -102,12 +107,14 @@ TEST(Rotation3dTest, InitTwoVector) {
 
   // 90 degree CW rotation around y-axis
   const Rotation3d rot1{xAxis, zAxis};
-  const Rotation3d expected1{yAxis, wpi::units::radian_t{-std::numbers::pi / 2.0}};
+  const Rotation3d expected1{yAxis,
+                             wpi::units::radian_t{-std::numbers::pi / 2.0}};
   EXPECT_EQ(expected1, rot1);
 
   // 45 degree CCW rotation around z-axis
   const Rotation3d rot2{xAxis, Eigen::Vector3d{1.0, 1.0, 0.0}};
-  const Rotation3d expected2{zAxis, wpi::units::radian_t{std::numbers::pi / 4.0}};
+  const Rotation3d expected2{zAxis,
+                             wpi::units::radian_t{std::numbers::pi / 4.0}};
   EXPECT_EQ(expected2, rot2);
 
   // 0 degree rotation of x-axes
diff --git a/wpimath/src/test/native/cpp/geometry/Twist3dTest.cpp b/wpimath/src/test/native/cpp/geometry/Twist3dTest.cpp
index f67a3ba80e..3f00eceb3d 100644
--- a/wpimath/src/test/native/cpp/geometry/Twist3dTest.cpp
+++ b/wpimath/src/test/native/cpp/geometry/Twist3dTest.cpp
@@ -38,9 +38,12 @@ TEST(Twist3dTest, StraightZ) {
 TEST(Twist3dTest, QuarterCircle) {
   Eigen::Vector3d zAxis{0.0, 0.0, 1.0};
 
-  const Twist3d quarterCircle{
-      5_m / 2.0 * std::numbers::pi,           0_m, 0_m, 0_rad, 0_rad,
-      wpi::units::radian_t{std::numbers::pi / 2.0}};
+  const Twist3d quarterCircle{5_m / 2.0 * std::numbers::pi,
+                              0_m,
+                              0_m,
+                              0_rad,
+                              0_rad,
+                              wpi::units::radian_t{std::numbers::pi / 2.0}};
   const auto quarterCirclePose = quarterCircle.Exp();
 
   Transform3d expected{5_m, 5_m, 0_m, Rotation3d{zAxis, 90_deg}};
@@ -89,8 +92,9 @@ TEST(Twist3dTest, Pose3dLogY) {
 
   const auto twist = (end - start).Log();
 
-  Twist3d expected{0_m,   0_m,    wpi::units::meter_t{5.0 / 2.0 * std::numbers::pi},
-                   0_deg, 90_deg, 0_deg};
+  Twist3d expected{
+      0_m,   0_m,    wpi::units::meter_t{5.0 / 2.0 * std::numbers::pi},
+      0_deg, 90_deg, 0_deg};
   EXPECT_EQ(expected, twist);
 
   // Make sure computed twist gives back original end pose
diff --git a/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp b/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp
index ae4ebf0d54..e7669e7823 100644
--- a/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/ChassisSpeedsTest.cpp
@@ -16,7 +16,8 @@ TEST(ChassisSpeedsTest, Discretize) {
   constexpr wpi::units::second_t dt = 10_ms;
 
   const auto speeds = target.Discretize(duration);
-  const wpi::math::Twist2d twist{speeds.vx * dt, speeds.vy * dt, speeds.omega * dt};
+  const wpi::math::Twist2d twist{speeds.vx * dt, speeds.vy * dt,
+                                 speeds.omega * dt};
 
   wpi::math::Pose2d pose;
   for (wpi::units::second_t time = 0_s; time < duration; time += dt) {
@@ -41,7 +42,8 @@ TEST(ChassisSpeedsTest, ToRobotRelative) {
 
 TEST(ChassisSpeedsTest, ToFieldRelative) {
   const auto chassisSpeeds =
-      wpi::math::ChassisSpeeds{1_mps, 0_mps, 0.5_rad_per_s}.ToFieldRelative(45.0_deg);
+      wpi::math::ChassisSpeeds{1_mps, 0_mps, 0.5_rad_per_s}.ToFieldRelative(
+          45.0_deg);
 
   EXPECT_NEAR(1.0 / std::sqrt(2.0), chassisSpeeds.vx.value(), kEpsilon);
   EXPECT_NEAR(1.0 / std::sqrt(2.0), chassisSpeeds.vy.value(), kEpsilon);
diff --git a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp
index 299bebb02f..48626f6a91 100644
--- a/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/DifferentialDriveOdometry3dTest.cpp
@@ -16,7 +16,8 @@ using namespace wpi::math;
 TEST(DifferentialDriveOdometry3dTest, Initialize) {
   DifferentialDriveOdometry3d odometry{
       wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}, 0_m, 0_m,
-      wpi::math::Pose3d{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}}};
+      wpi::math::Pose3d{1_m, 2_m, 0_m,
+                        wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}}};
 
   const wpi::math::Pose3d& pose = odometry.GetPose();
 
@@ -27,11 +28,12 @@ TEST(DifferentialDriveOdometry3dTest, Initialize) {
 }
 
 TEST(DifferentialDriveOdometry3dTest, EncoderDistances) {
-  DifferentialDriveOdometry3d odometry{wpi::math::Rotation3d{0_deg, 0_deg, 45_deg},
-                                       0_m, 0_m};
+  DifferentialDriveOdometry3d odometry{
+      wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}, 0_m, 0_m};
 
-  const auto& pose = odometry.Update(wpi::math::Rotation3d{0_deg, 0_deg, 135_deg},
-                                     0_m, wpi::units::meter_t{5 * std::numbers::pi});
+  const auto& pose =
+      odometry.Update(wpi::math::Rotation3d{0_deg, 0_deg, 135_deg}, 0_m,
+                      wpi::units::meter_t{5 * std::numbers::pi});
 
   EXPECT_NEAR(pose.X().value(), 5.0, kEpsilon);
   EXPECT_NEAR(pose.Y().value(), 5.0, kEpsilon);
diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp
index 82924a8e3f..304de5eb26 100644
--- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometry3dTest.cpp
@@ -28,7 +28,8 @@ class MecanumDriveOdometry3dTest : public ::testing::Test {
 TEST_F(MecanumDriveOdometry3dTest, Initialize) {
   MecanumDriveOdometry3d odometry{
       kinematics, wpi::math::Rotation3d{}, zero,
-      wpi::math::Pose3d{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}}};
+      wpi::math::Pose3d{1_m, 2_m, 0_m,
+                        wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}}};
 
   const wpi::math::Pose3d& pose = odometry.GetPose();
 
@@ -82,7 +83,8 @@ TEST_F(MecanumDriveOdometry3dTest, 90DegreeTurn) {
 }
 
 TEST_F(MecanumDriveOdometry3dTest, GyroAngleReset) {
-  odometry.ResetPosition(wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}, zero, Pose3d{});
+  odometry.ResetPosition(wpi::math::Rotation3d{0_deg, 0_deg, 90_deg}, zero,
+                         Pose3d{});
 
   MecanumDriveWheelPositions wheelDeltas{0.3536_m, 0.3536_m, 0.3536_m,
                                          0.3536_m};
@@ -99,19 +101,22 @@ TEST_F(MecanumDriveOdometry3dTest, GyroAngleReset) {
 TEST_F(MecanumDriveOdometry3dTest, AccuracyFacingTrajectory) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
-  wpi::math::MecanumDriveOdometry3d odometry{kinematics, wpi::math::Rotation3d{},
-                                       wheelPositions};
+  wpi::math::MecanumDriveOdometry3d odometry{
+      kinematics, wpi::math::Rotation3d{}, wheelPositions};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
 
   std::default_random_engine generator;
   std::normal_distribution distribution(0.0, 1.0);
@@ -140,8 +145,9 @@ TEST_F(MecanumDriveOdometry3dTest, AccuracyFacingTrajectory) {
     wheelPositions.rearRight += wheelSpeeds.rearRight * dt;
 
     auto xhat = odometry.Update(
-        wpi::math::Rotation3d{groundTruthState.pose.Rotation() +
-                        wpi::math::Rotation2d{distribution(generator) * 0.05_rad}},
+        wpi::math::Rotation3d{
+            groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad}},
         wheelPositions);
     double error = groundTruthState.pose.Translation()
                        .Distance(xhat.Translation().ToTranslation2d())
@@ -162,19 +168,22 @@ TEST_F(MecanumDriveOdometry3dTest, AccuracyFacingTrajectory) {
 TEST_F(MecanumDriveOdometry3dTest, AccuracyFacingXAxis) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
-  wpi::math::MecanumDriveOdometry3d odometry{kinematics, wpi::math::Rotation3d{},
-                                       wheelPositions};
+  wpi::math::MecanumDriveOdometry3d odometry{
+      kinematics, wpi::math::Rotation3d{}, wheelPositions};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
 
   std::default_random_engine generator;
   std::normal_distribution distribution(0.0, 1.0);
diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp
index b4b68a98cf..3536985454 100644
--- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveOdometryTest.cpp
@@ -80,19 +80,22 @@ TEST_F(MecanumDriveOdometryTest, GyroAngleReset) {
 TEST_F(MecanumDriveOdometryTest, AccuracyFacingTrajectory) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
   wpi::math::MecanumDriveOdometry odometry{kinematics, wpi::math::Rotation2d{},
-                                     wheelPositions};
+                                           wheelPositions};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
 
   std::default_random_engine generator;
   std::normal_distribution distribution(0.0, 1.0);
@@ -120,10 +123,10 @@ TEST_F(MecanumDriveOdometryTest, AccuracyFacingTrajectory) {
     wheelPositions.rearLeft += wheelSpeeds.rearLeft * dt;
     wheelPositions.rearRight += wheelSpeeds.rearRight * dt;
 
-    auto xhat =
-        odometry.Update(groundTruthState.pose.Rotation() +
-                            wpi::math::Rotation2d{distribution(generator) * 0.05_rad},
-                        wheelPositions);
+    auto xhat = odometry.Update(
+        groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad},
+        wheelPositions);
     double error = groundTruthState.pose.Translation()
                        .Distance(xhat.Translation())
                        .value();
@@ -143,19 +146,22 @@ TEST_F(MecanumDriveOdometryTest, AccuracyFacingTrajectory) {
 TEST_F(MecanumDriveOdometryTest, AccuracyFacingXAxis) {
   wpi::math::MecanumDriveKinematics kinematics{
       wpi::math::Translation2d{1_m, 1_m}, wpi::math::Translation2d{1_m, -1_m},
-      wpi::math::Translation2d{-1_m, -1_m}, wpi::math::Translation2d{-1_m, 1_m}};
+      wpi::math::Translation2d{-1_m, -1_m},
+      wpi::math::Translation2d{-1_m, 1_m}};
 
   wpi::math::MecanumDriveWheelPositions wheelPositions;
 
   wpi::math::MecanumDriveOdometry odometry{kinematics, wpi::math::Rotation2d{},
-                                     wheelPositions};
+                                           wheelPositions};
 
-  wpi::math::Trajectory trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg}, wpi::math::Pose2d{3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 135_deg},
-                  wpi::math::Pose2d{-3_m, 0_m, -90_deg},
-                  wpi::math::Pose2d{0_m, 0_m, 45_deg}},
-      wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
+  wpi::math::Trajectory trajectory =
+      wpi::math::TrajectoryGenerator::GenerateTrajectory(
+          std::vector{wpi::math::Pose2d{0_m, 0_m, 45_deg},
+                      wpi::math::Pose2d{3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 135_deg},
+                      wpi::math::Pose2d{-3_m, 0_m, -90_deg},
+                      wpi::math::Pose2d{0_m, 0_m, 45_deg}},
+          wpi::math::TrajectoryConfig(5.0_mps, 2.0_mps_sq));
 
   std::default_random_engine generator;
   std::normal_distribution distribution(0.0, 1.0);
@@ -185,7 +191,8 @@ TEST_F(MecanumDriveOdometryTest, AccuracyFacingXAxis) {
     wheelPositions.rearRight += wheelSpeeds.rearRight * dt;
 
     auto xhat = odometry.Update(
-        wpi::math::Rotation2d{distribution(generator) * 0.05_rad}, wheelPositions);
+        wpi::math::Rotation2d{distribution(generator) * 0.05_rad},
+        wheelPositions);
     double error = groundTruthState.pose.Translation()
                        .Distance(xhat.Translation())
                        .value();
diff --git a/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp b/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp
index 30a81dd65b..6e5c4f9504 100644
--- a/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/MecanumDriveWheelSpeedsTest.cpp
@@ -7,8 +7,10 @@
 #include "wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp"
 
 TEST(MecanumDriveWheelSpeedsTest, Plus) {
-  const wpi::math::MecanumDriveWheelSpeeds left{1.0_mps, 0.5_mps, 2.0_mps, 1.5_mps};
-  const wpi::math::MecanumDriveWheelSpeeds right{2.0_mps, 1.5_mps, 0.5_mps, 1.0_mps};
+  const wpi::math::MecanumDriveWheelSpeeds left{1.0_mps, 0.5_mps, 2.0_mps,
+                                                1.5_mps};
+  const wpi::math::MecanumDriveWheelSpeeds right{2.0_mps, 1.5_mps, 0.5_mps,
+                                                 1.0_mps};
 
   const wpi::math::MecanumDriveWheelSpeeds result = left + right;
 
@@ -19,8 +21,10 @@ TEST(MecanumDriveWheelSpeedsTest, Plus) {
 }
 
 TEST(MecanumDriveWheelSpeedsTest, Minus) {
-  const wpi::math::MecanumDriveWheelSpeeds left{1.0_mps, 0.5_mps, 2.0_mps, 1.5_mps};
-  const wpi::math::MecanumDriveWheelSpeeds right{2.0_mps, 1.5_mps, 0.5_mps, 1.0_mps};
+  const wpi::math::MecanumDriveWheelSpeeds left{1.0_mps, 0.5_mps, 2.0_mps,
+                                                1.5_mps};
+  const wpi::math::MecanumDriveWheelSpeeds right{2.0_mps, 1.5_mps, 0.5_mps,
+                                                 1.0_mps};
 
   const wpi::math::MecanumDriveWheelSpeeds result = left - right;
 
@@ -31,7 +35,8 @@ TEST(MecanumDriveWheelSpeedsTest, Minus) {
 }
 
 TEST(MecanumDriveWheelSpeedsTest, UnaryMinus) {
-  const wpi::math::MecanumDriveWheelSpeeds speeds{1.0_mps, 0.5_mps, 2.0_mps, 1.5_mps};
+  const wpi::math::MecanumDriveWheelSpeeds speeds{1.0_mps, 0.5_mps, 2.0_mps,
+                                                  1.5_mps};
 
   const wpi::math::MecanumDriveWheelSpeeds result = -speeds;
 
@@ -42,7 +47,8 @@ TEST(MecanumDriveWheelSpeedsTest, UnaryMinus) {
 }
 
 TEST(MecanumDriveWheelSpeedsTest, Multiplication) {
-  const wpi::math::MecanumDriveWheelSpeeds speeds{1.0_mps, 0.5_mps, 2.0_mps, 1.5_mps};
+  const wpi::math::MecanumDriveWheelSpeeds speeds{1.0_mps, 0.5_mps, 2.0_mps,
+                                                  1.5_mps};
 
   const wpi::math::MecanumDriveWheelSpeeds result = speeds * 2;
 
@@ -53,7 +59,8 @@ TEST(MecanumDriveWheelSpeedsTest, Multiplication) {
 }
 
 TEST(MecanumDriveWheelSpeedsTest, Division) {
-  const wpi::math::MecanumDriveWheelSpeeds speeds{1.0_mps, 0.5_mps, 2.0_mps, 1.5_mps};
+  const wpi::math::MecanumDriveWheelSpeeds speeds{1.0_mps, 0.5_mps, 2.0_mps,
+                                                  1.5_mps};
 
   const wpi::math::MecanumDriveWheelSpeeds result = speeds / 2;
 
diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp
index 844f4434a5..bc791ad524 100644
--- a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometry3dTest.cpp
@@ -35,7 +35,8 @@ TEST_F(SwerveDriveOdometry3dTest, Initialize) {
       m_kinematics,
       wpi::math::Rotation3d{},
       {zero, zero, zero, zero},
-      wpi::math::Pose3d{1_m, 2_m, 0_m, wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}}};
+      wpi::math::Pose3d{1_m, 2_m, 0_m,
+                        wpi::math::Rotation3d{0_deg, 0_deg, 45_deg}}};
 
   const wpi::math::Pose3d& pose = odometry.GetPose();
 
@@ -140,8 +141,9 @@ TEST_F(SwerveDriveOdometry3dTest, AccuracyFacingTrajectory) {
     br.angle = moduleStates[3].angle;
 
     auto xhat = odometry.Update(
-        wpi::math::Rotation3d{groundTruthState.pose.Rotation() +
-                        wpi::math::Rotation2d{distribution(generator) * 0.05_rad}},
+        wpi::math::Rotation3d{
+            groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad}},
         {fl, fr, bl, br});
     double error = groundTruthState.pose.Translation()
                        .Distance(xhat.Translation().ToTranslation2d())
diff --git a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp
index d5a16720fd..a9d96c72ae 100644
--- a/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/SwerveDriveOdometryTest.cpp
@@ -117,10 +117,10 @@ TEST_F(SwerveDriveOdometryTest, AccuracyFacingTrajectory) {
     bl.angle = moduleStates[2].angle;
     br.angle = moduleStates[3].angle;
 
-    auto xhat =
-        odometry.Update(groundTruthState.pose.Rotation() +
-                            wpi::math::Rotation2d{distribution(generator) * 0.05_rad},
-                        {fl, fr, bl, br});
+    auto xhat = odometry.Update(
+        groundTruthState.pose.Rotation() +
+            wpi::math::Rotation2d{distribution(generator) * 0.05_rad},
+        {fl, fr, bl, br});
     double error = groundTruthState.pose.Translation()
                        .Distance(xhat.Translation())
                        .value();
@@ -183,7 +183,8 @@ TEST_F(SwerveDriveOdometryTest, AccuracyFacingXAxis) {
     br.angle = groundTruthState.pose.Rotation();
 
     auto xhat = odometry.Update(
-        wpi::math::Rotation2d{distribution(generator) * 0.05_rad}, {fl, fr, bl, br});
+        wpi::math::Rotation2d{distribution(generator) * 0.05_rad},
+        {fl, fr, bl, br});
     double error = groundTruthState.pose.Translation()
                        .Distance(xhat.Translation())
                        .value();
diff --git a/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp b/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp
index b8475b1bf0..6d52e8c9d4 100644
--- a/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/proto/SwerveDriveKinematicsProtoTest.cpp
@@ -13,9 +13,10 @@ using namespace wpi::math;
 struct SwerveDriveKinematicsProtoTestData {
   using Type = SwerveDriveKinematics<4>;
 
-  inline static const Type kTestData{
-      wpi::math::Translation2d{1.0_m, 0.9_m}, wpi::math::Translation2d{1.1_m, -0.8_m},
-      wpi::math::Translation2d{-1.2_m, 0.7_m}, wpi::math::Translation2d{-1.3_m, -0.6_m}};
+  inline static const Type kTestData{wpi::math::Translation2d{1.0_m, 0.9_m},
+                                     wpi::math::Translation2d{1.1_m, -0.8_m},
+                                     wpi::math::Translation2d{-1.2_m, 0.7_m},
+                                     wpi::math::Translation2d{-1.3_m, -0.6_m}};
 
   static void CheckEq(const Type& testData, const Type& data) {
     EXPECT_EQ(testData.GetModules(), data.GetModules());
diff --git a/wpimath/src/test/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStructTest.cpp b/wpimath/src/test/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStructTest.cpp
index 7aa770a8e4..0408e03d2e 100644
--- a/wpimath/src/test/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStructTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/struct/DifferentialDriveWheelPositionsStructTest.cpp
@@ -10,7 +10,8 @@ using namespace wpi::math;
 
 namespace {
 
-using StructType = wpi::util::Struct;
+using StructType =
+    wpi::util::Struct;
 const DifferentialDriveWheelPositions kExpectedData{
     DifferentialDriveWheelPositions{1.74_m, 35.04_m}};
 }  // namespace
diff --git a/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp b/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp
index eeeb01f67f..6ef89d05fe 100644
--- a/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp
+++ b/wpimath/src/test/native/cpp/kinematics/struct/SwerveDriveKinematicsStructTest.cpp
@@ -13,9 +13,10 @@ using namespace wpi::math;
 struct SwerveDriveKinematicsStructTestData {
   using Type = SwerveDriveKinematics<4>;
 
-  inline static const Type kTestData{
-      wpi::math::Translation2d{1.0_m, 0.9_m}, wpi::math::Translation2d{1.1_m, -0.8_m},
-      wpi::math::Translation2d{-1.2_m, 0.7_m}, wpi::math::Translation2d{-1.3_m, -0.6_m}};
+  inline static const Type kTestData{wpi::math::Translation2d{1.0_m, 0.9_m},
+                                     wpi::math::Translation2d{1.1_m, -0.8_m},
+                                     wpi::math::Translation2d{-1.2_m, 0.7_m},
+                                     wpi::math::Translation2d{-1.3_m, -0.6_m}};
 
   static void CheckEq(const Type& testData, const Type& data) {
     EXPECT_EQ(testData.GetModules(), data.GetModules());
diff --git a/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp b/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp
index 679d9dab3e..7121af9f5c 100644
--- a/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp
+++ b/wpimath/src/test/native/cpp/path/TravelingSalesmanTest.cpp
@@ -26,7 +26,8 @@ bool IsMatchingCycle(std::span expected,
   assert(expected.size() == actual.size());
 
   // Check actual has expected cycle (forward)
-  wpi::util::circular_buffer actualBufferForward{expected.size()};
+  wpi::util::circular_buffer actualBufferForward{
+      expected.size()};
   for (size_t i = 0; i < actual.size(); ++i) {
     actualBufferForward.push_back(actual[i % actual.size()]);
   }
@@ -36,7 +37,8 @@ bool IsMatchingCycle(std::span expected,
   }
 
   // Check actual has expected cycle (reverse)
-  wpi::util::circular_buffer actualBufferReverse{expected.size()};
+  wpi::util::circular_buffer actualBufferReverse{
+      expected.size()};
   for (size_t i = 0; i < actual.size(); ++i) {
     actualBufferReverse.push_front(actual[(1 + i) % actual.size()]);
   }
@@ -64,8 +66,8 @@ TEST(TravelingSalesmanTest, FiveLengthStaticPathWithDistanceCost) {
   wpi::math::TravelingSalesman traveler;
   wpi::util::array solution = traveler.Solve(poses, 500);
 
-  wpi::util::array expected{poses[0], poses[2], poses[4], poses[1],
-                                      poses[3]};
+  wpi::util::array expected{poses[0], poses[2], poses[4],
+                                                  poses[1], poses[3]};
 
   EXPECT_TRUE(IsMatchingCycle(expected, solution));
 }
@@ -87,8 +89,8 @@ TEST(TravelingSalesmanTest, FiveLengthDynamicPathWithDistanceCost) {
       traveler.Solve(std::span{poses}, 500);
 
   ASSERT_EQ(5u, solution.size());
-  wpi::util::array expected{poses[0], poses[2], poses[4], poses[1],
-                                      poses[3]};
+  wpi::util::array expected{poses[0], poses[2], poses[4],
+                                                  poses[1], poses[3]};
 
   EXPECT_TRUE(IsMatchingCycle(expected, solution));
 }
@@ -110,9 +112,9 @@ TEST(TravelingSalesmanTest, TenLengthStaticPathWithDistanceCost) {
   wpi::math::TravelingSalesman traveler;
   wpi::util::array solution = traveler.Solve(poses, 500);
 
-  wpi::util::array expected{poses[0], poses[4], poses[6], poses[3],
-                                       poses[1], poses[2], poses[9], poses[8],
-                                       poses[5], poses[7]};
+  wpi::util::array expected{
+      poses[0], poses[4], poses[6], poses[3], poses[1],
+      poses[2], poses[9], poses[8], poses[5], poses[7]};
 
   EXPECT_TRUE(IsMatchingCycle(expected, solution));
 }
@@ -136,9 +138,9 @@ TEST(TravelingSalesmanTest, TenLengthDynamicPathWithDistanceCost) {
       traveler.Solve(std::span{poses}, 500);
 
   ASSERT_EQ(10u, solution.size());
-  wpi::util::array expected{poses[0], poses[4], poses[6], poses[3],
-                                       poses[1], poses[2], poses[9], poses[8],
-                                       poses[5], poses[7]};
+  wpi::util::array expected{
+      poses[0], poses[4], poses[6], poses[3], poses[1],
+      poses[2], poses[9], poses[8], poses[5], poses[7]};
 
   EXPECT_TRUE(IsMatchingCycle(expected, solution));
 }
diff --git a/wpimath/src/test/native/cpp/spline/proto/CubicHermiteSplineProtoTest.cpp b/wpimath/src/test/native/cpp/spline/proto/CubicHermiteSplineProtoTest.cpp
index 40dba6251e..558f8b15d5 100644
--- a/wpimath/src/test/native/cpp/spline/proto/CubicHermiteSplineProtoTest.cpp
+++ b/wpimath/src/test/native/cpp/spline/proto/CubicHermiteSplineProtoTest.cpp
@@ -12,9 +12,10 @@ using namespace wpi::math;
 struct CubicHermiteSplineProtoTestData {
   using Type = CubicHermiteSpline;
 
-  inline static const Type kTestData{
-      wpi::util::array{{0.1, 0.2}}, wpi::util::array{{0.3, 0.4}},
-      wpi::util::array{{0.5, 0.6}}, wpi::util::array{{0.7, 0.8}}};
+  inline static const Type kTestData{wpi::util::array{{0.1, 0.2}},
+                                     wpi::util::array{{0.3, 0.4}},
+                                     wpi::util::array{{0.5, 0.6}},
+                                     wpi::util::array{{0.7, 0.8}}};
 
   static void CheckEq(const Type& testData, const Type& data) {
     EXPECT_EQ(testData.GetInitialControlVector().x,
diff --git a/wpimath/src/test/native/cpp/spline/proto/QuinticHermiteSplineProtoTest.cpp b/wpimath/src/test/native/cpp/spline/proto/QuinticHermiteSplineProtoTest.cpp
index aff66d39bf..e729ddb032 100644
--- a/wpimath/src/test/native/cpp/spline/proto/QuinticHermiteSplineProtoTest.cpp
+++ b/wpimath/src/test/native/cpp/spline/proto/QuinticHermiteSplineProtoTest.cpp
@@ -12,10 +12,11 @@ using namespace wpi::math;
 struct QuinticHermiteSplineProtoTestData {
   using Type = QuinticHermiteSpline;
 
-  inline static const Type kTestData{wpi::util::array{{0.01, 0.02, 0.03}},
-                                     wpi::util::array{{0.04, 0.05, 0.06}},
-                                     wpi::util::array{{0.07, 0.08, 0.09}},
-                                     wpi::util::array{{0.10, 0.11, 0.11}}};
+  inline static const Type kTestData{
+      wpi::util::array{{0.01, 0.02, 0.03}},
+      wpi::util::array{{0.04, 0.05, 0.06}},
+      wpi::util::array{{0.07, 0.08, 0.09}},
+      wpi::util::array{{0.10, 0.11, 0.11}}};
 
   static void CheckEq(const Type& testData, const Type& data) {
     EXPECT_EQ(testData.GetInitialControlVector().x,
diff --git a/wpimath/src/test/native/cpp/spline/struct/CubicHermiteSplineStructTest.cpp b/wpimath/src/test/native/cpp/spline/struct/CubicHermiteSplineStructTest.cpp
index d315abb91c..33a12299ba 100644
--- a/wpimath/src/test/native/cpp/spline/struct/CubicHermiteSplineStructTest.cpp
+++ b/wpimath/src/test/native/cpp/spline/struct/CubicHermiteSplineStructTest.cpp
@@ -12,9 +12,10 @@ using namespace wpi::math;
 struct CubicHermiteSplineStructTestData {
   using Type = CubicHermiteSpline;
 
-  inline static const Type kTestData{
-      wpi::util::array{{0.1, 0.2}}, wpi::util::array{{0.3, 0.4}},
-      wpi::util::array{{0.5, 0.6}}, wpi::util::array{{0.7, 0.8}}};
+  inline static const Type kTestData{wpi::util::array{{0.1, 0.2}},
+                                     wpi::util::array{{0.3, 0.4}},
+                                     wpi::util::array{{0.5, 0.6}},
+                                     wpi::util::array{{0.7, 0.8}}};
 
   static void CheckEq(const Type& testData, const Type& data) {
     EXPECT_EQ(testData.GetInitialControlVector().x,
diff --git a/wpimath/src/test/native/cpp/spline/struct/QuinticHermiteSplineStructTest.cpp b/wpimath/src/test/native/cpp/spline/struct/QuinticHermiteSplineStructTest.cpp
index 1fc254581e..af3f127e27 100644
--- a/wpimath/src/test/native/cpp/spline/struct/QuinticHermiteSplineStructTest.cpp
+++ b/wpimath/src/test/native/cpp/spline/struct/QuinticHermiteSplineStructTest.cpp
@@ -12,10 +12,11 @@ using namespace wpi::math;
 struct QuinticHermiteSplineStructTestData {
   using Type = QuinticHermiteSpline;
 
-  inline static const Type kTestData{wpi::util::array{{0.01, 0.02, 0.03}},
-                                     wpi::util::array{{0.04, 0.05, 0.06}},
-                                     wpi::util::array{{0.07, 0.08, 0.09}},
-                                     wpi::util::array{{0.10, 0.11, 0.11}}};
+  inline static const Type kTestData{
+      wpi::util::array{{0.01, 0.02, 0.03}},
+      wpi::util::array{{0.04, 0.05, 0.06}},
+      wpi::util::array{{0.07, 0.08, 0.09}},
+      wpi::util::array{{0.10, 0.11, 0.11}}};
 
   static void CheckEq(const Type& testData, const Type& data) {
     EXPECT_EQ(testData.GetInitialControlVector().x,
diff --git a/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp b/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp
index a5ade643a6..e30fcfb49d 100644
--- a/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp
+++ b/wpimath/src/test/native/cpp/system/DiscretizationTest.cpp
@@ -23,7 +23,8 @@ TEST(DiscretizationTest, DiscretizeA) {
   wpi::math::Vectord<2> x1Discrete = discA * x0;
 
   // We now have pos = vel = 1 and accel = 0, which should give us:
-  wpi::math::Vectord<2> x1Truth{1.0 * x0(0) + 1.0 * x0(1), 0.0 * x0(0) + 1.0 * x0(1)};
+  wpi::math::Vectord<2> x1Truth{1.0 * x0(0) + 1.0 * x0(1),
+                                0.0 * x0(0) + 1.0 * x0(1)};
 
   EXPECT_EQ(x1Truth, x1Discrete);
 }
@@ -44,7 +45,7 @@ TEST(DiscretizationTest, DiscretizeAB) {
 
   // We now have pos = vel = accel = 1, which should give us:
   wpi::math::Vectord<2> x1Truth{1.0 * x0(0) + 1.0 * x0(1) + 0.5 * u(0),
-                          0.0 * x0(0) + 1.0 * x0(1) + 1.0 * u(0)};
+                                0.0 * x0(0) + 1.0 * x0(1) + 1.0 * u(0)};
 
   EXPECT_EQ(x1Truth, x1Discrete);
 }
@@ -61,15 +62,15 @@ TEST(DiscretizationTest, DiscretizeSlowModelAQ) {
   //       T
   // Q_d ≈ ∫ e^(Aτ) Q e^(Aᵀτ) dτ
   //       0
-  wpi::math::Matrixd<2, 2> discQIntegrated =
-      wpi::math::RKDP(wpi::units::second_t,
-                                                 const wpi::math::Matrixd<2, 2>&)>,
-                wpi::math::Matrixd<2, 2>>(
-          [&](wpi::units::second_t t, const wpi::math::Matrixd<2, 2>&) {
-            return wpi::math::Matrixd<2, 2>((contA * t.value()).exp() * contQ *
-                                      (contA.transpose() * t.value()).exp());
-          },
-          0_s, wpi::math::Matrixd<2, 2>::Zero(), dt);
+  wpi::math::Matrixd<2, 2> discQIntegrated = wpi::math::RKDP<
+      std::function(wpi::units::second_t,
+                                             const wpi::math::Matrixd<2, 2>&)>,
+      wpi::math::Matrixd<2, 2>>(
+      [&](wpi::units::second_t t, const wpi::math::Matrixd<2, 2>&) {
+        return wpi::math::Matrixd<2, 2>((contA * t.value()).exp() * contQ *
+                                        (contA.transpose() * t.value()).exp());
+      },
+      0_s, wpi::math::Matrixd<2, 2>::Zero(), dt);
 
   wpi::math::Matrixd<2, 2> discA;
   wpi::math::Matrixd<2, 2> discQ;
@@ -93,15 +94,15 @@ TEST(DiscretizationTest, DiscretizeFastModelAQ) {
   //       T
   // Q_d = ∫ e^(Aτ) Q e^(Aᵀτ) dτ
   //       0
-  wpi::math::Matrixd<2, 2> discQIntegrated =
-      wpi::math::RKDP(wpi::units::second_t,
-                                                 const wpi::math::Matrixd<2, 2>&)>,
-                wpi::math::Matrixd<2, 2>>(
-          [&](wpi::units::second_t t, const wpi::math::Matrixd<2, 2>&) {
-            return wpi::math::Matrixd<2, 2>((contA * t.value()).exp() * contQ *
-                                      (contA.transpose() * t.value()).exp());
-          },
-          0_s, wpi::math::Matrixd<2, 2>::Zero(), dt);
+  wpi::math::Matrixd<2, 2> discQIntegrated = wpi::math::RKDP<
+      std::function(wpi::units::second_t,
+                                             const wpi::math::Matrixd<2, 2>&)>,
+      wpi::math::Matrixd<2, 2>>(
+      [&](wpi::units::second_t t, const wpi::math::Matrixd<2, 2>&) {
+        return wpi::math::Matrixd<2, 2>((contA * t.value()).exp() * contQ *
+                                        (contA.transpose() * t.value()).exp());
+      },
+      0_s, wpi::math::Matrixd<2, 2>::Zero(), dt);
 
   wpi::math::Matrixd<2, 2> discA;
   wpi::math::Matrixd<2, 2> discQ;
diff --git a/wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp b/wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp
index 23cd484db0..8a1d7bcc0d 100644
--- a/wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp
+++ b/wpimath/src/test/native/cpp/system/LinearSystemIDTest.cpp
@@ -20,18 +20,19 @@ TEST(LinearSystemIDTest, IdentifyDrivetrainVelocitySystem) {
 #endif
 
   ASSERT_TRUE(model.A().isApprox(
-      wpi::math::Matrixd<2, 2>{{-10.14132, 3.06598}, {3.06598, -10.14132}}, 0.001));
+      wpi::math::Matrixd<2, 2>{{-10.14132, 3.06598}, {3.06598, -10.14132}},
+      0.001));
   ASSERT_TRUE(model.B().isApprox(
       wpi::math::Matrixd<2, 2>{{4.2590, -1.28762}, {-1.2876, 4.2590}}, 0.001));
-  ASSERT_TRUE(
-      model.C().isApprox(wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}}, 0.001));
-  ASSERT_TRUE(
-      model.D().isApprox(wpi::math::Matrixd<2, 2>{{0.0, 0.0}, {0.0, 0.0}}, 0.001));
+  ASSERT_TRUE(model.C().isApprox(
+      wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}}, 0.001));
+  ASSERT_TRUE(model.D().isApprox(
+      wpi::math::Matrixd<2, 2>{{0.0, 0.0}, {0.0, 0.0}}, 0.001));
 }
 
 TEST(LinearSystemIDTest, ElevatorSystem) {
-  auto model = wpi::math::LinearSystemId::ElevatorSystem(wpi::math::DCMotor::NEO(2), 5_kg,
-                                                   0.05_m, 12)
+  auto model = wpi::math::LinearSystemId::ElevatorSystem(
+                   wpi::math::DCMotor::NEO(2), 5_kg, 0.05_m, 12)
                    .Slice(0);
   ASSERT_TRUE(model.A().isApprox(
       wpi::math::Matrixd<2, 2>{{0.0, 1.0}, {0.0, -99.05473}}, 0.001));
@@ -42,8 +43,8 @@ TEST(LinearSystemIDTest, ElevatorSystem) {
 
 TEST(LinearSystemIDTest, FlywheelSystem) {
 #if __GNUC__ <= 11
-  auto model = wpi::math::LinearSystemId::FlywheelSystem(wpi::math::DCMotor::NEO(2),
-                                                   0.00032_kg_sq_m, 1.0);
+  auto model = wpi::math::LinearSystemId::FlywheelSystem(
+      wpi::math::DCMotor::NEO(2), 0.00032_kg_sq_m, 1.0);
 #else
   constexpr auto model = wpi::math::LinearSystemId::FlywheelSystem(
       wpi::math::DCMotor::NEO(2), 0.00032_kg_sq_m, 1.0);
@@ -57,18 +58,19 @@ TEST(LinearSystemIDTest, FlywheelSystem) {
 
 TEST(LinearSystemIDTest, DCMotorSystem) {
 #if __GNUC__ <= 11
-  auto model = wpi::math::LinearSystemId::DCMotorSystem(wpi::math::DCMotor::NEO(2),
-                                                  0.00032_kg_sq_m, 1.0);
+  auto model = wpi::math::LinearSystemId::DCMotorSystem(
+      wpi::math::DCMotor::NEO(2), 0.00032_kg_sq_m, 1.0);
 #else
   constexpr auto model = wpi::math::LinearSystemId::DCMotorSystem(
       wpi::math::DCMotor::NEO(2), 0.00032_kg_sq_m, 1.0);
 #endif
 
+  ASSERT_TRUE(model.A().isApprox(
+      wpi::math::Matrixd<2, 2>{{0, 1}, {0, -26.87032}}, 0.001));
   ASSERT_TRUE(
-      model.A().isApprox(wpi::math::Matrixd<2, 2>{{0, 1}, {0, -26.87032}}, 0.001));
-  ASSERT_TRUE(model.B().isApprox(wpi::math::Matrixd<2, 1>{0, 1354.166667}, 0.001));
-  ASSERT_TRUE(
-      model.C().isApprox(wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}}, 0.001));
+      model.B().isApprox(wpi::math::Matrixd<2, 1>{0, 1354.166667}, 0.001));
+  ASSERT_TRUE(model.C().isApprox(
+      wpi::math::Matrixd<2, 2>{{1.0, 0.0}, {0.0, 1.0}}, 0.001));
   ASSERT_TRUE(model.D().isApprox(wpi::math::Matrixd<2, 1>{0.0, 0.0}, 0.001));
 }
 
@@ -79,8 +81,9 @@ TEST(LinearSystemIDTest, IdentifyPositionSystem) {
   constexpr double ka = 0.5;
 
 #if __GNUC__ <= 11
-  auto model = wpi::math::LinearSystemId::IdentifyPositionSystem(
-      kv * 1_V / 1_mps, ka * 1_V / 1_mps_sq);
+  auto model =
+      wpi::math::LinearSystemId::IdentifyPositionSystem(
+          kv * 1_V / 1_mps, ka * 1_V / 1_mps_sq);
 #else
   constexpr auto model =
       wpi::math::LinearSystemId::IdentifyPositionSystem(
@@ -89,7 +92,8 @@ TEST(LinearSystemIDTest, IdentifyPositionSystem) {
 
   ASSERT_TRUE(model.A().isApprox(
       wpi::math::Matrixd<2, 2>{{0.0, 1.0}, {0.0, -kv / ka}}, 0.001));
-  ASSERT_TRUE(model.B().isApprox(wpi::math::Matrixd<2, 1>{0.0, 1.0 / ka}, 0.001));
+  ASSERT_TRUE(
+      model.B().isApprox(wpi::math::Matrixd<2, 1>{0.0, 1.0 / ka}, 0.001));
 }
 
 TEST(LinearSystemIDTest, IdentifyVelocitySystem) {
@@ -100,8 +104,9 @@ TEST(LinearSystemIDTest, IdentifyVelocitySystem) {
   constexpr double ka = 0.5;
 
 #if __GNUC__ <= 11
-  auto model = wpi::math::LinearSystemId::IdentifyVelocitySystem(
-      kv * 1_V / 1_mps, ka * 1_V / 1_mps_sq);
+  auto model =
+      wpi::math::LinearSystemId::IdentifyVelocitySystem(
+          kv * 1_V / 1_mps, ka * 1_V / 1_mps_sq);
 #else
   constexpr auto model =
       wpi::math::LinearSystemId::IdentifyVelocitySystem(
diff --git a/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp b/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp
index 2e38e56f26..9fc0053489 100644
--- a/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp
+++ b/wpimath/src/test/native/cpp/system/NumericalIntegrationTest.cpp
@@ -14,7 +14,9 @@ TEST(NumericalIntegrationTest, Exponential) {
   wpi::math::Vectord<1> y0{0.0};
 
   wpi::math::Vectord<1> y1 = wpi::math::RK4(
-      [](const wpi::math::Vectord<1>& x) { return wpi::math::Vectord<1>{std::exp(x(0))}; },
+      [](const wpi::math::Vectord<1>& x) {
+        return wpi::math::Vectord<1>{std::exp(x(0))};
+      },
       y0, 0.1_s);
   EXPECT_NEAR(y1(0), std::exp(0.1) - std::exp(0), 1e-3);
 }
@@ -40,12 +42,13 @@ TEST(NumericalIntegrationTest, ExponentialWithU) {
 //
 //   x(t) = 12eᵗ/(eᵗ + 1)²
 TEST(NumericalIntegrationTest, RK4TimeVarying) {
-  wpi::math::Vectord<1> y0{12.0 * std::exp(5.0) / std::pow(std::exp(5.0) + 1.0, 2.0)};
+  wpi::math::Vectord<1> y0{12.0 * std::exp(5.0) /
+                           std::pow(std::exp(5.0) + 1.0, 2.0)};
 
   wpi::math::Vectord<1> y1 = wpi::math::RK4(
       [](wpi::units::second_t t, const wpi::math::Vectord<1>& x) {
         return wpi::math::Vectord<1>{x(0) *
-                               (2.0 / (std::exp(t.value()) + 1.0) - 1.0)};
+                                     (2.0 / (std::exp(t.value()) + 1.0) - 1.0)};
       },
       5_s, y0, 1_s);
   EXPECT_NEAR(y1(0), 12.0 * std::exp(6.0) / std::pow(std::exp(6.0) + 1.0, 2.0),
@@ -83,12 +86,13 @@ TEST(NumericalIntegrationTest, ExponentialRKDP) {
 //
 //   x(t) = 12eᵗ/(eᵗ + 1)²
 TEST(NumericalIntegrationTest, RKDPTimeVarying) {
-  wpi::math::Vectord<1> y0{12.0 * std::exp(5.0) / std::pow(std::exp(5.0) + 1.0, 2.0)};
+  wpi::math::Vectord<1> y0{12.0 * std::exp(5.0) /
+                           std::pow(std::exp(5.0) + 1.0, 2.0)};
 
   wpi::math::Vectord<1> y1 = wpi::math::RKDP(
       [](wpi::units::second_t t, const wpi::math::Vectord<1>& x) {
         return wpi::math::Vectord<1>{x(0) *
-                               (2.0 / (std::exp(t.value()) + 1.0) - 1.0)};
+                                     (2.0 / (std::exp(t.value()) + 1.0) - 1.0)};
       },
       5_s, y0, 1_s, 1e-12);
   EXPECT_NEAR(y1(0), 12.0 * std::exp(6.0) / std::pow(std::exp(6.0) + 1.0, 2.0),
diff --git a/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp b/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp
index a691fbb6f3..a0a5f43853 100644
--- a/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp
+++ b/wpimath/src/test/native/cpp/system/NumericalJacobianTest.cpp
@@ -6,11 +6,13 @@
 
 #include "wpi/math/system/NumericalJacobian.hpp"
 
-wpi::math::Matrixd<4, 4> A{{1, 2, 4, 1}, {5, 2, 3, 4}, {5, 1, 3, 2}, {1, 1, 3, 7}};
+wpi::math::Matrixd<4, 4> A{
+    {1, 2, 4, 1}, {5, 2, 3, 4}, {5, 1, 3, 2}, {1, 1, 3, 7}};
 wpi::math::Matrixd<4, 2> B{{1, 1}, {2, 1}, {3, 2}, {3, 7}};
 
 // Function from which to recover A and B
-wpi::math::Vectord<4> AxBuFn(const wpi::math::Vectord<4>& x, const wpi::math::Vectord<2>& u) {
+wpi::math::Vectord<4> AxBuFn(const wpi::math::Vectord<4>& x,
+                             const wpi::math::Vectord<2>& u) {
   return A * x + B * u;
 }
 
@@ -36,14 +38,16 @@ Eigen::VectorXd AxBuFn_DynamicSize(const Eigen::VectorXd& x,
 // Test that we can recover A from AxBuFn() pretty accurately
 TEST(NumericalJacobianTest, Ax_DynamicSize) {
   Eigen::MatrixXd newA = wpi::math::NumericalJacobianX(
-      AxBuFn_DynamicSize, wpi::math::Vectord<4>::Zero(), wpi::math::Vectord<2>::Zero());
+      AxBuFn_DynamicSize, wpi::math::Vectord<4>::Zero(),
+      wpi::math::Vectord<2>::Zero());
   EXPECT_TRUE(newA.isApprox(A));
 }
 
 // Test that we can recover B from AxBuFn() pretty accurately
 TEST(NumericalJacobianTest, Bu_DynamicSize) {
   Eigen::MatrixXd newB = wpi::math::NumericalJacobianU(
-      AxBuFn_DynamicSize, wpi::math::Vectord<4>::Zero(), wpi::math::Vectord<2>::Zero());
+      AxBuFn_DynamicSize, wpi::math::Vectord<4>::Zero(),
+      wpi::math::Vectord<2>::Zero());
   EXPECT_TRUE(newB.isApprox(B));
 }
 
@@ -51,7 +55,8 @@ wpi::math::Matrixd<3, 4> C{{1, 2, 4, 1}, {5, 2, 3, 4}, {5, 1, 3, 2}};
 wpi::math::Matrixd<3, 2> D{{1, 1}, {2, 1}, {3, 2}};
 
 // Function from which to recover C and D
-wpi::math::Vectord<3> CxDuFn(const wpi::math::Vectord<4>& x, const wpi::math::Vectord<2>& u) {
+wpi::math::Vectord<3> CxDuFn(const wpi::math::Vectord<4>& x,
+                             const wpi::math::Vectord<2>& u) {
   return C * x + D * u;
 }
 
diff --git a/wpimath/src/test/native/cpp/trajectory/DifferentialDriveVoltageTest.cpp b/wpimath/src/test/native/cpp/trajectory/DifferentialDriveVoltageTest.cpp
index 23ea8c64a6..bc61ca063b 100644
--- a/wpimath/src/test/native/cpp/trajectory/DifferentialDriveVoltageTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/DifferentialDriveVoltageTest.cpp
@@ -23,7 +23,7 @@ using namespace wpi::math;
 TEST(DifferentialDriveVoltageConstraintTest, Constraint) {
   // Pick an unreasonably large kA to ensure the constraint has to do some work
   SimpleMotorFeedforward feedforward{1_V, 1_V / 1_mps,
-                                                   3_V / 1_mps_sq};
+                                                        3_V / 1_mps_sq};
   const DifferentialDriveKinematics kinematics{0.5_m};
   const auto maxVoltage = 10_V;
 
@@ -64,7 +64,7 @@ TEST(DifferentialDriveVoltageConstraintTest, Constraint) {
 
 TEST(DifferentialDriveVoltageConstraintTest, HighCurvature) {
   SimpleMotorFeedforward feedforward{1_V, 1_V / 1_mps,
-                                                   3_V / 1_mps_sq};
+                                                        3_V / 1_mps_sq};
   // Large trackwidth - need to test with radius of curvature less than half of
   // trackwidth
   const DifferentialDriveKinematics kinematics{3_m};
diff --git a/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp b/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp
index 2ce3e96c09..8737ea9ac6 100644
--- a/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/EllipticalRegionConstraintTest.cpp
@@ -26,8 +26,10 @@ TEST(EllipticalRegionConstraintTest, Constraint) {
   bool exceededConstraintOutsideRegion = false;
   for (auto& point : trajectory.States()) {
     if (ellipse.Contains(point.pose.Translation())) {
-      EXPECT_TRUE(wpi::units::math::abs(point.velocity) < maxVelocity + 0.05_mps);
-    } else if (wpi::units::math::abs(point.velocity) >= maxVelocity + 0.05_mps) {
+      EXPECT_TRUE(wpi::units::math::abs(point.velocity) <
+                  maxVelocity + 0.05_mps);
+    } else if (wpi::units::math::abs(point.velocity) >=
+               maxVelocity + 0.05_mps) {
       exceededConstraintOutsideRegion = true;
     }
   }
diff --git a/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp b/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp
index 6cdcdb1601..6abc3bfc79 100644
--- a/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/ExponentialProfileTest.cpp
@@ -33,13 +33,16 @@ static constexpr auto kA = 0.43277_V / 1_mps_sq;
     EXPECT_NEAR_UNITS(val1, val2, eps);          \
   }
 
-wpi::math::ExponentialProfile::State CheckDynamics(
+wpi::math::ExponentialProfile::State
+CheckDynamics(
     wpi::math::ExponentialProfile profile,
-    wpi::math::ExponentialProfile::Constraints
-        constraints,
+    wpi::math::ExponentialProfile::Constraints constraints,
     wpi::math::SimpleMotorFeedforward feedforward,
-    wpi::math::ExponentialProfile::State current,
-    wpi::math::ExponentialProfile::State goal) {
+    wpi::math::ExponentialProfile::State
+        current,
+    wpi::math::ExponentialProfile::State
+        goal) {
   auto next = profile.Calculate(kDt, current, goal);
   auto signal = feedforward.Calculate(current.velocity, next.velocity);
 
@@ -49,13 +52,17 @@ wpi::math::ExponentialProfile::State Check
 }
 
 TEST(ExponentialProfileTest, ReachesGoal) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{10_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{10_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   for (int i = 0; i < 450; ++i) {
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -66,19 +73,24 @@ TEST(ExponentialProfileTest, ReachesGoal) {
 // Tests that decreasing the maximum velocity in the middle when it is already
 // moving faster than the new max is handled correctly
 TEST(ExponentialProfileTest, PosContinuousUnderVelChange) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{10_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{10_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   for (int i = 0; i < 300; ++i) {
     if (i == 150) {
       constraints.maxInput = 9_V;
       profile =
-          wpi::math::ExponentialProfile{constraints};
+          wpi::math::ExponentialProfile{
+              constraints};
     }
 
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -89,19 +101,24 @@ TEST(ExponentialProfileTest, PosContinuousUnderVelChange) {
 // Tests that decreasing the maximum velocity in the middle when it is already
 // moving faster than the new max is handled correctly
 TEST(ExponentialProfileTest, PosContinuousUnderVelChangeBackward) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{-10_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{-10_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   for (int i = 0; i < 300; ++i) {
     if (i == 150) {
       constraints.maxInput = 9_V;
       profile =
-          wpi::math::ExponentialProfile{constraints};
+          wpi::math::ExponentialProfile{
+              constraints};
     }
 
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -111,13 +128,17 @@ TEST(ExponentialProfileTest, PosContinuousUnderVelChangeBackward) {
 
 // There is some somewhat tricky code for dealing with going backwards
 TEST(ExponentialProfileTest, Backwards) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{-10_m, 0_mps};
-  wpi::math::ExponentialProfile::State state;
+  wpi::math::ExponentialProfile::State
+      goal{-10_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state;
 
   for (int i = 0; i < 400; ++i) {
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -126,13 +147,17 @@ TEST(ExponentialProfileTest, Backwards) {
 }
 
 TEST(ExponentialProfileTest, SwitchGoalInMiddle) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{-10_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{-10_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   for (int i = 0; i < 50; ++i) {
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -148,13 +173,17 @@ TEST(ExponentialProfileTest, SwitchGoalInMiddle) {
 
 // Checks to make sure that it hits top speed on long trajectories
 TEST(ExponentialProfileTest, TopSpeed) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{40_m, 0_mps};
-  wpi::math::ExponentialProfile::State state;
+  wpi::math::ExponentialProfile::State
+      goal{40_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state;
 
   wpi::units::meters_per_second_t maxSpeed = 0_mps;
 
@@ -169,13 +198,17 @@ TEST(ExponentialProfileTest, TopSpeed) {
 
 // Checks to make sure that it hits top speed on long trajectories
 TEST(ExponentialProfileTest, TopSpeedBackward) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{-40_m, 0_mps};
-  wpi::math::ExponentialProfile::State state;
+  wpi::math::ExponentialProfile::State
+      goal{-40_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state;
 
   wpi::units::meters_per_second_t maxSpeed = 0_mps;
 
@@ -190,13 +223,17 @@ TEST(ExponentialProfileTest, TopSpeedBackward) {
 
 // Checks to make sure that it hits top speed on long trajectories
 TEST(ExponentialProfileTest, HighInitialSpeed) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{40_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 8_mps};
+  wpi::math::ExponentialProfile::State
+      goal{40_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 8_mps};
 
   for (int i = 0; i < 900; ++i) {
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -207,13 +244,17 @@ TEST(ExponentialProfileTest, HighInitialSpeed) {
 
 // Checks to make sure that it hits top speed on long trajectories
 TEST(ExponentialProfileTest, HighInitialSpeedBackward) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{-40_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, -8_mps};
+  wpi::math::ExponentialProfile::State
+      goal{-40_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, -8_mps};
 
   for (int i = 0; i < 900; ++i) {
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -223,14 +264,19 @@ TEST(ExponentialProfileTest, HighInitialSpeedBackward) {
 }
 
 TEST(ExponentialProfileTest, TestHeuristic) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   std::vector::State,  // initial
-      wpi::math::ExponentialProfile::State,  // goal
-      wpi::math::ExponentialProfile::State>  // inflection
-                                                                   // point
+      wpi::math::ExponentialProfile::State,  // initial
+      wpi::math::ExponentialProfile::State,  // goal
+      wpi::math::ExponentialProfile::State>  // inflection
+                                                                // point
               >
       testCases{
           // red > green and purple => always positive => false
@@ -275,13 +321,17 @@ TEST(ExponentialProfileTest, TestHeuristic) {
 }
 
 TEST(ExponentialProfileTest, TimingToCurrent) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{2_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{2_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   for (int i = 0; i < 900; ++i) {
     state = CheckDynamics(profile, constraints, feedforward, state, goal);
@@ -292,13 +342,17 @@ TEST(ExponentialProfileTest, TimingToCurrent) {
 }
 
 TEST(ExponentialProfileTest, TimingToGoal) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{2_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{2_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   auto prediction = profile.TimeLeftUntil(state, goal);
   auto reachedGoal = false;
@@ -315,13 +369,17 @@ TEST(ExponentialProfileTest, TimingToGoal) {
 }
 
 TEST(ExponentialProfileTest, TimingToNegativeGoal) {
-  wpi::math::ExponentialProfile::Constraints constraints{
+  wpi::math::ExponentialProfile::Constraints constraints{
       12_V, -kV / kA, 1 / kA};
-  wpi::math::ExponentialProfile profile{constraints};
+  wpi::math::ExponentialProfile profile{
+      constraints};
   wpi::math::SimpleMotorFeedforward feedforward{
       0_V, 2.5629_V / 1_mps, 0.43277_V / 1_mps_sq, kDt};
-  wpi::math::ExponentialProfile::State goal{-2_m, 0_mps};
-  wpi::math::ExponentialProfile::State state{0_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      goal{-2_m, 0_mps};
+  wpi::math::ExponentialProfile::State
+      state{0_m, 0_mps};
 
   auto prediction = profile.TimeLeftUntil(state, goal);
   auto reachedGoal = false;
diff --git a/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp b/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp
index 309731179f..9bfb90f146 100644
--- a/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/RectangularRegionConstraintTest.cpp
@@ -26,8 +26,10 @@ TEST(RectangularRegionConstraintTest, Constraint) {
   bool exceededConstraintOutsideRegion = false;
   for (auto& point : trajectory.States()) {
     if (rectangle.Contains(point.pose.Translation())) {
-      EXPECT_TRUE(wpi::units::math::abs(point.velocity) < maxVelocity + 0.05_mps);
-    } else if (wpi::units::math::abs(point.velocity) >= maxVelocity + 0.05_mps) {
+      EXPECT_TRUE(wpi::units::math::abs(point.velocity) <
+                  maxVelocity + 0.05_mps);
+    } else if (wpi::units::math::abs(point.velocity) >=
+               maxVelocity + 0.05_mps) {
       exceededConstraintOutsideRegion = true;
     }
   }
diff --git a/wpimath/src/test/native/cpp/trajectory/TrajectoryTransformTest.cpp b/wpimath/src/test/native/cpp/trajectory/TrajectoryTransformTest.cpp
index ffd2782c08..13e0d26536 100644
--- a/wpimath/src/test/native/cpp/trajectory/TrajectoryTransformTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/TrajectoryTransformTest.cpp
@@ -10,8 +10,9 @@
 #include "wpi/math/trajectory/TrajectoryConfig.hpp"
 #include "wpi/math/trajectory/TrajectoryGenerator.hpp"
 
-void TestSameShapedTrajectory(std::vector statesA,
-                              std::vector statesB) {
+void TestSameShapedTrajectory(
+    std::vector statesA,
+    std::vector statesB) {
   for (unsigned int i = 0; i < statesA.size() - 1; i++) {
     auto a1 = statesA[i].pose;
     auto a2 = statesA[i + 1].pose;
@@ -48,7 +49,8 @@ TEST(TrajectoryTransformsTest, TransformBy) {
 TEST(TrajectoryTransformsTest, RelativeTo) {
   wpi::math::TrajectoryConfig config{3_mps, 3_mps_sq};
   auto trajectory = wpi::math::TrajectoryGenerator::GenerateTrajectory(
-      wpi::math::Pose2d{1_m, 2_m, 30_deg}, {}, wpi::math::Pose2d{5_m, 7_m, 90_deg}, config);
+      wpi::math::Pose2d{1_m, 2_m, 30_deg}, {},
+      wpi::math::Pose2d{5_m, 7_m, 90_deg}, config);
 
   auto transformedTrajectory = trajectory.RelativeTo({1_m, 2_m, 30_deg});
 
diff --git a/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp b/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp
index fca98b6181..43b5a7afb7 100644
--- a/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/TrapezoidProfileTest.cpp
@@ -27,8 +27,8 @@ static constexpr auto kDt = 10_ms;
   }
 
 TEST(TrapezoidProfileTest, ReachesGoal) {
-  wpi::math::TrapezoidProfile::Constraints constraints{1.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      1.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{3_m, 0_mps};
   wpi::math::TrapezoidProfile::State state;
 
@@ -42,8 +42,8 @@ TEST(TrapezoidProfileTest, ReachesGoal) {
 // Tests that decreasing the maximum velocity in the middle when it is already
 // moving faster than the new max is handled correctly
 TEST(TrapezoidProfileTest, PosContinuousUnderVelChange) {
-  wpi::math::TrapezoidProfile::Constraints constraints{1.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      1.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{12_m, 0_mps};
 
   wpi::math::TrapezoidProfile profile{constraints};
@@ -76,8 +76,8 @@ TEST(TrapezoidProfileTest, PosContinuousUnderVelChange) {
 
 // There is some somewhat tricky code for dealing with going backwards
 TEST(TrapezoidProfileTest, Backwards) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{-2_m, 0_mps};
   wpi::math::TrapezoidProfile::State state;
 
@@ -89,8 +89,8 @@ TEST(TrapezoidProfileTest, Backwards) {
 }
 
 TEST(TrapezoidProfileTest, SwitchGoalInMiddle) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{-2_m, 0_mps};
   wpi::math::TrapezoidProfile::State state;
 
@@ -110,8 +110,8 @@ TEST(TrapezoidProfileTest, SwitchGoalInMiddle) {
 
 // Checks to make sure that it hits top speed
 TEST(TrapezoidProfileTest, TopSpeed) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{4_m, 0_mps};
   wpi::math::TrapezoidProfile::State state;
 
@@ -129,8 +129,8 @@ TEST(TrapezoidProfileTest, TopSpeed) {
 }
 
 TEST(TrapezoidProfileTest, TimingToCurrent) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{2_m, 0_mps};
   wpi::math::TrapezoidProfile::State state;
 
@@ -144,13 +144,13 @@ TEST(TrapezoidProfileTest, TimingToCurrent) {
 TEST(TrapezoidProfileTest, TimingToGoal) {
   using wpi::units::unit_cast;
 
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{2_m, 0_mps};
 
   wpi::math::TrapezoidProfile profile{constraints};
-  auto state = profile.Calculate(kDt, goal,
-                                 wpi::math::TrapezoidProfile::State{});
+  auto state = profile.Calculate(
+      kDt, goal, wpi::math::TrapezoidProfile::State{});
 
   auto predictedTimeLeft = profile.TimeLeftUntil(goal.position);
   bool reachedGoal = false;
@@ -168,13 +168,13 @@ TEST(TrapezoidProfileTest, TimingToGoal) {
 TEST(TrapezoidProfileTest, TimingBeforeGoal) {
   using wpi::units::unit_cast;
 
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{2_m, 0_mps};
 
   wpi::math::TrapezoidProfile profile{constraints};
-  auto state = profile.Calculate(kDt, goal,
-                                 wpi::math::TrapezoidProfile::State{});
+  auto state = profile.Calculate(
+      kDt, goal, wpi::math::TrapezoidProfile::State{});
 
   auto predictedTimeLeft = profile.TimeLeftUntil(1_m);
   bool reachedGoal = false;
@@ -191,13 +191,13 @@ TEST(TrapezoidProfileTest, TimingBeforeGoal) {
 TEST(TrapezoidProfileTest, TimingToNegativeGoal) {
   using wpi::units::unit_cast;
 
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{-2_m, 0_mps};
 
   wpi::math::TrapezoidProfile profile{constraints};
-  auto state = profile.Calculate(kDt, goal,
-                                 wpi::math::TrapezoidProfile::State{});
+  auto state = profile.Calculate(
+      kDt, goal, wpi::math::TrapezoidProfile::State{});
 
   auto predictedTimeLeft = profile.TimeLeftUntil(goal.position);
   bool reachedGoal = false;
@@ -215,13 +215,13 @@ TEST(TrapezoidProfileTest, TimingToNegativeGoal) {
 TEST(TrapezoidProfileTest, TimingBeforeNegativeGoal) {
   using wpi::units::unit_cast;
 
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{-2_m, 0_mps};
 
   wpi::math::TrapezoidProfile profile{constraints};
-  auto state = profile.Calculate(kDt, goal,
-                                 wpi::math::TrapezoidProfile::State{});
+  auto state = profile.Calculate(
+      kDt, goal, wpi::math::TrapezoidProfile::State{});
 
   auto predictedTimeLeft = profile.TimeLeftUntil(-1_m);
   bool reachedGoal = false;
@@ -236,15 +236,16 @@ TEST(TrapezoidProfileTest, TimingBeforeNegativeGoal) {
 }
 
 TEST(TrapezoidProfileTest, InitalizationOfCurrentState) {
-  wpi::math::TrapezoidProfile::Constraints constraints{1_mps, 1_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      1_mps, 1_mps_sq};
   wpi::math::TrapezoidProfile profile{constraints};
   EXPECT_NEAR_UNITS(profile.TimeLeftUntil(0_m), 0_s, 1e-10_s);
   EXPECT_NEAR_UNITS(profile.TotalTime(), 0_s, 1e-10_s);
 }
 
 TEST(TrapezoidProfileTest, InitialVelocityConstraints) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{10_m, 0_mps};
   wpi::math::TrapezoidProfile::State state{0_m, -10_mps};
 
@@ -258,8 +259,8 @@ TEST(TrapezoidProfileTest, InitialVelocityConstraints) {
 }
 
 TEST(TrapezoidProfileTest, GoalVelocityConstraints) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{10_m, 5_mps};
   wpi::math::TrapezoidProfile::State state{0_m, 0.75_mps};
 
@@ -273,8 +274,8 @@ TEST(TrapezoidProfileTest, GoalVelocityConstraints) {
 }
 
 TEST(TrapezoidProfileTest, NegativeGoalVelocityConstraints) {
-  wpi::math::TrapezoidProfile::Constraints constraints{0.75_mps,
-                                                               0.75_mps_sq};
+  wpi::math::TrapezoidProfile::Constraints constraints{
+      0.75_mps, 0.75_mps_sq};
   wpi::math::TrapezoidProfile::State goal{10_m, -5_mps};
   wpi::math::TrapezoidProfile::State state{0_m, 0.75_mps};
 
diff --git a/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp b/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp
index ac9c399548..b4fc9c01d6 100644
--- a/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp
+++ b/wpimath/src/test/native/cpp/trajectory/proto/TrajectoryProtoTest.cpp
@@ -13,16 +13,20 @@ namespace {
 
 using ProtoType = wpi::util::Protobuf;
 
-const Trajectory kExpectedData = Trajectory{std::vector{
-    Trajectory::State{1.1_s, 2.2_mps, 3.3_mps_sq,
-                      Pose2d(Translation2d(1.1_m, 2.2_m), Rotation2d(2.2_rad)),
-                      wpi::units::curvature_t{6.6}},
-    Trajectory::State{2.1_s, 2.2_mps, 3.3_mps_sq,
-                      Pose2d(Translation2d(2.1_m, 2.2_m), Rotation2d(2.2_rad)),
-                      wpi::units::curvature_t{6.6}},
-    Trajectory::State{3.1_s, 2.2_mps, 3.3_mps_sq,
-                      Pose2d(Translation2d(3.1_m, 2.2_m), Rotation2d(2.2_rad)),
-                      wpi::units::curvature_t{6.6}}}};
+const Trajectory kExpectedData =
+    Trajectory{std::vector{
+        Trajectory::State{
+            1.1_s, 2.2_mps, 3.3_mps_sq,
+            Pose2d(Translation2d(1.1_m, 2.2_m), Rotation2d(2.2_rad)),
+            wpi::units::curvature_t{6.6}},
+        Trajectory::State{
+            2.1_s, 2.2_mps, 3.3_mps_sq,
+            Pose2d(Translation2d(2.1_m, 2.2_m), Rotation2d(2.2_rad)),
+            wpi::units::curvature_t{6.6}},
+        Trajectory::State{
+            3.1_s, 2.2_mps, 3.3_mps_sq,
+            Pose2d(Translation2d(3.1_m, 2.2_m), Rotation2d(2.2_rad)),
+            wpi::units::curvature_t{6.6}}}};
 }  // namespace
 
 TEST(TrajectoryProtoTest, Roundtrip) {
diff --git a/wpinet/examples/webserver/webserver.cpp b/wpinet/examples/webserver/webserver.cpp
index 4430947a67..32768aa600 100644
--- a/wpinet/examples/webserver/webserver.cpp
+++ b/wpinet/examples/webserver/webserver.cpp
@@ -26,7 +26,7 @@ class MyHttpServerConnection : public wpi::net::HttpServerConnection {
 void MyHttpServerConnection::ProcessRequest() {
   wpi::util::print(stderr, "HTTP request: '{}'\n", m_request.GetUrl());
   wpi::net::UrlParser url{m_request.GetUrl(),
-                     m_request.GetMethod() == wpi::net::HTTP_CONNECT};
+                          m_request.GetMethod() == wpi::net::HTTP_CONNECT};
   if (!url.IsValid()) {
     // failed to parse URL
     SendError(400);
diff --git a/wpinet/src/main/native/cpp/HttpServerConnection.cpp b/wpinet/src/main/native/cpp/HttpServerConnection.cpp
index eda57693de..5e3e349ed0 100644
--- a/wpinet/src/main/native/cpp/HttpServerConnection.cpp
+++ b/wpinet/src/main/native/cpp/HttpServerConnection.cpp
@@ -67,7 +67,7 @@ void HttpServerConnection::BuildHeader(wpi::util::raw_ostream& os, int code,
                                        uint64_t contentLength,
                                        std::string_view extra) {
   wpi::util::print(os, "HTTP/{}.{} {} {}\r\n", m_request.GetMajor(),
-             m_request.GetMinor(), code, codeText);
+                   m_request.GetMinor(), code, codeText);
   if (contentLength == 0) {
     m_keepAlive = false;
   }
diff --git a/wpinet/src/main/native/cpp/HttpUtil.cpp b/wpinet/src/main/native/cpp/HttpUtil.cpp
index 636363943b..a4e8d31bb4 100644
--- a/wpinet/src/main/native/cpp/HttpUtil.cpp
+++ b/wpinet/src/main/native/cpp/HttpUtil.cpp
@@ -16,7 +16,8 @@
 
 namespace wpi::net {
 
-std::string_view UnescapeURI(std::string_view str, wpi::util::SmallVectorImpl& buf,
+std::string_view UnescapeURI(std::string_view str,
+                             wpi::util::SmallVectorImpl& buf,
                              bool* error) {
   buf.clear();
   for (auto i = str.begin(), end = str.end(); i != end; ++i) {
@@ -55,7 +56,8 @@ std::string_view UnescapeURI(std::string_view str, wpi::util::SmallVectorImpl& buf,
+std::string_view EscapeURI(std::string_view str,
+                           wpi::util::SmallVectorImpl& buf,
                            bool spacePlus) {
   static const char* const hexLut = "0123456789ABCDEF";
 
@@ -82,7 +84,8 @@ std::string_view EscapeURI(std::string_view str, wpi::util::SmallVectorImpl& buf) {
+std::string_view EscapeHTML(std::string_view str,
+                            wpi::util::SmallVectorImpl& buf) {
   buf.clear();
   for (auto i = str.begin(), end = str.end(); i != end; ++i) {
     if (*i == '&') {
@@ -166,7 +169,8 @@ std::string_view HttpPath::operator[](size_t n) const {
   return slice(m_pathBuf, n == 0 ? 0 : m_pathEnds[n - 1], m_pathEnds[n]);
 }
 
-bool ParseHttpHeaders(wpi::util::raw_istream& is, wpi::util::SmallVectorImpl* contentType,
+bool ParseHttpHeaders(wpi::util::raw_istream& is,
+                      wpi::util::SmallVectorImpl* contentType,
                       wpi::util::SmallVectorImpl* contentLength) {
   if (contentType) {
     contentType->clear();
@@ -215,8 +219,8 @@ bool ParseHttpHeaders(wpi::util::raw_istream& is, wpi::util::SmallVectorImpl searchBuf;
   searchBuf.resize(boundary.size() + 2);
   size_t searchPos = 0;
diff --git a/wpinet/src/main/native/cpp/MulticastHandleManager.hpp b/wpinet/src/main/native/cpp/MulticastHandleManager.hpp
index f78a98e526..67551f9ef8 100644
--- a/wpinet/src/main/native/cpp/MulticastHandleManager.hpp
+++ b/wpinet/src/main/native/cpp/MulticastHandleManager.hpp
@@ -15,9 +15,11 @@ namespace wpi::net {
 struct MulticastHandleManager {
   wpi::util::mutex mutex;
   wpi::util::UidVector handleIds;
-  wpi::util::DenseMap>
+  wpi::util::DenseMap>
       resolvers;
-  wpi::util::DenseMap>
+  wpi::util::DenseMap>
       announcers;
 #ifdef _WIN32
   ~MulticastHandleManager();
diff --git a/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp b/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp
index 90ebcc6164..da18014790 100644
--- a/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp
+++ b/wpinet/src/main/native/cpp/MulticastServiceResolver.cpp
@@ -19,7 +19,8 @@ WPI_MulticastServiceResolverHandle WPI_CreateMulticastServiceResolver(
   auto& manager = wpi::net::GetMulticastManager();
   std::scoped_lock lock{manager.mutex};
 
-  auto resolver = std::make_unique(serviceType);
+  auto resolver =
+      std::make_unique(serviceType);
 
   size_t index = manager.handleIds.emplace_back(2);
   manager.resolvers[index] = std::move(resolver);
@@ -99,7 +100,8 @@ WPI_ServiceData* WPI_GetMulticastServiceResolverData(
     allocSize += valuesTotalLength;
   }
 
-  uint8_t* cDataRaw = reinterpret_cast(wpi::util::safe_malloc(allocSize));
+  uint8_t* cDataRaw =
+      reinterpret_cast(wpi::util::safe_malloc(allocSize));
   if (!cDataRaw) {
     return nullptr;
   }
diff --git a/wpinet/src/main/native/cpp/ParallelTcpConnector.cpp b/wpinet/src/main/native/cpp/ParallelTcpConnector.cpp
index 5339ef7ba6..a9030efb64 100644
--- a/wpinet/src/main/native/cpp/ParallelTcpConnector.cpp
+++ b/wpinet/src/main/native/cpp/ParallelTcpConnector.cpp
@@ -23,8 +23,9 @@ using namespace wpi::net;
 
 ParallelTcpConnector::ParallelTcpConnector(
     wpi::net::uv::Loop& loop, wpi::net::uv::Timer::Time reconnectRate,
-    wpi::util::Logger& logger, std::function connected,
-    bool ipv4Only, const private_init&)
+    wpi::util::Logger& logger,
+    std::function connected, bool ipv4Only,
+    const private_init&)
     : m_loop{loop},
       m_logger{logger},
       m_reconnectRate{reconnectRate},
diff --git a/wpinet/src/main/native/cpp/PortForwarder.cpp b/wpinet/src/main/native/cpp/PortForwarder.cpp
index b504c5cc5e..3c6a0b2889 100644
--- a/wpinet/src/main/native/cpp/PortForwarder.cpp
+++ b/wpinet/src/main/native/cpp/PortForwarder.cpp
@@ -67,7 +67,8 @@ void PortForwarder::Add(unsigned int port, std::string_view remoteHost,
       auto& loop = serverPtr->GetLoopRef();
       auto client = serverPtr->Accept();
       if (!client) {
-        wpi::util::print(stderr, "PortForwarder: Connecting to client failed\n");
+        wpi::util::print(stderr,
+                         "PortForwarder: Connecting to client failed\n");
         return;
       }
 
diff --git a/wpinet/src/main/native/cpp/WebServer.cpp b/wpinet/src/main/native/cpp/WebServer.cpp
index e019620348..ce5d5d8766 100644
--- a/wpinet/src/main/native/cpp/WebServer.cpp
+++ b/wpinet/src/main/native/cpp/WebServer.cpp
@@ -228,7 +228,7 @@ void MyHttpConnection::SendFileResponse(int code, std::string_view codeText,
 void MyHttpConnection::ProcessRequest() {
   // fmt::print(stderr, "HTTP request: '{}'\n", m_request.GetUrl());
   wpi::net::UrlParser url{m_request.GetUrl(),
-                     m_request.GetMethod() == wpi::net::HTTP_CONNECT};
+                          m_request.GetMethod() == wpi::net::HTTP_CONNECT};
   if (!url.IsValid()) {
     // failed to parse URL
     SendError(400);
@@ -257,7 +257,8 @@ void MyHttpConnection::ProcessRequest() {
   HttpQueryMap qmap{query};
 
   const bool isGET = m_request.GetMethod() == wpi::net::HTTP_GET;
-  if (isGET && wpi::util::starts_with(path, '/') && !wpi::util::contains(path, "..")) {
+  if (isGET && wpi::util::starts_with(path, '/') &&
+      !wpi::util::contains(path, "..")) {
     fs::path fullpath = fmt::format("{}{}", m_path, path);
     std::error_code ec;
     bool isdir = fs::is_directory(fullpath, ec);
@@ -282,13 +283,13 @@ void MyHttpConnection::ProcessRequest() {
           } else {
             files.emplace_back(
                 wpi::util::json{{"name", std::move(name)},
-                          {"size", subdir ? 0 : entry.file_size(ec)}});
+                                {"size", subdir ? 0 : entry.file_size(ec)}});
           }
         }
-        SendResponse(
-            200, "OK", "text/json",
-            wpi::util::json{{"dirs", std::move(dirs)}, {"files", std::move(files)}}
-                .dump());
+        SendResponse(200, "OK", "text/json",
+                     wpi::util::json{{"dirs", std::move(dirs)},
+                                     {"files", std::move(files)}}
+                         .dump());
       } else if (fs::exists(indexpath)) {
         SendFileResponse(200, "OK", GetMimeType("html"), indexpath,
                          "Content-Disposition: filename=\"index.html\"\r\n");
@@ -333,7 +334,8 @@ void MyHttpConnection::ProcessRequest() {
       os << "Content-Disposition: filename=\"";
       os.write_escaped(fullpath.filename().string());
       os << "\"\r\n";
-      SendFileResponse(200, "OK", GetMimeType(wpi::util::rsplit(path, '.').second),
+      SendFileResponse(200, "OK",
+                       GetMimeType(wpi::util::rsplit(path, '.').second),
                        fullpath, os.str());
     }
   } else {
@@ -366,22 +368,21 @@ void WebServer::Start(unsigned int port, std::string_view path) {
     server->Bind("", port);
 
     // when we get a connection, accept it
-    server->connection.connect(
-        [serverPtr = server.get(), path = std::string{path}] {
-          auto client = serverPtr->Accept();
-          if (!client) {
-            wpi::util::print(stderr, "WebServer: Connecting to client failed\n");
-            return;
-          }
+    server->connection.connect([serverPtr = server.get(),
+                                path = std::string{path}] {
+      auto client = serverPtr->Accept();
+      if (!client) {
+        wpi::util::print(stderr, "WebServer: Connecting to client failed\n");
+        return;
+      }
 
-          // close on error
-          client->error.connect([clientPtr = client.get()](uv::Error err) {
-            clientPtr->Close();
-          });
+      // close on error
+      client->error.connect(
+          [clientPtr = client.get()](uv::Error err) { clientPtr->Close(); });
 
-          auto conn = std::make_shared(client, path);
-          client->SetData(conn);
-        });
+      auto conn = std::make_shared(client, path);
+      client->SetData(conn);
+    });
 
     // start listening for incoming connections
     server->Listen();
diff --git a/wpinet/src/main/native/cpp/WebSocket.cpp b/wpinet/src/main/native/cpp/WebSocket.cpp
index 4f91ae4da4..8c7cf93e8a 100644
--- a/wpinet/src/main/native/cpp/WebSocket.cpp
+++ b/wpinet/src/main/native/cpp/WebSocket.cpp
@@ -132,9 +132,9 @@ class WebSocket::ClientHandshakeData {
     }
   }
 
-  wpi::util::SmallString<64> key;                       // the key sent to the server
-  wpi::util::SmallVector protocols;     // valid protocols
-  HttpParser parser{HttpParser::kResponse};  // server response parser
+  wpi::util::SmallString<64> key;  // the key sent to the server
+  wpi::util::SmallVector protocols;  // valid protocols
+  HttpParser parser{HttpParser::kResponse};          // server response parser
   bool hasUpgrade = false;
   bool hasConnection = false;
   bool hasAccept = false;
@@ -286,7 +286,8 @@ void WebSocket::StartClient(std::string_view uri, std::string_view host,
         } else if (wpi::util::equals_lower(name, "sec-websocket-accept")) {
           // Check against expected response
           wpi::util::SmallString<64> acceptBuf;
-          if (!wpi::util::equals(value, AcceptHash(m_clientHandshake->key, acceptBuf))) {
+          if (!wpi::util::equals(
+                  value, AcceptHash(m_clientHandshake->key, acceptBuf))) {
             return Terminate(1002, "invalid accept key");
           }
           m_clientHandshake->hasAccept = true;
@@ -640,10 +641,10 @@ void WebSocket::HandleIncoming(uv::Buffer& buf, size_t size) {
             } else {
               code = (static_cast(m_controlPayload[0]) << 8) |
                      static_cast(m_controlPayload[1]);
-              reason =
-                  wpi::util::drop_front({reinterpret_cast(m_controlPayload.data()),
-                              m_controlPayload.size()},
-                             2);
+              reason = wpi::util::drop_front(
+                  {reinterpret_cast(m_controlPayload.data()),
+                   m_controlPayload.size()},
+                  2);
             }
             // Echo the close if we didn't previously send it
             if (m_state != CLOSING) {
diff --git a/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp b/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp
index 0d93f864d1..ca5eba3741 100644
--- a/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp
+++ b/wpinet/src/main/native/cpp/jni/WPINetJNI.cpp
@@ -63,9 +63,9 @@ JNIEXPORT void JNICALL
 Java_org_wpilib_net_WPINetJNI_addPortForwarder
   (JNIEnv* env, jclass, jint port, jstring remoteHost, jint remotePort)
 {
-  wpi::net::PortForwarder::GetInstance().Add(static_cast(port),
-                                        JStringRef{env, remoteHost}.str(),
-                                        static_cast(remotePort));
+  wpi::net::PortForwarder::GetInstance().Add(
+      static_cast(port), JStringRef{env, remoteHost}.str(),
+      static_cast(remotePort));
 }
 
 /*
@@ -90,7 +90,7 @@ Java_org_wpilib_net_WPINetJNI_startWebServer
   (JNIEnv* env, jclass, jint port, jstring path)
 {
   wpi::net::WebServer::GetInstance().Start(static_cast(port),
-                                      JStringRef{env, path}.str());
+                                           JStringRef{env, path}.str());
 }
 
 /*
@@ -221,8 +221,8 @@ Java_org_wpilib_net_WPINetJNI_createMulticastServiceResolver
   std::scoped_lock lock{manager.mutex};
   JStringRef serviceTypeRef{env, serviceType};
 
-  auto resolver =
-      std::make_unique(serviceTypeRef.str());
+  auto resolver = std::make_unique(
+      serviceTypeRef.str());
 
   size_t index = manager.handleIds.emplace_back(2);
 
diff --git a/wpinet/src/main/native/include/wpi/net/DsClient.hpp b/wpinet/src/main/native/include/wpi/net/DsClient.hpp
index 55df512c20..707c0608e4 100644
--- a/wpinet/src/main/native/include/wpi/net/DsClient.hpp
+++ b/wpinet/src/main/native/include/wpi/net/DsClient.hpp
@@ -30,7 +30,8 @@ class DsClient : public std::enable_shared_from_this {
     return std::make_shared(loop, logger, private_init{});
   }
 
-  DsClient(wpi::net::uv::Loop& loop, wpi::util::Logger& logger, const private_init&);
+  DsClient(wpi::net::uv::Loop& loop, wpi::util::Logger& logger,
+           const private_init&);
   ~DsClient();
   DsClient(const DsClient&) = delete;
   DsClient& operator=(const DsClient&) = delete;
diff --git a/wpinet/src/main/native/include/wpi/net/HttpServerConnection.hpp b/wpinet/src/main/native/include/wpi/net/HttpServerConnection.hpp
index 2b2d4c7c5c..61bffd0146 100644
--- a/wpinet/src/main/native/include/wpi/net/HttpServerConnection.hpp
+++ b/wpinet/src/main/native/include/wpi/net/HttpServerConnection.hpp
@@ -65,7 +65,8 @@ class HttpServerConnection {
    *                      be set to false.
    * @param extra Extra HTTP headers to send, including final "\r\n"
    */
-  virtual void BuildHeader(wpi::util::raw_ostream& os, int code, std::string_view codeText,
+  virtual void BuildHeader(wpi::util::raw_ostream& os, int code,
+                           std::string_view codeText,
                            std::string_view contentType, uint64_t contentLength,
                            std::string_view extra = {});
 
diff --git a/wpinet/src/main/native/include/wpi/net/HttpUtil.hpp b/wpinet/src/main/native/include/wpi/net/HttpUtil.hpp
index a9f4b80fe4..797f6fe9eb 100644
--- a/wpinet/src/main/native/include/wpi/net/HttpUtil.hpp
+++ b/wpinet/src/main/native/include/wpi/net/HttpUtil.hpp
@@ -28,20 +28,23 @@ namespace wpi::net {
 // @param buf Buffer for output
 // @param error Set to true if an error occurred
 // @return Escaped string
-std::string_view UnescapeURI(std::string_view str, wpi::util::SmallVectorImpl& buf,
+std::string_view UnescapeURI(std::string_view str,
+                             wpi::util::SmallVectorImpl& buf,
                              bool* error);
 
 // Escape a string with %xx-encoding.
 // @param buf Buffer for output
 // @param spacePlus If true, encodes spaces to '+' rather than "%20"
 // @return Escaped string
-std::string_view EscapeURI(std::string_view str, wpi::util::SmallVectorImpl& buf,
+std::string_view EscapeURI(std::string_view str,
+                           wpi::util::SmallVectorImpl& buf,
                            bool spacePlus = true);
 
 // Escape a string for HTML output.
 // @param buf Buffer for output
 // @return Escaped string
-std::string_view EscapeHTML(std::string_view str, wpi::util::SmallVectorImpl& buf);
+std::string_view EscapeHTML(std::string_view str,
+                            wpi::util::SmallVectorImpl& buf);
 
 // Parse a set of HTTP headers.  Saves just the Content-Type and Content-Length
 // fields.
@@ -49,7 +52,8 @@ std::string_view EscapeHTML(std::string_view str, wpi::util::SmallVectorImpl* contentType,
+bool ParseHttpHeaders(wpi::util::raw_istream& is,
+                      wpi::util::SmallVectorImpl* contentType,
                       wpi::util::SmallVectorImpl* contentLength);
 
 // Look for a MIME multi-part boundary.  On return, the input stream will
@@ -59,8 +63,8 @@ bool ParseHttpHeaders(wpi::util::raw_istream& is, wpi::util::SmallVectorImpl Get(std::string_view name,
-                                      wpi::util::SmallVectorImpl& buf) const;
+  std::optional Get(
+      std::string_view name, wpi::util::SmallVectorImpl& buf) const;
 
  private:
   wpi::util::StringMap m_elems;
@@ -322,7 +326,8 @@ class HttpRequest {
   template 
   HttpRequest(const HttpLocation& loc, const T& extraParams)
       : host{loc.host}, port{loc.port} {
-    wpi::util::SmallVector, 4> params;
+    wpi::util::SmallVector, 4>
+        params;
     for (const auto& p : loc.params) {
       params.emplace_back(std::pair{GetFirst(p), GetSecond(p)});
     }
diff --git a/wpinet/src/main/native/include/wpi/net/HttpWebSocketServerConnection.hpp b/wpinet/src/main/native/include/wpi/net/HttpWebSocketServerConnection.hpp
index 1310473bf5..c5bea5d3d8 100644
--- a/wpinet/src/main/native/include/wpi/net/HttpWebSocketServerConnection.hpp
+++ b/wpinet/src/main/native/include/wpi/net/HttpWebSocketServerConnection.hpp
@@ -44,7 +44,7 @@ class HttpWebSocketServerConnection
     m_helper.upgrade.connect([this] {
       // Negotiate sub-protocol
       wpi::util::SmallVector protocols{m_protocols.begin(),
-                                                 m_protocols.end()};
+                                                            m_protocols.end()};
       std::string_view protocol = m_helper.MatchProtocol(protocols).second;
 
       // Check that the upgrade is valid
diff --git a/wpinet/src/main/native/include/wpi/net/ParallelTcpConnector.hpp b/wpinet/src/main/native/include/wpi/net/ParallelTcpConnector.hpp
index b4d396dd35..d97db602b8 100644
--- a/wpinet/src/main/native/include/wpi/net/ParallelTcpConnector.hpp
+++ b/wpinet/src/main/native/include/wpi/net/ParallelTcpConnector.hpp
@@ -61,7 +61,8 @@ class ParallelTcpConnector
    */
   static std::shared_ptr Create(
       wpi::net::uv::Loop& loop, wpi::net::uv::Timer::Time reconnectRate,
-      wpi::util::Logger& logger, std::function connected,
+      wpi::util::Logger& logger,
+      std::function connected,
       bool ipv4Only = false) {
     if (loop.IsClosing()) {
       return nullptr;
@@ -71,7 +72,8 @@ class ParallelTcpConnector
                                                   ipv4Only, private_init{});
   }
 
-  ParallelTcpConnector(wpi::net::uv::Loop& loop, wpi::net::uv::Timer::Time reconnectRate,
+  ParallelTcpConnector(wpi::net::uv::Loop& loop,
+                       wpi::net::uv::Timer::Time reconnectRate,
                        wpi::util::Logger& logger,
                        std::function connected,
                        bool ipv4Only, const private_init&);
diff --git a/wpinet/src/main/native/include/wpi/net/UDPClient.hpp b/wpinet/src/main/native/include/wpi/net/UDPClient.hpp
index ce5851cffc..95dc8097aa 100644
--- a/wpinet/src/main/native/include/wpi/net/UDPClient.hpp
+++ b/wpinet/src/main/native/include/wpi/net/UDPClient.hpp
@@ -41,7 +41,8 @@ class UDPClient {
   int send(std::string_view data, std::string_view server, int port);
   int receive(uint8_t* data_received, int receive_len);
   int receive(uint8_t* data_received, int receive_len,
-              wpi::util::SmallVectorImpl* addr_received, int* port_received);
+              wpi::util::SmallVectorImpl* addr_received,
+              int* port_received);
   int set_timeout(double timeout);
 };
 
diff --git a/wpinet/src/main/native/include/wpi/net/UrlParser.hpp b/wpinet/src/main/native/include/wpi/net/UrlParser.hpp
index cf7bd2bc24..5c10464841 100644
--- a/wpinet/src/main/native/include/wpi/net/UrlParser.hpp
+++ b/wpinet/src/main/native/include/wpi/net/UrlParser.hpp
@@ -54,34 +54,34 @@ class UrlParser {
 
   std::string_view GetSchema() const {
     return wpi::util::substr(m_data, m_url.field_data[UF_SCHEMA].off,
-                       m_url.field_data[UF_SCHEMA].len);
+                             m_url.field_data[UF_SCHEMA].len);
   }
 
   std::string_view GetHost() const {
     return wpi::util::substr(m_data, m_url.field_data[UF_HOST].off,
-                       m_url.field_data[UF_HOST].len);
+                             m_url.field_data[UF_HOST].len);
   }
 
   unsigned int GetPort() const { return m_url.port; }
 
   std::string_view GetPath() const {
     return wpi::util::substr(m_data, m_url.field_data[UF_PATH].off,
-                       m_url.field_data[UF_PATH].len);
+                             m_url.field_data[UF_PATH].len);
   }
 
   std::string_view GetQuery() const {
     return wpi::util::substr(m_data, m_url.field_data[UF_QUERY].off,
-                       m_url.field_data[UF_QUERY].len);
+                             m_url.field_data[UF_QUERY].len);
   }
 
   std::string_view GetFragment() const {
     return wpi::util::substr(m_data, m_url.field_data[UF_FRAGMENT].off,
-                       m_url.field_data[UF_FRAGMENT].len);
+                             m_url.field_data[UF_FRAGMENT].len);
   }
 
   std::string_view GetUserInfo() const {
     return wpi::util::substr(m_data, m_url.field_data[UF_USERINFO].off,
-                       m_url.field_data[UF_USERINFO].len);
+                             m_url.field_data[UF_USERINFO].len);
   }
 
  private:
diff --git a/wpinet/src/main/native/include/wpi/net/raw_uv_ostream.hpp b/wpinet/src/main/native/include/wpi/net/raw_uv_ostream.hpp
index 14bfcd55cf..b1b783f42e 100644
--- a/wpinet/src/main/native/include/wpi/net/raw_uv_ostream.hpp
+++ b/wpinet/src/main/native/include/wpi/net/raw_uv_ostream.hpp
@@ -16,9 +16,9 @@
 namespace wpi::net {
 
 /**
- * wpi::util::raw_ostream style output to a wpi::util::SmallVector of uv::Buffer buffers.  Fixed-size
- * buffers are allocated and appended as necessary to fit the data being output.
- * The wpi::util::SmallVector need not be empty at start.
+ * wpi::util::raw_ostream style output to a wpi::util::SmallVector of uv::Buffer
+ * buffers.  Fixed-size buffers are allocated and appended as necessary to fit
+ * the data being output. The wpi::util::SmallVector need not be empty at start.
  */
 class raw_uv_ostream : public wpi::util::raw_ostream {
  public:
diff --git a/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp b/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp
index 961a4de4d5..72d4154460 100644
--- a/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp
+++ b/wpinet/src/main/native/include/wpi/net/uv/AsyncFunction.hpp
@@ -38,7 +38,8 @@ class AsyncFunction final
 
  public:
   AsyncFunction(const std::shared_ptr& loop,
-                std::function, T...)> func, const private_init&)
+                std::function, T...)> func,
+                const private_init&)
       : wakeup{std::move(func)}, m_loop{loop} {}
   ~AsyncFunction() noexcept override {
     if (auto loop = m_loop.lock()) {
@@ -58,7 +59,8 @@ class AsyncFunction final
    *             wakeup function, a default-constructed value is "returned".
    */
   static std::shared_ptr Create(
-      Loop& loop, std::function, T...)> func = nullptr) {
+      Loop& loop,
+      std::function, T...)> func = nullptr) {
     return Create(loop.shared_from_this(), std::move(func));
   }
 
diff --git a/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp b/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp
index 07da9aa5a2..59dbb278f2 100644
--- a/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp
+++ b/wpinet/src/main/native/include/wpi/net/uv/Handle.hpp
@@ -20,7 +20,7 @@
 
 namespace wpi::util {
 class Logger;
-}  // namespace wpi::net
+}  // namespace wpi::util
 
 namespace wpi::net::uv {
 
diff --git a/wpinet/src/main/native/linux/MulticastServiceResolver.cpp b/wpinet/src/main/native/linux/MulticastServiceResolver.cpp
index 0b6bb7b879..5f22af95c3 100644
--- a/wpinet/src/main/native/linux/MulticastServiceResolver.cpp
+++ b/wpinet/src/main/native/linux/MulticastServiceResolver.cpp
@@ -89,8 +89,8 @@ static void ResolveCallback(AvahiServiceResolver* r, AvahiIfIndex interface,
           continue;
         }
         std::string_view key = wpi::util::substr(value, 0, splitIndex);
-        value =
-            wpi::util::substr(value, splitIndex + 1, value.size() - splitIndex - 1);
+        value = wpi::util::substr(value, splitIndex + 1,
+                                  value.size() - splitIndex - 1);
         data.txt.emplace_back(std::pair{key, value});
       }
       wpi::util::SmallString<256> outputHostName;
diff --git a/wpinet/src/main/native/windows/MulticastServiceResolver.cpp b/wpinet/src/main/native/windows/MulticastServiceResolver.cpp
index ee1b5972db..97a9042e70 100644
--- a/wpinet/src/main/native/windows/MulticastServiceResolver.cpp
+++ b/wpinet/src/main/native/windows/MulticastServiceResolver.cpp
@@ -161,7 +161,7 @@ static _Function_class_(DNS_QUERY_COMPLETION_ROUTINE) VOID WINAPI
               storage.clear();
               wideStr = std::span{
                   reinterpret_cast(wideView.data() +
-                                                      splitIndex + 1),
+                                                            splitIndex + 1),
                   wideView.size() - splitIndex - 1};
               wpi::util::convertUTF16ToUTF8String(wideStr, storage);
               pair.second = std::string{storage};
@@ -171,7 +171,8 @@ static _Function_class_(DNS_QUERY_COMPLETION_ROUTINE) VOID WINAPI
 
         storage.clear();
         std::span wideHostName{
-            reinterpret_cast(A->pName), wcslen(A->pName)};
+            reinterpret_cast(A->pName),
+            wcslen(A->pName)};
         wpi::util::convertUTF16ToUTF8String(wideHostName, storage);
         storage.append(".");
 
diff --git a/wpinet/src/netconsoleServer/native/cpp/main.cpp b/wpinet/src/netconsoleServer/native/cpp/main.cpp
index 44a26c0fb6..954897a6eb 100644
--- a/wpinet/src/netconsoleServer/native/cpp/main.cpp
+++ b/wpinet/src/netconsoleServer/native/cpp/main.cpp
@@ -34,8 +34,8 @@ namespace uv = wpi::net::uv;
 static uint64_t startTime = wpi::util::Now();
 
 static bool NewlineBuffer(std::string& rem, uv::Buffer& buf, size_t len,
-                          wpi::util::SmallVectorImpl& bufs, bool tcp,
-                          uint16_t tcpSeq) {
+                          wpi::util::SmallVectorImpl& bufs,
+                          bool tcp, uint16_t tcpSeq) {
   // scan for last newline
   std::string_view str(buf.base, len);
   size_t idx = str.rfind('\n');
@@ -156,7 +156,7 @@ int main(int argc, char* argv[]) {
       broadcastUdp = true;
     } else {
       wpi::util::print(stderr, "unrecognized command line option {}\n",
-                 argv[programArgc]);
+                       argv[programArgc]);
       err = true;
     }
     ++programArgc;
@@ -175,8 +175,9 @@ int main(int argc, char* argv[]) {
   uv::Process::DisableStdioInheritance();
 
   auto loop = uv::Loop::Create();
-  loop->error.connect(
-      [](uv::Error err) { wpi::util::print(stderr, "uv ERROR: {}\n", err.str()); });
+  loop->error.connect([](uv::Error err) {
+    wpi::util::print(stderr, "uv ERROR: {}\n", err.str());
+  });
 
   // create pipes to communicate with child
   auto stdinPipe = uv::Pipe::Create(loop);
@@ -223,7 +224,8 @@ int main(int argc, char* argv[]) {
       }
 
       // close on error
-      tcp->error.connect([s = tcp.get()](wpi::net::uv::Error err) { s->Close(); });
+      tcp->error.connect(
+          [s = tcp.get()](wpi::net::uv::Error err) { s->Close(); });
 
       // tee stdout and stderr
       CopyTcp(*stdoutPipe, tcp);
diff --git a/wpinet/src/netconsoleTee/native/cpp/main.cpp b/wpinet/src/netconsoleTee/native/cpp/main.cpp
index 359d23233d..48680a6b16 100644
--- a/wpinet/src/netconsoleTee/native/cpp/main.cpp
+++ b/wpinet/src/netconsoleTee/native/cpp/main.cpp
@@ -25,8 +25,8 @@ namespace uv = wpi::net::uv;
 static uint64_t startTime = wpi::util::Now();
 
 static bool NewlineBuffer(std::string& rem, uv::Buffer& buf, size_t len,
-                          wpi::util::SmallVectorImpl& bufs, bool tcp,
-                          uint16_t tcpSeq) {
+                          wpi::util::SmallVectorImpl& bufs,
+                          bool tcp, uint16_t tcpSeq) {
   // scan for last newline
   std::string_view str(buf.base, len);
   size_t idx = str.rfind('\n');
@@ -157,7 +157,8 @@ int main(int argc, char* argv[]) {
         port = portValue.value();
       }
     } else {
-      wpi::util::print(stderr, "unrecognized command line option {}\n", argv[arg]);
+      wpi::util::print(stderr, "unrecognized command line option {}\n",
+                       argv[arg]);
       err = true;
     }
     ++arg;
@@ -175,8 +176,9 @@ int main(int argc, char* argv[]) {
   }
 
   auto loop = uv::Loop::Create();
-  loop->error.connect(
-      [](uv::Error err) { wpi::util::print(stderr, "uv ERROR: {}\n", err.str()); });
+  loop->error.connect([](uv::Error err) {
+    wpi::util::print(stderr, "uv ERROR: {}\n", err.str());
+  });
 
   // create ttys
   auto stdinTty = uv::Tty::Create(loop, 0, true);
@@ -213,7 +215,8 @@ int main(int argc, char* argv[]) {
       }
 
       // close on error
-      tcp->error.connect([s = tcp.get()](wpi::net::uv::Error err) { s->Close(); });
+      tcp->error.connect(
+          [s = tcp.get()](wpi::net::uv::Error err) { s->Close(); });
 
       // tee
       CopyTcp(*stdinTty, tcp);
diff --git a/wpinet/src/test/native/cpp/MulticastTest.cpp b/wpinet/src/test/native/cpp/MulticastTest.cpp
index 96935200d9..06724f0790 100644
--- a/wpinet/src/test/native/cpp/MulticastTest.cpp
+++ b/wpinet/src/test/native/cpp/MulticastTest.cpp
@@ -39,7 +39,8 @@ TEST(MulticastServiceAnnouncerTest, SingleText) {
   const int port = std::rand();
   std::array, 1> txt = {
       std::pair{"hello", "world"}};
-  wpi::net::MulticastServiceAnnouncer announcer(serviceName, serviceType, port, txt);
+  wpi::net::MulticastServiceAnnouncer announcer(serviceName, serviceType, port,
+                                                txt);
   wpi::net::MulticastServiceResolver resolver(serviceType);
 
   if (announcer.HasImplementation() && resolver.HasImplementation()) {
diff --git a/wpinet/src/test/native/cpp/WebSocketClientTest.cpp b/wpinet/src/test/native/cpp/WebSocketClientTest.cpp
index 8fec345806..d47472ccc0 100644
--- a/wpinet/src/test/native/cpp/WebSocketClientTest.cpp
+++ b/wpinet/src/test/native/cpp/WebSocketClientTest.cpp
@@ -47,7 +47,8 @@ class WebSocketClientTest : public WebSocketTest {
       wpi::util::SmallString<64> hashBuf;
       wpi::util::SmallString<64> acceptBuf;
       os << "Sec-WebSocket-Accept: "
-         << wpi::util::Base64Encode(hash.RawFinal(hashBuf), acceptBuf) << "\r\n";
+         << wpi::util::Base64Encode(hash.RawFinal(hashBuf), acceptBuf)
+         << "\r\n";
 
       if (!mockProtocol.empty()) {
         os << "Sec-WebSocket-Protocol: " << mockProtocol << "\r\n";
diff --git a/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp b/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp
index b956a6a6e8..5c38177a4f 100644
--- a/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp
+++ b/wpinet/src/test/native/cpp/WebSocketSerializerTest.cpp
@@ -113,8 +113,9 @@ TEST_F(WebSocketWriteReqTest, ContinueTryWriteNoProgress) {
   EXPECT_CALL(stream, TryWrite(_)).WillOnce(Return(0));
   // Write should get called for all of next frame - make forward progress
   uv::Buffer remBufs[2] = {uv::Buffer{m_buf0}, uv::Buffer{m_buf1}};
-  EXPECT_CALL(stream,
-              DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
+  EXPECT_CALL(
+      stream,
+      DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
   ASSERT_EQ(req->Continue(stream, req), 1);
 }
 
@@ -129,8 +130,9 @@ TEST_F(WebSocketWriteReqTest, ContinueTryWritePartialMidFrameMidBuf1) {
   EXPECT_CALL(stream, TryWrite(_)).WillOnce(Return(2));
   // Write should get called for remainder of buf 0 and all of buf 1
   uv::Buffer remBufs[2] = {uv::Buffer{&m_buf0[2], 1}, uv::Buffer{m_buf1}};
-  EXPECT_CALL(stream,
-              DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
+  EXPECT_CALL(
+      stream,
+      DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
   ASSERT_EQ(req->Continue(stream, req), 1);
 }
 
@@ -139,8 +141,9 @@ TEST_F(WebSocketWriteReqTest, ContinueTryWritePartialMidFrameBufBoundary) {
   EXPECT_CALL(stream, TryWrite(_)).WillOnce(Return(3));
   // Write should get called for all of buf 1
   uv::Buffer remBufs[1] = {uv::Buffer{m_buf1}};
-  EXPECT_CALL(stream,
-              DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
+  EXPECT_CALL(
+      stream,
+      DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
   ASSERT_EQ(req->Continue(stream, req), 1);
 }
 
@@ -149,8 +152,9 @@ TEST_F(WebSocketWriteReqTest, ContinueTryWritePartialMidFrameMidBuf2) {
   EXPECT_CALL(stream, TryWrite(_)).WillOnce(Return(4));
   // Write should get called for remainder of buf 1
   uv::Buffer remBufs[1] = {uv::Buffer{&m_buf1[1], 1}};
-  EXPECT_CALL(stream,
-              DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
+  EXPECT_CALL(
+      stream,
+      DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
   ASSERT_EQ(req->Continue(stream, req), 1);
 }
 
@@ -159,8 +163,9 @@ TEST_F(WebSocketWriteReqTest, ContinueTryWritePartialFrameBoundary) {
   EXPECT_CALL(stream, TryWrite(_)).WillOnce(Return(5));
   // Write should get called for all of next frame
   uv::Buffer remBufs[1] = {uv::Buffer{m_buf2}};
-  EXPECT_CALL(stream,
-              DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
+  EXPECT_CALL(
+      stream,
+      DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
   ASSERT_EQ(req->Continue(stream, req), 1);
 }
 
@@ -169,8 +174,9 @@ TEST_F(WebSocketWriteReqTest, ContinueTryWritePartialMidFrameMidBuf3) {
   EXPECT_CALL(stream, TryWrite(_)).WillOnce(Return(6));
   // Write should get called for remainder of buf 2
   uv::Buffer remBufs[1] = {uv::Buffer{&m_buf2[1], 3}};
-  EXPECT_CALL(stream,
-              DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
+  EXPECT_CALL(
+      stream,
+      DoWrite(wpi::util::SpanEq(std::span(remBufs)), _));
   ASSERT_EQ(req->Continue(stream, req), 1);
 }
 
@@ -242,8 +248,8 @@ void WebSocketTrySendTest::CheckTrySendFrames(
           },
           [&](auto bufs, auto err) {
             ++callbackCalled;
-            ASSERT_THAT(bufs,
-                        wpi::util::SpanEq(std::span(expectCbBufs)));
+            ASSERT_THAT(bufs, wpi::util::SpanEq(
+                                  std::span(expectCbBufs)));
             ASSERT_EQ(err.code(), expectErr);
           }),
       wpi::util::SpanEq(expectRet));
diff --git a/wpinet/src/test/native/cpp/WebSocketTest.cpp b/wpinet/src/test/native/cpp/WebSocketTest.cpp
index 38e5976eb2..71a709174a 100644
--- a/wpinet/src/test/native/cpp/WebSocketTest.cpp
+++ b/wpinet/src/test/native/cpp/WebSocketTest.cpp
@@ -186,7 +186,8 @@ TEST_F(WebSocketTest, CreateClientExtraHeaders) {
   });
   clientPipe->Connect(pipeName, [&]() {
     WebSocket::ClientOptions options;
-    wpi::util::SmallVector, 4> extraHeaders;
+    wpi::util::SmallVector, 4>
+        extraHeaders;
     extraHeaders.emplace_back("Extra1", "Data1");
     extraHeaders.emplace_back("Extra2", "Data2");
     options.extraHeaders = extraHeaders;
diff --git a/wpiutil/src/main/native/cpp/Synchronization.cpp b/wpiutil/src/main/native/cpp/Synchronization.cpp
index e301fcbd91..b8bc929a30 100644
--- a/wpiutil/src/main/native/cpp/Synchronization.cpp
+++ b/wpiutil/src/main/native/cpp/Synchronization.cpp
@@ -147,7 +147,8 @@ void wpi::util::ResetEvent(WPI_EventHandle handle) {
   ResetSignalObject(handle);
 }
 
-WPI_SemaphoreHandle wpi::util::CreateSemaphore(int initialCount, int maximumCount) {
+WPI_SemaphoreHandle wpi::util::CreateSemaphore(int initialCount,
+                                               int maximumCount) {
   ManagerGuard guard;
   if (!guard) {
     return {};
@@ -183,7 +184,7 @@ void wpi::util::DestroySemaphore(WPI_SemaphoreHandle handle) {
 }
 
 bool wpi::util::ReleaseSemaphore(WPI_SemaphoreHandle handle, int releaseCount,
-                           int* prevCount) {
+                                 int* prevCount) {
   if ((handle >> 24) != kHandleTypeSemaphore) {
     return false;
   }
@@ -221,7 +222,8 @@ bool wpi::util::WaitForObject(WPI_Handle handle) {
   return WaitForObject(handle, -1, nullptr);
 }
 
-bool wpi::util::WaitForObject(WPI_Handle handle, double timeout, bool* timedOut) {
+bool wpi::util::WaitForObject(WPI_Handle handle, double timeout,
+                              bool* timedOut) {
   WPI_Handle signaledValue;
   auto signaled = WaitForObjects(
       std::span(&handle, 1), std::span(&signaledValue, 1), timeout, timedOut);
@@ -231,14 +233,14 @@ bool wpi::util::WaitForObject(WPI_Handle handle, double timeout, bool* timedOut)
   return (signaled[0] & 0x80000000ul) == 0;
 }
 
-std::span wpi::util::WaitForObjects(std::span handles,
-                                          std::span signaled) {
+std::span wpi::util::WaitForObjects(
+    std::span handles, std::span signaled) {
   return WaitForObjects(handles, signaled, -1, nullptr);
 }
 
-std::span wpi::util::WaitForObjects(std::span handles,
-                                          std::span signaled,
-                                          double timeout, bool* timedOut) {
+std::span wpi::util::WaitForObjects(
+    std::span handles, std::span signaled,
+    double timeout, bool* timedOut) {
   ManagerGuard guard;
   if (!guard) {
     if (timedOut) {
@@ -337,7 +339,7 @@ std::span wpi::util::WaitForObjects(std::span hand
 }
 
 void wpi::util::CreateSignalObject(WPI_Handle handle, bool manualReset,
-                             bool initialState) {
+                                   bool initialState) {
   ManagerGuard guard;
   if (!guard) {
     return;
@@ -448,7 +450,7 @@ int WPI_WaitForObjectTimeout(WPI_Handle handle, double timeout,
 int WPI_WaitForObjects(const WPI_Handle* handles, int handles_count,
                        WPI_Handle* signaled) {
   return wpi::util::WaitForObjects(std::span(handles, handles_count),
-                             std::span(signaled, handles_count))
+                                   std::span(signaled, handles_count))
       .size();
 }
 
@@ -456,9 +458,9 @@ int WPI_WaitForObjectsTimeout(const WPI_Handle* handles, int handles_count,
                               WPI_Handle* signaled, double timeout,
                               int* timed_out) {
   bool timedOutBool;
-  auto signaledResult = wpi::util::WaitForObjects(std::span(handles, handles_count),
-                                            std::span(signaled, handles_count),
-                                            timeout, &timedOutBool);
+  auto signaledResult = wpi::util::WaitForObjects(
+      std::span(handles, handles_count), std::span(signaled, handles_count),
+      timeout, &timedOutBool);
   *timed_out = timedOutBool ? 1 : 0;
   return signaledResult.size();
 }
diff --git a/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp b/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp
index 84eae8b6bf..cdd4c741c1 100644
--- a/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp
+++ b/wpiutil/src/main/native/cpp/jni/WPIUtilJNI.cpp
@@ -34,7 +34,8 @@ static const JExceptionInit exceptions[] = {
     {"java/lang/NullPointerException", &nullPointerEx},
     {"org/wpilib/util/runtime/MsvcRuntimeException", &msvcRuntimeEx}};
 
-void wpi::util::ThrowIllegalArgumentException(JNIEnv* env, std::string_view msg) {
+void wpi::util::ThrowIllegalArgumentException(JNIEnv* env,
+                                              std::string_view msg) {
   illegalArgEx.Throw(env, msg);
 }
 
@@ -98,7 +99,8 @@ Java_org_wpilib_util_WPIUtilJNI_checkMsvcRuntime
                           &expectedMinor, &runtimePath)) {
     static jmethodID ctor =
         env->GetMethodID(msvcRuntimeEx, "", "(IIIILjava/lang/String;)V");
-    jstring jmsvcruntime = MakeJString(env, wpi::util::to_string_view(&runtimePath));
+    jstring jmsvcruntime =
+        MakeJString(env, wpi::util::to_string_view(&runtimePath));
     jobject exception =
         env->NewObject(msvcRuntimeEx, ctor, foundMajor, foundMinor,
                        expectedMajor, expectedMinor, jmsvcruntime);
@@ -129,7 +131,8 @@ Java_org_wpilib_util_WPIUtilJNI_enableMockTime
   (JNIEnv*, jclass)
 {
 #ifdef __FRC_SYSTEMCORE__
-  wpi::util::print(stderr, "WPIUtil: Mocking time is not available on systemcore\n");
+  wpi::util::print(stderr,
+                   "WPIUtil: Mocking time is not available on systemcore\n");
 #else
   mockTimeEnabled = true;
   wpi::util::SetNowImpl([] { return mockNow; });
diff --git a/wpiutil/src/main/native/include/wpi/util/RawFrame.h b/wpiutil/src/main/native/include/wpi/util/RawFrame.h
index 2b7829fbb6..d4dafa51d8 100644
--- a/wpiutil/src/main/native/include/wpi/util/RawFrame.h
+++ b/wpiutil/src/main/native/include/wpi/util/RawFrame.h
@@ -65,8 +65,8 @@ enum WPI_PixelFormat {
  */
 enum WPI_TimestampSource {
   WPI_TIMESRC_UNKNOWN = 0,    // unknown
-  WPI_TIMESRC_FRAME_DEQUEUE,  // wpi::util::Now when the new frame was dequeued by
-                              // CSCore. Does not account for camera exposure
+  WPI_TIMESRC_FRAME_DEQUEUE,  // wpi::util::Now when the new frame was dequeued
+                              // by CSCore. Does not account for camera exposure
                               // time or V4L latency.
   WPI_TIMESRC_V4L_EOF,  // End of Frame. Same as V4L2_BUF_FLAG_TSTAMP_SRC_EOF,
                         // translated into wpi::util::Now's timebase.
diff --git a/wpiutil/src/main/native/include/wpi/util/array.hpp b/wpiutil/src/main/native/include/wpi/util/array.hpp
index e2f8292c87..599801da0b 100644
--- a/wpiutil/src/main/native/include/wpi/util/array.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/array.hpp
@@ -89,7 +89,8 @@ constexpr const T&& get(const wpi::util::array&& arr) noexcept {
 namespace std {  // NOLINT
 // Partial specialization for wpi::util::array
 template 
-struct tuple_size> : public integral_constant {};
+struct tuple_size>
+    : public integral_constant {};
 
 // Partial specialization for wpi::util::array
 template 
diff --git a/wpiutil/src/main/native/include/wpi/util/jni_util.hpp b/wpiutil/src/main/native/include/wpi/util/jni_util.hpp
index 4b6b1aedd7..eb5c1da6ac 100644
--- a/wpiutil/src/main/native/include/wpi/util/jni_util.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/jni_util.hpp
@@ -161,7 +161,7 @@ class JStringRef {
       }
     } else {
       wpi::util::print(stderr, "JStringRef was passed a null pointer at\n",
-                 GetJavaStackTrace(env));
+                       GetJavaStackTrace(env));
     }
     // Ensure str is null-terminated.
     m_str.push_back('\0');
@@ -285,7 +285,7 @@ class JSpanBase {
             bb ? env->GetDirectBufferAddress(bb) : nullptr)} {
     if (!bb) {
       wpi::util::print(stderr, "JSpan was passed a null pointer at\n",
-                 GetJavaStackTrace(env));
+                       GetJavaStackTrace(env));
     }
   }
 
@@ -304,7 +304,7 @@ class JSpanBase {
       }
     } else {
       wpi::util::print(stderr, "JSpan was passed a null pointer at\n",
-                 GetJavaStackTrace(env));
+                       GetJavaStackTrace(env));
     }
   }
 
diff --git a/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp b/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp
index d8eecb13d4..f864247b07 100644
--- a/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/protobuf/Protobuf.hpp
@@ -232,9 +232,9 @@ class ProtoOutputStream {
  * values into a nanopb Stream and deserialization consists of
  * reading values from nanopb Stream.
  *
- * Implementations must define a template specialization for wpi::util::Protobuf with
- * T being the type that is being serialized/deserialized, with the following
- * static members (as enforced by this concept):
+ * Implementations must define a template specialization for wpi::util::Protobuf
+ * with T being the type that is being serialized/deserialized, with the
+ * following static members (as enforced by this concept):
  * - using MessageStruct = nanopb_message_struct_here: typedef to the wpilib
  *   modified nanopb message struct
  * - std::optional Unpack(wpi::util::ProtoInputStream&): function
@@ -250,7 +250,8 @@ class ProtoOutputStream {
 template 
 concept ProtobufSerializable = requires(
     wpi::util::ProtoOutputStream>& ostream,
-    wpi::util::ProtoInputStream>& istream, const T& value) {
+    wpi::util::ProtoInputStream>& istream,
+    const T& value) {
   typename Protobuf>;
   {
     Protobuf>::Unpack(istream)
@@ -275,8 +276,8 @@ concept ProtobufSerializable = requires(
  *
  * In addition to meeting ProtobufSerializable, implementations must define a
  * wpi::util::Protobuf static member -
- * `bool UnpackInto(T*, wpi::util::ProtoInputStream&)` to update the pointed-to T
- * with the contents of the message.
+ * `bool UnpackInto(T*, wpi::util::ProtoInputStream&)` to update the
+ * pointed-to T with the contents of the message.
  */
 template 
 concept MutableProtobufSerializable =
diff --git a/wpiutil/src/main/native/include/wpi/util/protobuf/ProtobufCallbacks.hpp b/wpiutil/src/main/native/include/wpi/util/protobuf/ProtobufCallbacks.hpp
index 1881c8babf..d700c567d9 100644
--- a/wpiutil/src/main/native/include/wpi/util/protobuf/ProtobufCallbacks.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/protobuf/ProtobufCallbacks.hpp
@@ -338,7 +338,8 @@ class UnpackCallback
    * Constructs an UnpackCallback.
    */
   UnpackCallback()
-      : DirectUnpackCallback, N>{m_storedBuffer} {
+      : DirectUnpackCallback, N>{
+            m_storedBuffer} {
     this->SetLimits(DecodeLimits::Ignore);
   }
 
diff --git a/wpiutil/src/main/native/include/wpi/util/sendable/SendableBuilder.hpp b/wpiutil/src/main/native/include/wpi/util/sendable/SendableBuilder.hpp
index 7da25f5102..4091e2e784 100644
--- a/wpiutil/src/main/native/include/wpi/util/sendable/SendableBuilder.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/sendable/SendableBuilder.hpp
@@ -277,7 +277,8 @@ class SendableBuilder {
    */
   virtual void AddSmallStringProperty(
       std::string_view key,
-      std::function& buf)> getter,
+      std::function& buf)>
+          getter,
       std::function setter) = 0;
 
   /**
@@ -316,7 +317,8 @@ class SendableBuilder {
    */
   virtual void AddSmallFloatArrayProperty(
       std::string_view key,
-      std::function(wpi::util::SmallVectorImpl& buf)>
+      std::function<
+          std::span(wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) = 0;
 
@@ -329,7 +331,8 @@ class SendableBuilder {
    */
   virtual void AddSmallDoubleArrayProperty(
       std::string_view key,
-      std::function(wpi::util::SmallVectorImpl& buf)>
+      std::function<
+          std::span(wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) = 0;
 
@@ -342,8 +345,8 @@ class SendableBuilder {
    */
   virtual void AddSmallStringArrayProperty(
       std::string_view key,
-      std::function<
-          std::span(wpi::util::SmallVectorImpl& buf)>
+      std::function(
+          wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) = 0;
 
@@ -357,7 +360,8 @@ class SendableBuilder {
    */
   virtual void AddSmallRawProperty(
       std::string_view key, std::string_view typeString,
-      std::function(wpi::util::SmallVectorImpl& buf)>
+      std::function<
+          std::span(wpi::util::SmallVectorImpl& buf)>
           getter,
       std::function)> setter) = 0;
 
diff --git a/wpiutil/src/main/native/include/wpi/util/static_circular_buffer.hpp b/wpiutil/src/main/native/include/wpi/util/static_circular_buffer.hpp
index a342cf798e..b96b6d3dd5 100644
--- a/wpiutil/src/main/native/include/wpi/util/static_circular_buffer.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/static_circular_buffer.hpp
@@ -120,7 +120,8 @@ class static_circular_buffer {
    * Returns const end iterator.
    */
   constexpr const_iterator end() const {
-    return const_iterator(this, ::wpi::util::static_circular_buffer::size());
+    return const_iterator(this,
+                          ::wpi::util::static_circular_buffer::size());
   }
 
   /**
@@ -132,7 +133,8 @@ class static_circular_buffer {
    * Returns const end iterator.
    */
   constexpr const_iterator cend() const {
-    return const_iterator(this, ::wpi::util::static_circular_buffer::size());
+    return const_iterator(this,
+                          ::wpi::util::static_circular_buffer::size());
   }
 
   /**
diff --git a/wpiutil/src/main/native/include/wpi/util/struct/Struct.hpp b/wpiutil/src/main/native/include/wpi/util/struct/Struct.hpp
index 4adfdafa4d..ea3ab28950 100644
--- a/wpiutil/src/main/native/include/wpi/util/struct/Struct.hpp
+++ b/wpiutil/src/main/native/include/wpi/util/struct/Struct.hpp
@@ -47,9 +47,9 @@ struct Struct {};
  * values into a mutable std::span and deserialization consists of reading
  * values from an immutable std::span.
  *
- * Implementations must define a template specialization for wpi::util::Struct with
- * T being the type that is being serialized/deserialized, with the following
- * static members (as enforced by this concept):
+ * Implementations must define a template specialization for wpi::util::Struct
+ * with T being the type that is being serialized/deserialized, with the
+ * following static members (as enforced by this concept):
  * - std::string_view GetTypeName(): function that returns the type name
  * - size_t GetSize(): function that returns the structure size in bytes
  * - std::string_view GetSchema(): function that returns the struct schema
@@ -96,8 +96,8 @@ concept StructSerializable = requires(std::span in,
  * Specifies that a type is capable of in-place raw struct deserialization.
  *
  * In addition to meeting StructSerializable, implementations must define a
- * wpi::util::Struct static member `void UnpackInto(T*, std::span)`
- * to update the pointed-to T with the contents of the span.
+ * wpi::util::Struct static member `void UnpackInto(T*, std::span)` to update the pointed-to T with the contents of the span.
  */
 template 
 concept MutableStructSerializable =
diff --git a/wpiutil/src/test/native/cpp/ArrayTest.cpp b/wpiutil/src/test/native/cpp/ArrayTest.cpp
index cf501b56e9..6568b30df8 100644
--- a/wpiutil/src/test/native/cpp/ArrayTest.cpp
+++ b/wpiutil/src/test/native/cpp/ArrayTest.cpp
@@ -26,10 +26,11 @@ TEST(ArrayTest, CopyableTypeCompiles) {
 
 TEST(ArrayTest, MoveOnlyTypeCompiles) {
   [[maybe_unused]]
-  constexpr wpi::util::array arr1{MoveOnlyType{}, MoveOnlyType{},
-                                             MoveOnlyType{}};
+  constexpr wpi::util::array arr1{
+      MoveOnlyType{}, MoveOnlyType{}, MoveOnlyType{}};
 
   // Test deduction guide
   [[maybe_unused]]
-  constexpr wpi::util::array arr2{MoveOnlyType{}, MoveOnlyType{}, MoveOnlyType{}};
+  constexpr wpi::util::array arr2{MoveOnlyType{}, MoveOnlyType{},
+                                  MoveOnlyType{}};
 }
diff --git a/wpiutil/src/test/native/cpp/SynchronizationTest.cpp b/wpiutil/src/test/native/cpp/SynchronizationTest.cpp
index 88b5d55184..e9e13731b5 100644
--- a/wpiutil/src/test/native/cpp/SynchronizationTest.cpp
+++ b/wpiutil/src/test/native/cpp/SynchronizationTest.cpp
@@ -50,7 +50,8 @@ TEST(EventTest, WaitMultiple) {
   ASSERT_EQ(result1.size(), 1u);
   ASSERT_EQ(result1[0], event2);
   bool timedOut;
-  auto result2 = wpi::util::WaitForObjects({event1, event2}, signaled, 0, &timedOut);
+  auto result2 =
+      wpi::util::WaitForObjects({event1, event2}, signaled, 0, &timedOut);
   ASSERT_EQ(timedOut, true);
   ASSERT_EQ(result2.size(), 0u);
 }
diff --git a/wpiutil/src/test/native/cpp/ct_string_test.cpp b/wpiutil/src/test/native/cpp/ct_string_test.cpp
index 4152752aac..efbe5656f1 100644
--- a/wpiutil/src/test/native/cpp/ct_string_test.cpp
+++ b/wpiutil/src/test/native/cpp/ct_string_test.cpp
@@ -14,7 +14,8 @@ TEST(CtStringTest, Concat) {
   constexpr std::string_view astring = "name";
   constexpr int arrsize = 5;
   constexpr auto str = Concat(
-      wpi::util::ct_string, astring.size()>{astring},
+      wpi::util::ct_string, astring.size()>{
+          astring},
       "["_ct_string, wpi::util::NumToCtString(), "]"_ct_string);
   static_assert(str.size() == 7);
   ASSERT_EQ(std::string{str}, "name[5]");
@@ -24,7 +25,8 @@ TEST(CtStringTest, OperatorPlus) {
   using namespace wpi::util::literals;
   constexpr std::string_view astring = "name";
   constexpr auto str =
-      wpi::util::ct_string, astring.size()>{astring} +
+      wpi::util::ct_string, astring.size()>{
+          astring} +
       "[]"_ct_string;
   static_assert(str.size() == 6);
   ASSERT_EQ(std::string{str}, "name[]");
diff --git a/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp b/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp
index 8e39891c26..b5d936d332 100644
--- a/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp
+++ b/wpiutil/src/test/native/cpp/expected/ExpectedTest.cpp
@@ -48,7 +48,8 @@ TEST(ExpectedTest, Emplace) {
   }
 
   {
-    wpi::util::expected e = wpi::util::make_unexpected(0);
+    wpi::util::expected e =
+        wpi::util::make_unexpected(0);
     e.emplace({0, 1}, 2, 3);
     EXPECT_TRUE(e);
     EXPECT_EQ(e->v[0], 0);
diff --git a/wpiutil/src/test/native/cpp/proto/TestProto.cpp b/wpiutil/src/test/native/cpp/proto/TestProto.cpp
index 0aea3c4eb0..9cfeedd887 100644
--- a/wpiutil/src/test/native/cpp/proto/TestProto.cpp
+++ b/wpiutil/src/test/native/cpp/proto/TestProto.cpp
@@ -40,7 +40,8 @@ struct wpi::util::Protobuf {
   static bool Pack(OutputStream& stream, const TestProto& value);
 };
 
-std::optional wpi::util::Protobuf::Unpack(InputStream& stream) {
+std::optional wpi::util::Protobuf::Unpack(
+    InputStream& stream) {
   wpi::util::UnpackCallback str;
   wpi::util::UnpackCallback> bytes;
   wpi::util::UnpackCallback inner;
@@ -81,7 +82,7 @@ std::optional wpi::util::Protobuf::Unpack(InputStream& str
 }
 
 bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                    const TestProto& value) {
+                                          const TestProto& value) {
   wpi::util::PackCallback str{&value.string_msg};
   wpi::util::PackCallback bytes{&value.bytes_msg};
   wpi::util::PackCallback inner{&value.TestProtoInner_msg};
diff --git a/wpiutil/src/test/native/cpp/proto/TestProtoRepeated.cpp b/wpiutil/src/test/native/cpp/proto/TestProtoRepeated.cpp
index 4f5d988598..28fdaa9193 100644
--- a/wpiutil/src/test/native/cpp/proto/TestProtoRepeated.cpp
+++ b/wpiutil/src/test/native/cpp/proto/TestProtoRepeated.cpp
@@ -68,12 +68,12 @@ std::optional wpi::util::Protobuf::Unpack(
       toRet.sfixed32_msg};
   wpi::util::DirectUnpackCallback> sfixed64_msg{
       toRet.sfixed64_msg};
-  wpi::util::DirectUnpackCallback> bool_msg{
-      toRet.bool_msg};
-  wpi::util::DirectUnpackCallback> string_msg{
-      toRet.string_msg};
+  wpi::util::DirectUnpackCallback>
+      bool_msg{toRet.bool_msg};
+  wpi::util::DirectUnpackCallback>
+      string_msg{toRet.string_msg};
   wpi::util::DirectUnpackCallback,
-                            std::vector>>
+                                  std::vector>>
       bytes_msg{toRet.bytes_msg};
   wpi::util::DirectUnpackCallback>
       TestProtoInner_msg{toRet.TestProtoInner_msg};
@@ -104,8 +104,8 @@ std::optional wpi::util::Protobuf::Unpack(
   return toRet;
 }
 
-bool wpi::util::Protobuf::Pack(OutputStream& stream,
-                                            const RepeatedTestProto& value) {
+bool wpi::util::Protobuf::Pack(
+    OutputStream& stream, const RepeatedTestProto& value) {
   wpi::util::PackCallback double_msg{value.double_msg};
   wpi::util::PackCallback float_msg{value.float_msg};
   wpi::util::PackCallback int32_msg{value.int32_msg};
diff --git a/wpiutil/src/test/native/cpp/rotated_span_test.cpp b/wpiutil/src/test/native/cpp/rotated_span_test.cpp
index 9dc0d7ca66..330715c801 100644
--- a/wpiutil/src/test/native/cpp/rotated_span_test.cpp
+++ b/wpiutil/src/test/native/cpp/rotated_span_test.cpp
@@ -54,11 +54,13 @@ TEST(CircularSpanTest, ConstructConst) {
     EXPECT_EQ(sp[5], arr_values[5]);
   }
   {
-    wpi::util::rotated_span sp{cvec_values.begin(), cvec_values.end()};
+    wpi::util::rotated_span sp{cvec_values.begin(),
+                                          cvec_values.end()};
     EXPECT_EQ(sp[5], vec_values[5]);
   }
   {
-    wpi::util::rotated_span sp{cvec_values.data(), cvec_values.size()};
+    wpi::util::rotated_span sp{cvec_values.data(),
+                                          cvec_values.size()};
     EXPECT_EQ(sp[5], vec_values[5]);
   }
 }
diff --git a/wpiutil/src/test/native/cpp/spinlock_bench.cpp b/wpiutil/src/test/native/cpp/spinlock_bench.cpp
index 928c83a784..25630ab492 100644
--- a/wpiutil/src/test/native/cpp/spinlock_bench.cpp
+++ b/wpiutil/src/test/native/cpp/spinlock_bench.cpp
@@ -52,8 +52,9 @@ TEST(SpinlockTest, Benchmark) {
       ++value;
     }
     auto stop = high_resolution_clock::now();
-    wpi::util::print("std::mutex sizeof: {} time: {} value: {}\n", sizeof(std_mutex),
-               duration_cast(stop - start).count(), value);
+    wpi::util::print("std::mutex sizeof: {} time: {} value: {}\n",
+                     sizeof(std_mutex),
+                     duration_cast(stop - start).count(), value);
   });
   thrb.join();
 
@@ -67,8 +68,8 @@ TEST(SpinlockTest, Benchmark) {
     }
     auto stop = high_resolution_clock::now();
     wpi::util::print("std::recursive_mutex sizeof: {} time: {} value: {}\n",
-               sizeof(std_recursive_mutex),
-               duration_cast(stop - start).count(), value);
+                     sizeof(std_recursive_mutex),
+                     duration_cast(stop - start).count(), value);
   });
   thrb2.join();
 
@@ -81,8 +82,9 @@ TEST(SpinlockTest, Benchmark) {
       ++value;
     }
     auto stop = high_resolution_clock::now();
-    wpi::util::print("wpi::util::mutex sizeof: {} time: {} value: {}\n", sizeof(wpi_mutex),
-               duration_cast(stop - start).count(), value);
+    wpi::util::print("wpi::util::mutex sizeof: {} time: {} value: {}\n",
+                     sizeof(wpi_mutex),
+                     duration_cast(stop - start).count(), value);
   });
   thr2.join();
 
@@ -95,9 +97,10 @@ TEST(SpinlockTest, Benchmark) {
       ++value;
     }
     auto stop = high_resolution_clock::now();
-    wpi::util::print("wpi::util::recursive_mutex sizeof: {} time: {} value: {}\n",
-               sizeof(wpi_recursive_mutex),
-               duration_cast(stop - start).count(), value);
+    wpi::util::print(
+        "wpi::util::recursive_mutex sizeof: {} time: {} value: {}\n",
+        sizeof(wpi_recursive_mutex),
+        duration_cast(stop - start).count(), value);
   });
   thr2b.join();
 
@@ -110,8 +113,9 @@ TEST(SpinlockTest, Benchmark) {
       ++value;
     }
     auto stop = high_resolution_clock::now();
-    wpi::util::print("spinlock sizeof: {} time: {} value: {}\n", sizeof(spinlock),
-               duration_cast(stop - start).count(), value);
+    wpi::util::print("spinlock sizeof: {} time: {} value: {}\n",
+                     sizeof(spinlock),
+                     duration_cast(stop - start).count(), value);
   });
   thr3.join();
 
@@ -125,8 +129,8 @@ TEST(SpinlockTest, Benchmark) {
     }
     auto stop = high_resolution_clock::now();
     wpi::util::print("recursive_spinlock1 sizeof: {} time: {} value: {}\n",
-               sizeof(recursive_spinlock1),
-               duration_cast(stop - start).count(), value);
+                     sizeof(recursive_spinlock1),
+                     duration_cast(stop - start).count(), value);
   });
   thr4.join();
 
@@ -140,8 +144,8 @@ TEST(SpinlockTest, Benchmark) {
     }
     auto stop = high_resolution_clock::now();
     wpi::util::print("recursive_spinlock2 sizeof: {} time: {} value: {}\n",
-               sizeof(recursive_spinlock2),
-               duration_cast(stop - start).count(), value);
+                     sizeof(recursive_spinlock2),
+                     duration_cast(stop - start).count(), value);
   });
   thr4b.join();
 
@@ -155,8 +159,8 @@ TEST(SpinlockTest, Benchmark) {
     }
     auto stop = high_resolution_clock::now();
     wpi::util::print("recursive_spinlock sizeof: {} time: {} value: {}\n",
-               sizeof(recursive_spinlock),
-               duration_cast(stop - start).count(), value);
+                     sizeof(recursive_spinlock),
+                     duration_cast(stop - start).count(), value);
   });
   thr4c.join();
 }
diff --git a/xrpVendordep/src/main/native/cpp/xrp/XRPMotor.cpp b/xrpVendordep/src/main/native/cpp/xrp/XRPMotor.cpp
index 8a077d2820..8375bbb522 100644
--- a/xrpVendordep/src/main/native/cpp/xrp/XRPMotor.cpp
+++ b/xrpVendordep/src/main/native/cpp/xrp/XRPMotor.cpp
@@ -20,12 +20,12 @@ std::set XRPMotor::s_registeredDevices = {};
 void XRPMotor::CheckDeviceAllocation(int deviceNum) {
   if (s_simDeviceMap.count(deviceNum) == 0) {
     throw WPILIB_MakeError(wpi::err::ChannelIndexOutOfRange, "Channel {}",
-                        deviceNum);
+                           deviceNum);
   }
 
   if (s_registeredDevices.count(deviceNum) > 0) {
     throw WPILIB_MakeError(wpi::err::ResourceAlreadyAllocated, "Channel {}",
-                        deviceNum);
+                           deviceNum);
   }
 
   s_registeredDevices.insert(deviceNum);
diff --git a/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp b/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp
index f22354ea32..0e4dd39233 100644
--- a/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp
+++ b/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp
@@ -22,12 +22,12 @@ std::set XRPServo::s_registeredDevices = {};
 void XRPServo::CheckDeviceAllocation(int deviceNum) {
   if (s_simDeviceMap.count(deviceNum) == 0) {
     throw WPILIB_MakeError(wpi::err::ChannelIndexOutOfRange, "Channel {}",
-                        deviceNum);
+                           deviceNum);
   }
 
   if (s_registeredDevices.count(deviceNum) > 0) {
     throw WPILIB_MakeError(wpi::err::ResourceAlreadyAllocated, "Channel {}",
-                        deviceNum);
+                           deviceNum);
   }
 
   s_registeredDevices.insert(deviceNum);