[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

@@ -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,11 @@
#include <frc/TimedRobot.h>
#include <frc/controller/SimpleMotorFeedforward.h>
#include <frc/trajectory/TrapezoidProfile.h>
#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 <wpi/math>
#include "ExampleSmartMotorController.h"
@@ -33,8 +37,8 @@ class Robot : public frc::TimedRobot {
// Create a motion profile with the given maximum velocity and maximum
// acceleration constraints for the next setpoint, the desired goal, and the
// current setpoint.
frc::TrapezoidProfile<units::meter> profile{m_constraints, m_goal,
m_setpoint};
frc::TrapezoidProfile<units::meters> profile{m_constraints, m_goal,
m_setpoint};
// Retrieve the profiled setpoint for the next timestep. This setpoint moves
// toward the goal while obeying the constraints.