2019-12-29 16:02:49 -05:00
|
|
|
/*----------------------------------------------------------------------------*/
|
2020-06-29 22:25:09 -07:00
|
|
|
/* Copyright (c) 2019-2020 FIRST. All Rights Reserved. */
|
2019-12-29 16:02:49 -05:00
|
|
|
/* 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 "ReplaceMeTrapezoidProfileCommand.h"
|
|
|
|
|
|
2020-06-29 22:25:09 -07:00
|
|
|
#include <units/acceleration.h>
|
|
|
|
|
#include <units/velocity.h>
|
|
|
|
|
|
2019-12-29 16:02:49 -05:00
|
|
|
// 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
|
2020-06-29 22:25:09 -07:00
|
|
|
(frc::TrapezoidProfile<units::meters>(
|
2019-12-29 16:02:49 -05:00
|
|
|
// 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}),
|
2020-06-29 22:25:09 -07:00
|
|
|
[](frc::TrapezoidProfile<units::meters>::State state) {
|
2019-12-29 16:02:49 -05:00
|
|
|
// Use the computed intermediate trajectory state here
|
|
|
|
|
}) {}
|