Class MoveAbsoluteCommand

Inheritance Relationships

Base Type

Class Documentation

class MoveAbsoluteCommand : public tap::control::Command

A command that uses an SetpointSubsystem to move to the same position/value everytime, attemping to rotate at the given velocity. (Coordinates may shift if motor disconnects). This command ends immediately if the agitator is jammed, and upon ending will stop the connected agitator by setting its target position to its current position.

Subsystem values are relative, and the “0”-value is changed when the agitator is calibrated.

Public Functions

explicit MoveAbsoluteCommand(tap::control::setpoint::SetpointSubsystem *setpointSubsystem, float setpoint, float speed, float setpointTolerance, bool shouldAutomaticallyClearJam, bool setSetpointToTargetOnEnd)
Parameters:
  • setpointSubsystem[in] the subsystem this command manipulates.

  • setpoint[in] the target value the controlled variable should reach

  • speed[in] The speed the subsystem should attempt to move its value at in units/second (where “units” are the same as those the setpoint uses)

  • setpointTolerance[in] the command will consider the target value as reached when it’s distance to the target is within this value

  • shouldAutomaticallyClearJam[in] the command will clear the subsystem’s jam state without any unjamming performed

  • setSetpointToTargetOnEnd[in] the command will set the subsystem’s setpoint to the target value when ending if true, otherwise it will set the setpoint to the subsystem’s current value.

inline virtual const char *getName() const override
virtual bool isReady() override
virtual void initialize() override
virtual void execute() override
virtual void end(bool interrupted) override
virtual bool isFinished() const override

Protected Attributes

tap::control::setpoint::SetpointSubsystem *setpointSubsystem