SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
subzero::RotationalSingleAxisSubsystem< TController > Class Template Reference

A single axis representing a circular path of motion in degrees. More...

#include <RotationalSingleAxisSubsystem.h>

+ Inheritance diagram for subzero::RotationalSingleAxisSubsystem< TController >:
+ Collaboration diagram for subzero::RotationalSingleAxisSubsystem< TController >:

Public Member Functions

 RotationalSingleAxisSubsystem (std::string name, TController &controller, ISingleAxisSubsystem< units::degree >::SingleAxisConfig config, units::meter_t armatureLength, frc::MechanismObject2d *node=nullptr)
 
void Periodic () override
 
void RunMotorVelocity (units::degrees_per_second_t speed, bool ignoreEncoder=false) override
 
- Public Member Functions inherited from subzero::BaseSingleAxisSubsystem< TController, units::degree >
 BaseSingleAxisSubsystem (std::string name, TController &controller, ISingleAxisSubsystem< units::degree >::SingleAxisConfig config, frc::MechanismObject2d *mechanismNode=nullptr)
 
void Periodic () override
 Runs the absolute positioning task and updates relevant info on SmartDashboard.
 
virtual void RunMotorVelocity (Velocity_t speed, bool ignoreEncoder=false)=0
 Run at the given velocity; disables any in-progress absolute movements.
 
void UseState (PidState setpoint) override
 
void RunMotorSpeedDefault (bool ignoreEncoder=false) override
 Run at the default motor speed.
 
void RunMotorPercentage (double percentSpeed, bool ignoreEncoder=false) override
 Run at the given velocity percentage; disables any in-progress absolute movements.
 
Distance_t GetCurrentPosition () override
 Get the current position in terms of converted distance.
 
void Stop () override
 Stop the axis.
 
void ResetEncoder () override
 Reset encoder back to 0 ticks.
 
bool AtHome () override
 Check if axis is at the mimimum extent of motion.
 
bool AtMax () override
 Check if axis is at the maximum extent of motion.
 
bool AtLimitSwitchMin () override
 Only check the limit switch for mimimum extent.
 
bool AtLimitSwitchMax () override
 Only check the limit switch for maximum extent.
 
frc2::CommandPtr MoveToPositionAbsolute (Distance_t position) override
 Start moving to the absolute position.
 
frc2::CommandPtr MoveToPositionRelative (Distance_t position) override
 Start moving to the position given the current distance and relative position.
 
frc2::CommandPtr Home () override
 Start the homing sequence.
 
frc2::CommandPtr ResetRelativeEncoder ()
 
frc::MechanismLigament2d * GetLigament ()
 
bool IsEnabled () override
 Check if absolute positioning is active.
 
void DisablePid () override
 Stop and disable any in-progress absolute movements.
 
void EnablePid () override
 Enable absolute movements.
 
void OnInit ()
 This must be called once upon robot startup.
 

Protected Attributes

units::meter_t m_armatureLength
 
- Protected Attributes inherited from subzero::BaseSingleAxisSubsystem< TController, units::degree >
std::optional< frc::DigitalInput * > m_minLimitSwitch
 
std::optional< frc::DigitalInput * > m_maxLimitSwitch
 
TController & m_controller
 
ISingleAxisSubsystem< units::degree >::SingleAxisConfig m_config
 
std::string m_name
 
Distance_t m_goalPosition
 
bool m_pidEnabled
 
bool m_home
 
bool resetOccurred
 
double m_latestSpeed
 
frc2::CommandPtr m_resetEncCmd
 
frc::MechanismLigament2d * m_ligament2d
 

Additional Inherited Members

- Public Types inherited from subzero::BaseSingleAxisSubsystem< TController, units::degree >
using PidState
 
using Distance_t
 
using Velocity
 
using Velocity_t
 
using Acceleration
 
using Acceleration_t
 
- Public Types inherited from subzero::ISingleAxisSubsystem< units::degree >
using Distance_t
 
using Velocity
 
using Velocity_t
 
using Acceleration
 
using Acceleration_t
 
- Protected Member Functions inherited from subzero::BaseSingleAxisSubsystem< TController, units::degree >
bool IsMovementAllowed (double speed, bool ignoreEncoder=false)
 
bool IsMovementAllowed (bool ignoreEncoder=false)
 

Detailed Description

template<typename TController>
class subzero::RotationalSingleAxisSubsystem< TController >

A single axis representing a circular path of motion in degrees.

Template Parameters
TControllerPidMotorController

Definition at line 15 of file RotationalSingleAxisSubsystem.h.

Constructor & Destructor Documentation

◆ RotationalSingleAxisSubsystem()

template<typename TController >
subzero::RotationalSingleAxisSubsystem< TController >::RotationalSingleAxisSubsystem ( std::string name,
TController & controller,
ISingleAxisSubsystem< units::degree >::SingleAxisConfig config,
units::meter_t armatureLength,
frc::MechanismObject2d * node = nullptr )
inline

Definition at line 18 of file RotationalSingleAxisSubsystem.h.

Member Function Documentation

◆ Periodic()

template<typename TController >
void subzero::RotationalSingleAxisSubsystem< TController >::Periodic ( )
override

◆ RunMotorVelocity()

template<typename TController >
void subzero::RotationalSingleAxisSubsystem< TController >::RunMotorVelocity ( units::degrees_per_second_t speed,
bool ignoreEncoder = false )
override

Member Data Documentation

◆ m_armatureLength

template<typename TController >
units::meter_t subzero::RotationalSingleAxisSubsystem< TController >::m_armatureLength
protected

Definition at line 32 of file RotationalSingleAxisSubsystem.h.


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