[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

@@ -36,7 +36,7 @@ CoreUI wpiutil/src/main/native/resources/coreui-*
Feather Icons wpiutil/src/main/native/resources/feather-*
jQuery wpiutil/src/main/native/resources/jquery-*
popper.js wpiutil/src/main/native/resources/popper-*
units wpiutil/src/main/native/include/units/units.h
units wpiutil/src/main/native/include/units/
Eigen wpiutil/src/main/native/eigeninclude/
StackWalker wpiutil/src/main/native/windows/StackWalker.*
Team 254 Library wpilibj/src/main/java/edu/wpi/first/wpilibj/spline/SplineParameterizer.java

View File

@@ -16,7 +16,8 @@
#define IMGUI_DEFINE_MATH_OPERATORS
#include <hal/simulation/SimDeviceData.h>
#include <imgui_internal.h>
#include <units/units.h>
#include <units/angle.h>
#include <units/length.h>
#include <wpi/Path.h>
#include <wpi/SmallString.h>
#include <wpi/json.h>

View File

@@ -13,7 +13,7 @@
#include <string>
#include <frc/ErrorBase.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include <wpi/Demangle.h>
#include <wpi/SmallSet.h>

View File

@@ -16,7 +16,7 @@
#include <frc/Watchdog.h>
#include <frc/smartdashboard/Sendable.h>
#include <frc/smartdashboard/SendableHelper.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include <wpi/FunctionExtras.h>

View File

@@ -18,7 +18,10 @@
#include <frc/kinematics/MecanumDriveKinematics.h>
#include <frc/kinematics/MecanumDriveWheelSpeeds.h>
#include <frc/trajectory/Trajectory.h>
#include <units/units.h>
#include <units/angle.h>
#include <units/length.h>
#include <units/velocity.h>
#include <units/voltage.h>
#include <wpi/ArrayRef.h>
#include "CommandBase.h"

View File

@@ -11,7 +11,7 @@
#include <initializer_list>
#include <frc/Notifier.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include "frc2/command/CommandBase.h"

View File

@@ -12,7 +12,7 @@
#include <utility>
#include <frc/controller/ProfiledPIDController.h>
#include <units/units.h>
#include <units/time.h>
#include <wpi/ArrayRef.h>
#include "frc2/command/CommandBase.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include <frc/controller/ProfiledPIDController.h>
#include <units/units.h>
#include <units/time.h>
#include "frc2/command/SubsystemBase.h"

View File

@@ -17,7 +17,8 @@
#include <frc/geometry/Pose2d.h>
#include <frc/kinematics/DifferentialDriveKinematics.h>
#include <frc/trajectory/Trajectory.h>
#include <units/units.h>
#include <units/length.h>
#include <units/voltage.h>
#include <wpi/ArrayRef.h>
#include "frc2/Timer.h"

View File

@@ -17,7 +17,9 @@
#include <frc/kinematics/SwerveDriveKinematics.h>
#include <frc/kinematics/SwerveModuleState.h>
#include <frc/trajectory/Trajectory.h>
#include <units/units.h>
#include <units/length.h>
#include <units/time.h>
#include <units/voltage.h>
#include <wpi/ArrayRef.h>
#include "CommandBase.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,7 @@
#pragma once
#include <frc/trajectory/TrapezoidProfile.h>
#include <units/units.h>
#include <units/time.h>
#include "frc2/command/SubsystemBase.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/time.h>
#include "frc2/Timer.h"
#include "frc2/command/CommandBase.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. */
@@ -9,7 +9,7 @@
#include <functional>
#include <units/units.h>
#include <units/time.h>
#include "frc2/command/CommandBase.h"
#include "frc2/command/CommandHelper.h"

View File

@@ -9,6 +9,8 @@
#include <cmath>
#include <units/math.h>
using 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,7 @@
#include <cmath>
#include <units/math.h>
#include <wpi/json.h>
using 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,6 +7,7 @@
#include "frc/geometry/Translation2d.h"
#include <units/math.h>
#include <wpi/json.h>
using 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,6 +7,8 @@
#include "frc/kinematics/DifferentialDriveWheelSpeeds.h"
#include <units/math.h>
using namespace frc;
void DifferentialDriveWheelSpeeds::Normalize(

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,6 +11,8 @@
#include <array>
#include <cmath>
#include <units/math.h>
using namespace frc;
void MecanumDriveWheelSpeeds::Normalize(

View File

@@ -7,6 +7,7 @@
#include "frc/trajectory/Trajectory.h"
#include <units/math.h>
#include <wpi/json.h>
using namespace frc;

View File

@@ -33,6 +33,8 @@
#include <string>
#include <units/math.h>
using namespace frc;
Trajectory TrajectoryParameterizer::TimeParameterizeTrajectory(

View File

@@ -7,6 +7,8 @@
#include "frc/trajectory/constraint/CentripetalAccelerationConstraint.h"
#include <units/math.h>
using namespace frc;
CentripetalAccelerationConstraint::CentripetalAccelerationConstraint(

View File

@@ -10,6 +10,7 @@
#include <algorithm>
#include <limits>
#include <units/math.h>
#include <wpi/MathExtras.h>
using namespace frc;

View File

@@ -9,6 +9,8 @@
#include <limits>
#include <units/math.h>
using namespace frc;
EllipticalRegionConstraint::EllipticalRegionConstraint(

View File

@@ -7,6 +7,8 @@
#include "frc/trajectory/constraint/MecanumDriveKinematicsConstraint.h"
#include <units/math.h>
using namespace frc;
MecanumDriveKinematicsConstraint::MecanumDriveKinematicsConstraint(

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"

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

@@ -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. */
@@ -11,7 +11,7 @@
#include <memory>
#include <random>
#include <units/units.h>
#include <units/time.h>
#include <wpi/math>
#include "gtest/gtest.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. */
@@ -12,7 +12,7 @@
#include <memory>
#include <random>
#include <units/units.h>
#include <units/time.h>
#include <wpi/math>
#include "gtest/gtest.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,6 +7,10 @@
#include <thread>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
#include "frc/SlewRateLimiter.h"
#include "gtest/gtest.h"

View File

@@ -5,7 +5,7 @@
/* the project. */
/*----------------------------------------------------------------------------*/
#include <units/units.h>
#include <units/angle.h>
#include "frc/controller/ControllerUtil.h"
#include "gtest/gtest.h"

View File

@@ -1,10 +1,11 @@
/*----------------------------------------------------------------------------*/
/* 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. */
/*----------------------------------------------------------------------------*/
#include <units/math.h>
#include <wpi/math>
#include "frc/controller/RamseteController.h"

View File

@@ -1,11 +1,13 @@
/*----------------------------------------------------------------------------*/
/* 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. */
/*----------------------------------------------------------------------------*/
#include <units/units.h>
#include <units/angular_velocity.h>
#include <units/length.h>
#include <units/velocity.h>
#include <wpi/math>
#include "frc/kinematics/ChassisSpeeds.h"

View File

@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
/* 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. */
/*----------------------------------------------------------------------------*/
#include <units/units.h>
#include <units/angular_velocity.h>
#include <wpi/math>
#include "frc/geometry/Translation2d.h"

View File

@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------*/
/* 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. */
/*----------------------------------------------------------------------------*/
#include <units/units.h>
#include <units/angular_velocity.h>
#include <wpi/math>
#include "frc/geometry/Translation2d.h"

View File

@@ -9,7 +9,7 @@
#include <iostream>
#include <vector>
#include <units/units.h>
#include <units/length.h>
#include "frc/geometry/Pose2d.h"
#include "frc/geometry/Rotation2d.h"

View File

@@ -8,7 +8,8 @@
#include <chrono>
#include <iostream>
#include <units/units.h>
#include <units/angle.h>
#include <units/length.h>
#include "frc/geometry/Pose2d.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,10 @@
#include <memory>
#include <vector>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/angle.h>
#include <units/math.h>
#include <units/velocity.h>
#include "frc/trajectory/constraint/CentripetalAccelerationConstraint.h"
#include "frc/trajectory/constraint/TrajectoryConstraint.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,7 @@
#include <memory>
#include <vector>
#include <units/units.h>
#include <units/time.h>
#include "frc/kinematics/DifferentialDriveKinematics.h"
#include "frc/trajectory/constraint/DifferentialDriveKinematicsConstraint.h"

View File

@@ -9,7 +9,11 @@
#include <memory>
#include <vector>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/length.h>
#include <units/time.h>
#include <units/velocity.h>
#include <units/voltage.h>
#include "frc/geometry/Pose2d.h"
#include "frc/kinematics/DifferentialDriveKinematics.h"

View File

@@ -7,7 +7,10 @@
#include <vector>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/angle.h>
#include <units/length.h>
#include <units/velocity.h>
#include "frc/kinematics/DifferentialDriveKinematics.h"
#include "frc/trajectory/constraint/EllipticalRegionConstraint.h"

View File

@@ -7,7 +7,10 @@
#include <vector>
#include <units/units.h>
#include <units/acceleration.h>
#include <units/length.h>
#include <units/math.h>
#include <units/velocity.h>
#include "frc/kinematics/DifferentialDriveKinematics.h"
#include "frc/trajectory/constraint/MaxVelocityConstraint.h"

View File

@@ -7,6 +7,8 @@
#include <vector>
#include <units/math.h>
#include "frc/trajectory/Trajectory.h"
#include "frc/trajectory/TrajectoryGenerator.h"
#include "frc/trajectory/constraint/CentripetalAccelerationConstraint.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. */
@@ -10,6 +10,11 @@
#include <chrono>
#include <cmath>
#include <units/acceleration.h>
#include <units/length.h>
#include <units/math.h>
#include <units/velocity.h>
#include "gtest/gtest.h"
static constexpr auto kDt = 10_ms;

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,13 +7,16 @@
#include "ReplaceMeProfiledPIDCommand.h"
#include <units/acceleration.h>
#include <units/velocity.h>
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html
ReplaceMeProfiledPIDCommand::ReplaceMeProfiledPIDCommand()
: CommandHelper(
// The ProfiledPIDController that the command will use
frc::ProfiledPIDController<units::meter>(
frc::ProfiledPIDController<units::meters>(
// The PID gains
0, 0, 0,
// The motion profile constraints
@@ -22,11 +25,11 @@ ReplaceMeProfiledPIDCommand::ReplaceMeProfiledPIDCommand()
[] { return 0_m; },
// This should return the goal state (can also be a constant)
[] {
return frc::TrapezoidProfile<units::meter>::State{0_m, 0_mps};
return frc::TrapezoidProfile<units::meters>::State{0_m, 0_mps};
},
// This uses the output and current trajectory setpoint
[](double output,
frc::TrapezoidProfile<units::meter>::State setpoint) {
frc::TrapezoidProfile<units::meters>::State setpoint) {
// Use the output and setpoint here
}) {}

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,9 +9,10 @@
#include <frc2/command/CommandHelper.h>
#include <frc2/command/ProfiledPIDCommand.h>
#include <units/length.h>
class ReplaceMeProfiledPIDCommand
: public frc2::CommandHelper<frc2::ProfiledPIDCommand<units::meter>,
: public frc2::CommandHelper<frc2::ProfiledPIDCommand<units::meters>,
ReplaceMeProfiledPIDCommand> {
public:
ReplaceMeProfiledPIDCommand();

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,17 +7,20 @@
#include "ReplaceMeProfiledPIDSubsystem.h"
#include <units/acceleration.h>
#include <units/velocity.h>
ReplaceMeProfiledPIDSubsystem::ReplaceMeProfiledPIDSubsystem()
: ProfiledPIDSubsystem(
// The ProfiledPIDController used by the subsystem
frc::ProfiledPIDController<units::meter>(
frc::ProfiledPIDController<units::meters>(
// The PID gains
0, 0, 0,
// The constraints for the motion profiles
{0_mps, 0_mps_sq})) {}
void ReplaceMeProfiledPIDSubsystem::UseOutput(
double output, frc::TrapezoidProfile<units::meter>::State setpoint) {
double output, frc::TrapezoidProfile<units::meters>::State setpoint) {
// Use the output and current trajectory setpoint here
}

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,15 +8,16 @@
#pragma once
#include <frc2/command/ProfiledPIDSubsystem.h>
#include <units/length.h>
class ReplaceMeProfiledPIDSubsystem
: public frc2::ProfiledPIDSubsystem<units::meter> {
: public frc2::ProfiledPIDSubsystem<units::meters> {
public:
ReplaceMeProfiledPIDSubsystem();
protected:
void UseOutput(double output,
frc::TrapezoidProfile<units::meter>::State setpoint) override;
frc::TrapezoidProfile<units::meters>::State setpoint) override;
units::meter_t GetMeasurement() override;
};

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,19 +7,22 @@
#include "ReplaceMeTrapezoidProfileCommand.h"
#include <units/acceleration.h>
#include <units/velocity.h>
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html
ReplaceMeTrapezoidProfileCommand::ReplaceMeTrapezoidProfileCommand()
: CommandHelper
// The profile to execute
(frc::TrapezoidProfile<units::meter>(
(frc::TrapezoidProfile<units::meters>(
// The maximum velocity and acceleration of the profile
{5_mps, 5_mps_sq},
// The goal state of the profile
{10_m, 0_mps},
// The initial state of the profile
{0_m, 0_mps}),
[](frc::TrapezoidProfile<units::meter>::State state) {
[](frc::TrapezoidProfile<units::meters>::State state) {
// Use the computed intermediate trajectory state here
}) {}

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,9 +9,10 @@
#include <frc2/command/CommandHelper.h>
#include <frc2/command/TrapezoidProfileCommand.h>
#include <units/length.h>
class ReplaceMeTrapezoidProfileCommand
: public frc2::CommandHelper<frc2::TrapezoidProfileCommand<units::meter>,
: public frc2::CommandHelper<frc2::TrapezoidProfileCommand<units::meters>,
ReplaceMeTrapezoidProfileCommand> {
public:
ReplaceMeTrapezoidProfileCommand();

Some files were not shown because too many files have changed in this diff Show More