[wpiutil] Split units.h into separate headers for each unit (#2551)

Closes #2508.

Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com>
This commit is contained in:
Tyler Veness
2020-06-29 22:25:09 -07:00
committed by GitHub
parent c6e6346642
commit d30d1088da
169 changed files with 6851 additions and 5061 deletions

View File

@@ -11,7 +11,7 @@
#include <hal/AddressableLEDTypes.h>
#include <hal/Types.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include "frc/ErrorBase.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,7 +11,7 @@
#include <hal/SimDevice.h>
#include <hal/Types.h>
#include <units/units.h>
#include <units/angle.h>
#include "frc/AnalogTrigger.h"
#include "frc/Counter.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,7 +11,7 @@
#include <hal/AnalogInput.h>
#include <hal/DMA.h>
#include <units/units.h>
#include <units/time.h>
#include "frc/AnalogInput.h"
#include "frc/Counter.h"

View File

@@ -11,7 +11,7 @@
#include <hal/SimDevice.h>
#include <hal/Types.h>
#include <units/units.h>
#include <units/angle.h>
#include "frc/AnalogTrigger.h"
#include "frc/Counter.h"

View File

@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/time.h>
#include <wpi/deprecated.h>
#include "frc/RobotBase.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2015-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2015-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -13,7 +13,7 @@
#include <vector>
#include <hal/FRCUsageReporting.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include <wpi/circular_buffer.h>

View File

@@ -16,7 +16,7 @@
#include <utility>
#include <hal/Types.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/Twine.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>

View File

@@ -12,7 +12,7 @@
#include <memory>
#include <hal/SPITypes.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include <wpi/deprecated.h>

View File

@@ -11,7 +11,7 @@
#include <algorithm>
#include <units/units.h>
#include <units/time.h>
namespace frc {
/**

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/voltage.h>
#include "frc/PIDOutput.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include <hal/Types.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/deprecated.h>
#include "frc/ErrorBase.h"

View File

@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/time.h>
#include <wpi/deprecated.h>
#include <wpi/mutex.h>

View File

@@ -10,7 +10,6 @@
#include <chrono>
#include <hal/cpp/fpga_clock.h>
#include <units/units.h>
#include <wpi/StringMap.h>
#include <wpi/StringRef.h>

View File

@@ -12,7 +12,7 @@
#include <utility>
#include <hal/cpp/fpga_clock.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/SafeThread.h>
#include <wpi/StringRef.h>
#include <wpi/deprecated.h>

View File

@@ -7,7 +7,10 @@
#pragma once
#include <units/units.h>
#include <units/angle.h>
#include <units/angular_velocity.h>
#include <units/math.h>
#include <units/voltage.h>
#include <wpi/MathExtras.h>
namespace frc {

View File

@@ -10,7 +10,7 @@
#include <cmath>
#include <type_traits>
#include <units/units.h>
#include <units/math.h>
namespace frc {

View File

@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/voltage.h>
#include <wpi/MathExtras.h>
namespace frc {

View File

@@ -10,7 +10,7 @@
#include <functional>
#include <limits>
#include <units/units.h>
#include <units/time.h>
#include "frc/smartdashboard/Sendable.h"
#include "frc/smartdashboard/SendableHelper.h"

View File

@@ -12,7 +12,7 @@
#include <functional>
#include <limits>
#include <units/units.h>
#include <units/time.h>
#include "frc/controller/ControllerUtil.h"
#include "frc/controller/PIDController.h"

View File

@@ -7,7 +7,8 @@
#pragma once
#include <units/units.h>
#include <units/angular_velocity.h>
#include <units/velocity.h>
#include "frc/geometry/Pose2d.h"
#include "frc/kinematics/ChassisSpeeds.h"

View File

@@ -7,7 +7,8 @@
#pragma once
#include <units/units.h>
#include <units/time.h>
#include <units/voltage.h>
#include <wpi/MathExtras.h>
namespace frc {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/angle.h>
namespace wpi {
class json;

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/length.h>
#include "Rotation2d.h"

View File

@@ -1,12 +1,15 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include <units/units.h>
#include <units/angle.h>
#include <units/length.h>
#include <units/math.h>
namespace frc {
/**

View File

@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/angle.h>
#include "frc/geometry/Rotation2d.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,8 @@
#pragma once
#include <units/units.h>
#include <units/angular_velocity.h>
#include <units/velocity.h>
#include "frc/geometry/Rotation2d.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -8,7 +8,8 @@
#pragma once
#include <hal/FRCUsageReporting.h>
#include <units/units.h>
#include <units/angle.h>
#include <units/length.h>
#include "frc/kinematics/ChassisSpeeds.h"
#include "frc/kinematics/DifferentialDriveWheelSpeeds.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/length.h>
#include "DifferentialDriveKinematics.h"
#include "frc/geometry/Pose2d.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/velocity.h>
namespace frc {
/**

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/time.h>
#include "frc/geometry/Pose2d.h"
#include "frc/kinematics/MecanumDriveKinematics.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/velocity.h>
namespace frc {
/**

View File

@@ -13,7 +13,7 @@
#include <Eigen/Core>
#include <Eigen/QR>
#include <hal/FRCUsageReporting.h>
#include <units/units.h>
#include <units/velocity.h>
#include "frc/geometry/Rotation2d.h"
#include "frc/geometry/Translation2d.h"

View File

@@ -9,6 +9,8 @@
#include <algorithm>
#include <units/math.h>
namespace frc {
template <class... Wheels>

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,7 +11,7 @@
#include <cstddef>
#include <ctime>
#include <units/units.h>
#include <units/time.h>
#include "SwerveDriveKinematics.h"
#include "SwerveModuleState.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/velocity.h>
#include "frc/geometry/Rotation2d.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include <hal/SimDevice.h>
#include <units/units.h>
#include <units/length.h>
#include "frc/geometry/Pose2d.h"
#include "frc/geometry/Rotation2d.h"

View File

@@ -12,7 +12,8 @@
#include <vector>
#include <Eigen/Core>
#include <units/units.h>
#include <units/curvature.h>
#include <units/length.h>
#include "frc/geometry/Pose2d.h"

View File

@@ -38,7 +38,10 @@
#include <utility>
#include <vector>
#include <units/units.h>
#include <units/angle.h>
#include <units/curvature.h>
#include <units/length.h>
#include <units/math.h>
#include <wpi/Twine.h>
namespace frc {

View File

@@ -9,7 +9,10 @@
#include <vector>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/curvature.h>
#include <units/time.h>
#include <units/velocity.h>
#include "frc/geometry/Pose2d.h"
#include "frc/geometry/Transform2d.h"

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -11,7 +11,8 @@
#include <utility>
#include <vector>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/velocity.h>
#include "frc/kinematics/DifferentialDriveKinematics.h"
#include "frc/kinematics/MecanumDriveKinematics.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include <hal/FRCUsageReporting.h>
#include <units/units.h>
#include <units/time.h>
namespace frc {

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -9,6 +9,8 @@
#include <algorithm>
#include <units/math.h>
namespace frc {
template <class Distance>
TrapezoidProfile<Distance>::TrapezoidProfile(Constraints constraints,

View File

@@ -7,7 +7,9 @@
#pragma once
#include <units/units.h>
#include <units/acceleration.h>
#include <units/curvature.h>
#include <units/velocity.h>
#include "frc/trajectory/constraint/TrajectoryConstraint.h"

View File

@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/velocity.h>
#include "frc/kinematics/DifferentialDriveKinematics.h"
#include "frc/trajectory/constraint/TrajectoryConstraint.h"

View File

@@ -7,7 +7,8 @@
#pragma once
#include <units/units.h>
#include <units/length.h>
#include <units/voltage.h>
#include "frc/controller/SimpleMotorFeedforward.h"
#include "frc/kinematics/DifferentialDriveKinematics.h"

View File

@@ -7,7 +7,7 @@
#pragma once
#include <units/units.h>
#include <units/length.h>
#include "frc/geometry/Rotation2d.h"
#include "frc/geometry/Translation2d.h"

View File

@@ -7,7 +7,8 @@
#pragma once
#include <units/units.h>
#include <units/math.h>
#include <units/velocity.h>
#include "frc/trajectory/constraint/TrajectoryConstraint.h"

View File

@@ -9,7 +9,7 @@
#include <cmath>
#include <units/units.h>
#include <units/velocity.h>
#include "frc/kinematics/MecanumDriveKinematics.h"
#include "frc/trajectory/constraint/TrajectoryConstraint.h"

View File

@@ -7,8 +7,6 @@
#pragma once
#include <units/units.h>
#include "frc/geometry/Rotation2d.h"
#include "frc/geometry/Translation2d.h"
#include "frc/trajectory/constraint/TrajectoryConstraint.h"

View File

@@ -9,7 +9,7 @@
#include <cmath>
#include <units/units.h>
#include <units/velocity.h>
#include "frc/kinematics/SwerveDriveKinematics.h"
#include "frc/trajectory/constraint/TrajectoryConstraint.h"

View File

@@ -7,6 +7,8 @@
#pragma once
#include <units/math.h>
namespace frc {
template <size_t NumModules>

View File

@@ -9,7 +9,9 @@
#include <limits>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/curvature.h>
#include <units/velocity.h>
#include "frc/geometry/Pose2d.h"
#include "frc/spline/Spline.h"