SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
subzero::ISingleAxisSubsystem< Distance > Class Template Referenceabstract

Single axis interface. More...

#include <ISingleAxisSubsystem.h>

Classes

struct  SingleAxisConfig
 The configuration for single-axis mechanisms. More...
 

Public Types

using Distance_t = units::unit_t<Distance>
 
using Velocity
 
using Velocity_t = units::unit_t<Velocity>
 
using Acceleration
 
using Acceleration_t = units::unit_t<Acceleration>
 

Public Member Functions

virtual void RunMotorVelocity (Velocity_t speed, bool ignoreEncoder=false)=0
 Run at the given velocity; disables any in-progress absolute movements.
 
virtual void RunMotorPercentage (double percentSpeed, bool ignoreEncoder=false)=0
 Run at the given velocity percentage; disables any in-progress absolute movements.
 
virtual void RunMotorSpeedDefault (bool ignoreEncoder=false)=0
 Run at the default motor speed.
 
virtual void ResetEncoder ()=0
 Reset encoder back to 0 ticks.
 
virtual Distance_t GetCurrentPosition ()=0
 Get the current position in terms of converted distance.
 
virtual bool AtHome ()=0
 Check if axis is at the mimimum extent of motion.
 
virtual bool AtMax ()=0
 Check if axis is at the maximum extent of motion.
 
virtual bool AtLimitSwitchMin ()=0
 Only check the limit switch for mimimum extent.
 
virtual bool AtLimitSwitchMax ()=0
 Only check the limit switch for maximum extent.
 
virtual frc2::CommandPtr MoveToPositionAbsolute (Distance_t position)=0
 Start moving to the absolute position.
 
virtual frc2::CommandPtr MoveToPositionRelative (Distance_t position)=0
 Start moving to the position given the current distance and relative position.
 
virtual frc2::CommandPtr Home ()=0
 Start the homing sequence.
 
virtual bool IsEnabled ()=0
 Check if absolute positioning is active.
 
virtual void DisablePid ()=0
 Stop and disable any in-progress absolute movements.
 
virtual void EnablePid ()=0
 Enable absolute movements.
 
virtual void Stop ()=0
 Stop the axis.
 

Detailed Description

template<typename Distance>
class subzero::ISingleAxisSubsystem< Distance >

Single axis interface.

Template Parameters
DistanceThe distance unit- typically meter, inch, degree, radian, etc.

Definition at line 36 of file ISingleAxisSubsystem.h.

Member Typedef Documentation

◆ Acceleration

template<typename Distance >
using subzero::ISingleAxisSubsystem< Distance >::Acceleration
Initial value:
units::compound_unit<Velocity, units::inverse<units::seconds>>

Definition at line 42 of file ISingleAxisSubsystem.h.

◆ Acceleration_t

template<typename Distance >
using subzero::ISingleAxisSubsystem< Distance >::Acceleration_t = units::unit_t<Acceleration>

Definition at line 44 of file ISingleAxisSubsystem.h.

◆ Distance_t

template<typename Distance >
using subzero::ISingleAxisSubsystem< Distance >::Distance_t = units::unit_t<Distance>

Definition at line 38 of file ISingleAxisSubsystem.h.

◆ Velocity

template<typename Distance >
using subzero::ISingleAxisSubsystem< Distance >::Velocity
Initial value:
units::compound_unit<Distance, units::inverse<units::seconds>>

Definition at line 39 of file ISingleAxisSubsystem.h.

◆ Velocity_t

template<typename Distance >
using subzero::ISingleAxisSubsystem< Distance >::Velocity_t = units::unit_t<Velocity>

Definition at line 41 of file ISingleAxisSubsystem.h.

Member Function Documentation

◆ AtHome()

template<typename Distance >
virtual bool subzero::ISingleAxisSubsystem< Distance >::AtHome ( )
pure virtual

◆ AtLimitSwitchMax()

template<typename Distance >
virtual bool subzero::ISingleAxisSubsystem< Distance >::AtLimitSwitchMax ( )
pure virtual

◆ AtLimitSwitchMin()

template<typename Distance >
virtual bool subzero::ISingleAxisSubsystem< Distance >::AtLimitSwitchMin ( )
pure virtual

◆ AtMax()

template<typename Distance >
virtual bool subzero::ISingleAxisSubsystem< Distance >::AtMax ( )
pure virtual

◆ DisablePid()

template<typename Distance >
virtual void subzero::ISingleAxisSubsystem< Distance >::DisablePid ( )
pure virtual

◆ EnablePid()

◆ GetCurrentPosition()

template<typename Distance >
virtual Distance_t subzero::ISingleAxisSubsystem< Distance >::GetCurrentPosition ( )
pure virtual

◆ Home()

template<typename Distance >
virtual frc2::CommandPtr subzero::ISingleAxisSubsystem< Distance >::Home ( )
pure virtual

◆ IsEnabled()

template<typename Distance >
virtual bool subzero::ISingleAxisSubsystem< Distance >::IsEnabled ( )
pure virtual

◆ MoveToPositionAbsolute()

template<typename Distance >
virtual frc2::CommandPtr subzero::ISingleAxisSubsystem< Distance >::MoveToPositionAbsolute ( Distance_t position)
pure virtual

◆ MoveToPositionRelative()

template<typename Distance >
virtual frc2::CommandPtr subzero::ISingleAxisSubsystem< Distance >::MoveToPositionRelative ( Distance_t position)
pure virtual

Start moving to the position given the current distance and relative position.

Parameters
position
Returns
frc2::CommandPtr

Implemented in subzero::BaseSingleAxisSubsystem< TController, TDistance >, subzero::BaseSingleAxisSubsystem< TController, units::degree >, and subzero::BaseSingleAxisSubsystem< TController, units::meter >.

◆ ResetEncoder()

template<typename Distance >
virtual void subzero::ISingleAxisSubsystem< Distance >::ResetEncoder ( )
pure virtual

◆ RunMotorPercentage()

template<typename Distance >
virtual void subzero::ISingleAxisSubsystem< Distance >::RunMotorPercentage ( double percentSpeed,
bool ignoreEncoder = false )
pure virtual

Run at the given velocity percentage; disables any in-progress absolute movements.

Parameters
speed
ignoreEncoder

Implemented in subzero::BaseSingleAxisSubsystem< TController, TDistance >, subzero::BaseSingleAxisSubsystem< TController, units::degree >, and subzero::BaseSingleAxisSubsystem< TController, units::meter >.

◆ RunMotorSpeedDefault()

template<typename Distance >
virtual void subzero::ISingleAxisSubsystem< Distance >::RunMotorSpeedDefault ( bool ignoreEncoder = false)
pure virtual

◆ RunMotorVelocity()

template<typename Distance >
virtual void subzero::ISingleAxisSubsystem< Distance >::RunMotorVelocity ( Velocity_t speed,
bool ignoreEncoder = false )
pure virtual

Run at the given velocity; disables any in-progress absolute movements.

Parameters
speed
ignoreEncoder

Implemented in subzero::BaseSingleAxisSubsystem< TController, TDistance >, subzero::BaseSingleAxisSubsystem< TController, units::degree >, and subzero::BaseSingleAxisSubsystem< TController, units::meter >.

◆ Stop()


The documentation for this class was generated from the following file: