Class UnjamIntegralCommand
Defined in File unjam_integral_command.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public tap::control::setpoint::UnjamCommandInterface
(Class UnjamCommandInterface)
Class Documentation
-
class UnjamIntegralCommand : public tap::control::setpoint::UnjamCommandInterface
Command that takes control of a velocity setpoint subsystem moves it back and forth. One back and forward motion counts as a cycle. Unjamming cycles start by trying to move in negative direction before trying to move in positive direction.
If the unjam command successfully clears its forward and backward threshold it will will clear the velocity setpoint subsystem’s jam and end. If not successful after some number of cycle counts, the command will give up and end without clearing the jam.
Unlike the unjam command, this command will displace the integral by some amount in order to facilitate unjamming.
Like most velocity commands this one will not schedule/will deschedule if IntegrableSetpointSubsystem goes offline.
Public Functions
-
UnjamIntegralCommand(IntegrableSetpointSubsystem &integrableSetpointSubsystem, const Config &config)
- Parameters:
integrableSetpointSubsystem – [in] The associated agitator subsystem to control.
-
virtual bool isReady() override
-
virtual void initialize() override
-
virtual void execute() override
-
virtual void end(bool interrupted) override
-
virtual bool isFinished() const override
-
inline virtual const char *getName() const override
-
struct Config
Config struct that the user passes into the UnjamIntegralCommand’s constructor.
Public Members
-
float targetUnjamIntegralChange
The target integral setpoint from the current integral value with units
units * seconds
(units of setpoint integrated with respect to time) that the integral setpoint subsystem will move back and forth by with unjamming.- Attention
This value must be positive and > 0.
-
float unjamSetpoint
The target setpoint in units that the integral setpoint subsystem will move back and forth at.
- Attention
This value must be positive and > 0.
-
uint32_t maxWaitTime
The maximum amount of time the controller will wait for the subsystem to reach targetUnjamIntegralChange in milliseconds before trying to move in the opposite direction.
- Attention
This value must be > 1000 * (targetUnjamIntegralChange / unjamSetpoint) since this is the minimum possible time it will take for the motor to rotate targetUnjamIntegralChange units.
-
uint16_t targetCycleCount
The number of cycles to attempt to rotate the velocity setpoint subsystem back and forth.
- Attention
This value must be positive and > 0.
-
float targetUnjamIntegralChange
-
UnjamIntegralCommand(IntegrableSetpointSubsystem &integrableSetpointSubsystem, const Config &config)