Class MoveCommand

Inheritance Relationships

Base Type

Class Documentation

class MoveCommand : public tap::control::Command

Displaces the connected subsystem some value in some desired time. Currently pass in a displacement and time to move and it uses tap::arch::getTimeMilliseconds() to determine the speed to move at.

Ends if subsystem is offline.

Public Functions

MoveCommand(SetpointSubsystem *setpointSubsystem, float targetDisplacement, uint32_t moveTime, uint32_t pauseAfterMoveTime, bool setToTargetOnEnd, float setpointTolerance)

Attention

the ramp value is calculated by finding the rotation speed ( \(targetDisplacement / moveTime\)), and then multiplying this by the period (how often the ramp is called)

Parameters:
  • setpointSubsystem[in] The subsystem associated with the rotate command.

  • targetDisplacement[in] The desired change in subsystem value in subsystem units.

  • moveTime[in] The time it takes to move the subsystem to the desired value in milliseconds.

  • pauseAfterMoveTime[in] Time in milliseconds that the command will wait after reaching the target displacement before the command is considered complete.

  • setToTargetOnEnd[in] if true the command will set the subsystem setpoint to the ideal target value on an uninterrupted end() if subsystem is online and unjammed, otherwise the subsystem will always set the setpoint to the its current value on end().

  • setpointTolerance[in] The difference between current and desired value when the command will be considered to be completed (used in the isFinished function). Uses the same units as the subsystem’s setpoint.

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