|
WPILibC++
2020.3.2
|
A subsystem that generates and runs trapezoidal motion profiles automatically. More...
#include <TrapezoidProfileSubsystem.h>
Public Member Functions | |
| TrapezoidProfileSubsystem (Constraints constraints, Distance_t initialPosition=Distance_t{0}, units::second_t period=20_ms) | |
| Creates a new TrapezoidProfileSubsystem. More... | |
| void | Periodic () override |
| This method is called periodically by the CommandScheduler. More... | |
| void | SetGoal (State goal) |
| Sets the goal state for the subsystem. More... | |
| void | SetGoal (Distance_t goal) |
| Sets the goal state for the subsystem. More... | |
Public Member Functions inherited from frc2::SubsystemBase | |
| void | InitSendable (frc::SendableBuilder &builder) override |
| Initializes this Sendable object. More... | |
| std::string | GetName () const |
| Gets the name of this Subsystem. More... | |
| void | SetName (const wpi::Twine &name) |
| Sets the name of this Subsystem. More... | |
| std::string | GetSubsystem () const |
| Gets the subsystem name of this Subsystem. More... | |
| void | SetSubsystem (const wpi::Twine &name) |
| Sets the subsystem name of this Subsystem. More... | |
| void | AddChild (std::string name, frc::Sendable *child) |
| Associate a Sendable with this Subsystem. More... | |
Public Member Functions inherited from frc2::Subsystem | |
| template<class T , typename = std::enable_if_t<std::is_base_of_v< Command, std::remove_reference_t<T>>>> | |
| void | SetDefaultCommand (T &&defaultCommand) |
| Sets the default Command of the subsystem. More... | |
| Command * | GetDefaultCommand () const |
| Gets the default command for this subsystem. More... | |
| Command * | GetCurrentCommand () const |
| Returns the command currently running on this subsystem. More... | |
| void | Register () |
| Registers this subsystem with the CommandScheduler, allowing its Periodic() method to be called when the scheduler runs. | |
Public Member Functions inherited from frc::SendableHelper< SubsystemBase > | |
| SendableHelper (const SendableHelper &rhs)=default | |
| SendableHelper (SendableHelper &&rhs) | |
| SendableHelper & | operator= (const SendableHelper &rhs)=default |
| SendableHelper & | operator= (SendableHelper &&rhs) |
| std::string | GetName () const |
| Gets the name of this Sendable object. More... | |
| void | SetName (const wpi::Twine &name) |
| Sets the name of this Sendable object. More... | |
| void | SetName (const wpi::Twine &subsystem, const wpi::Twine &name) |
| Sets both the subsystem name and device name of this Sendable object. More... | |
| std::string | GetSubsystem () const |
| Gets the subsystem name of this Sendable object. More... | |
| void | SetSubsystem (const wpi::Twine &subsystem) |
| Sets the subsystem name of this Sendable object. More... | |
Protected Member Functions | |
| virtual void | UseState (State state)=0 |
| Users should override this to consume the current state of the motion profile. More... | |
| void | Enable () |
| Enable the TrapezoidProfileSubsystem's output. | |
| void | Disable () |
| Disable the TrapezoidProfileSubsystem's output. | |
Protected Member Functions inherited from frc::SendableHelper< SubsystemBase > | |
| void | SetName (const wpi::Twine &moduleType, int channel) |
| Sets the name of the sensor with a channel number. More... | |
| void | SetName (const wpi::Twine &moduleType, int moduleNumber, int channel) |
| Sets the name of the sensor with a module and channel number. More... | |
| void | AddChild (std::shared_ptr< Sendable > child) |
| Add a child component. More... | |
| void | AddChild (void *child) |
| Add a child component. More... | |
A subsystem that generates and runs trapezoidal motion profiles automatically.
The user specifies how to use the current state of the motion profile by overriding the UseState method.
|
inlineexplicit |
Creates a new TrapezoidProfileSubsystem.
| constraints | The constraints (maximum velocity and acceleration) for the profiles. |
| initialPosition | The initial position of the controller mechanism when the subsystem is constructed. |
| period | The period of the main robot loop, in seconds. |
|
inlineoverridevirtual |
This method is called periodically by the CommandScheduler.
Useful for updating subsystem-specific state that you don't want to offload to a Command. Teams should try to be consistent within their own codebases about which responsibilities will be handled by Commands, and which will be handled here.
Reimplemented from frc2::Subsystem.
|
inline |
Sets the goal state for the subsystem.
Goal velocity assumed to be zero.
| goal | The goal position for the subsystem's motion profile. |
|
inline |
Sets the goal state for the subsystem.
| goal | The goal state for the subsystem's motion profile. |
|
protectedpure virtual |
Users should override this to consume the current state of the motion profile.
| state | The current state of the motion profile. |