24template <
class Distance>
26 :
public CommandHelper<Command, TrapezoidProfileCommand<Distance>> {
45 [[deprecated(
"Use a TrapezoidProfile instead")]]
47 std::function<
void(State)> output,
48 std::function<State()> goal,
49 std::function<State()> currentState,
54 m_currentState(currentState) {
55 this->AddRequirements(requirements);
61 m_output(m_profile.Calculate(20_ms, m_currentState(), m_goal()));
64 void End(
bool interrupted)
override {}
66 bool IsFinished()
override {
return m_profile.IsFinished(0_s); }
70 std::function<void(State)> m_output;
71 std::function<State()> m_goal;
72 std::function<State()> m_currentState;
CRTP implementation to allow polymorphic decorator functions in Command.
Definition CommandHelper.h:25
Represents requirements for a command, which is a set of (pointers to) subsystems.
Definition Requirements.h:20
A command that runs a TrapezoidProfile.
Definition TrapezoidProfileCommand.h:26
void Initialize() override
Definition TrapezoidProfileCommand.h:58
void Execute() override
Definition TrapezoidProfileCommand.h:60
void End(bool interrupted) override
Definition TrapezoidProfileCommand.h:64
TrapezoidProfileCommand(frc::TrapezoidProfile< Distance > profile, std::function< void(State)> output, std::function< State()> goal, std::function< State()> currentState, Requirements requirements={})
Creates a new TrapezoidProfileCommand that will execute the given TrapezoidalProfile.
Definition TrapezoidProfileCommand.h:46
bool IsFinished() override
Definition TrapezoidProfileCommand.h:66
Profile state.
Definition TrapezoidProfile.h:96
A trapezoid-shaped velocity profile.
Definition TrapezoidProfile.h:46
typename units::detail::compound_impl< U, Us... >::type compound_unit
Represents a unit type made up from other units.
Definition base.h:1438
Definition FunctionalCommand.h:13