WPILibC++ 2024.3.2
frc2::TrapezoidProfileCommand< Distance > Class Template Reference

A command that runs a TrapezoidProfile. More...

#include <frc2/command/TrapezoidProfileCommand.h>

Inheritance diagram for frc2::TrapezoidProfileCommand< Distance >:
frc2::CommandHelper< Command, TrapezoidProfileCommand< Distance > >

Public Member Functions

 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. More...
 
 TrapezoidProfileCommand (frc::TrapezoidProfile< Distance > profile, std::function< void(State)> output, Requirements requirements={})
 Creates a new TrapezoidProfileCommand that will execute the given TrapezoidalProfile. More...
 
void Initialize () override
 
void Execute () override
 
void End (bool interrupted) override
 
bool IsFinished () override
 
- Public Member Functions inherited from frc2::CommandHelper< Command, TrapezoidProfileCommand< Distance > >
 CommandHelper ()=default
 
CommandPtr ToPtr () &&override
 

Additional Inherited Members

- Protected Member Functions inherited from frc2::CommandHelper< Command, TrapezoidProfileCommand< Distance > >
std::unique_ptr< CommandTransferOwnership () &&override
 

Detailed Description

template<class Distance>
class frc2::TrapezoidProfileCommand< Distance >

A command that runs a TrapezoidProfile.

Useful for smoothly controlling mechanism motion.

This class is provided by the NewCommands VendorDep

See also
TrapezoidProfile

Constructor & Destructor Documentation

◆ TrapezoidProfileCommand() [1/2]

template<class Distance >
frc2::TrapezoidProfileCommand< Distance >::TrapezoidProfileCommand ( frc::TrapezoidProfile< Distance >  profile,
std::function< void(State)>  output,
std::function< State()>  goal,
std::function< State()>  currentState,
Requirements  requirements = {} 
)
inline

Creates a new TrapezoidProfileCommand that will execute the given TrapezoidalProfile.

Output will be piped to the provided consumer function.

Parameters
profileThe motion profile to execute.
outputThe consumer for the profile output.
goalThe supplier for the desired state
currentStateThe current state
requirementsThe list of requirements.

◆ TrapezoidProfileCommand() [2/2]

template<class Distance >
frc2::TrapezoidProfileCommand< Distance >::TrapezoidProfileCommand ( frc::TrapezoidProfile< Distance >  profile,
std::function< void(State)>  output,
Requirements  requirements = {} 
)
inline

Creates a new TrapezoidProfileCommand that will execute the given TrapezoidalProfile.

Output will be piped to the provided consumer function.

Parameters
profileThe motion profile to execute.
outputThe consumer for the profile output.
requirementsThe list of requirements.
Deprecated:
The new constructor allows you to pass in a supplier for desired and current state. This allows you to change goals at runtime.

Member Function Documentation

◆ End()

template<class Distance >
void frc2::TrapezoidProfileCommand< Distance >::End ( bool  interrupted)
inlineoverride

◆ Execute()

template<class Distance >
void frc2::TrapezoidProfileCommand< Distance >::Execute ( )
inlineoverride

◆ Initialize()

template<class Distance >
void frc2::TrapezoidProfileCommand< Distance >::Initialize ( )
inlineoverride

◆ IsFinished()

template<class Distance >
bool frc2::TrapezoidProfileCommand< Distance >::IsFinished ( )
inlineoverride

The documentation for this class was generated from the following file: