Class SetpointSubsystem

Inheritance Relationships

Base Type

Derived Type

Class Documentation

class SetpointSubsystem : public virtual tap::control::Subsystem

An abstract class (usable as an interface) describing the functionalities of a subsystem which uses a positional controller to rotate something.

Any mention of position in the documentation for this class does not necessarily refer to a physical location in space, rather it refers to a quantity describing whatever is being positionally controlled by the subsystem.

Subclassed by tap::control::setpoint::IntegrableSetpointSubsystem

Public Functions

inline virtual float getSetpoint() const = 0
Returns:

the subsystem’s setpoint: the desired value of whatever is being controlled.

inline virtual void setSetpoint(float newAngle) = 0

Sets the desired position of the subsystem, relative to where it was calibrated.

Parameters:

newValue[in] the new desired value the subsystem will try to reach.

virtual float getCurrentValue() const = 0
Returns:

The current value of the controlled variable.

virtual float getJamSetpointTolerance() const = 0
Returns:

the jamming tolerance. This is the maximum distance between the ideal setpoint and current value of the controlled variable at which the subsystem will never consider itself jammed.

virtual bool calibrateHere() = 0

Attempts to calibrate the subsystem at the current position, such that getCurrentValue will return 0 units at this position.

Returns:

true if the subsystem has been successfully calibrated, false otherwise.

virtual bool isJammed() = 0
Returns:

true if the subsystem unjam timer has expired, signaling that the subsystem has jammed, false otherwise.

virtual void clearJam() = 0

Call to clear the jam flag of the subsystem, indicating that the jam has been solved.

Todo:

At some point we should move the unjam command logic into the subsystems

inline virtual bool isCalibrated() = 0
Returns:

true if the subsystem has been calibrated

inline virtual bool isOnline() = 0
Returns:

true if the subsystem is online (i.e.: is connected)

inline virtual float getVelocity() = 0
Returns:

the velocity of the subsystem (i.e.: the rate of change of the controlled variable’s value).