mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user