mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[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:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <frc/controller/ProfiledPIDController.h>
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
|
||||
#include "frc2/command/SubsystemBase.h"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "frc/trajectory/Trajectory.h"
|
||||
|
||||
#include <units/math.h>
|
||||
#include <wpi/json.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
Trajectory TrajectoryParameterizer::TimeParameterizeTrajectory(
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "frc/trajectory/constraint/CentripetalAccelerationConstraint.h"
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
CentripetalAccelerationConstraint::CentripetalAccelerationConstraint(
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#include <units/math.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
EllipticalRegionConstraint::EllipticalRegionConstraint(
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "frc/trajectory/constraint/MecanumDriveKinematicsConstraint.h"
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
using namespace frc;
|
||||
|
||||
MecanumDriveKinematicsConstraint::MecanumDriveKinematicsConstraint(
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
#include <wpi/deprecated.h>
|
||||
|
||||
#include "frc/RobotBase.h"
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
|
||||
namespace frc {
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
#include <wpi/deprecated.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <chrono>
|
||||
|
||||
#include <hal/cpp/fpga_clock.h>
|
||||
#include <units/units.h>
|
||||
#include <wpi/StringMap.h>
|
||||
#include <wpi/StringRef.h>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/math.h>
|
||||
|
||||
namespace frc {
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/voltage.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
#include <units/voltage.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/angle.h>
|
||||
|
||||
#include "frc/geometry/Rotation2d.h"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
namespace frc {
|
||||
|
||||
template <class... Wheels>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <hal/FRCUsageReporting.h>
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
|
||||
namespace frc {
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/length.h>
|
||||
|
||||
#include "frc/geometry/Rotation2d.h"
|
||||
#include "frc/geometry/Translation2d.h"
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/math.h>
|
||||
#include <units/velocity.h>
|
||||
|
||||
#include "frc/trajectory/constraint/TrajectoryConstraint.h"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/math.h>
|
||||
|
||||
namespace frc {
|
||||
|
||||
template <size_t NumModules>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/time.h>
|
||||
#include <wpi/deprecated.h>
|
||||
#include <wpi/mutex.h>
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include <units/units.h>
|
||||
#include <units/angle.h>
|
||||
|
||||
#include "frc/controller/ControllerUtil.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
}) {}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
}) {}
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user