SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig Struct Reference

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

#include <ISingleAxisSubsystem.h>

+ Collaboration diagram for subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig:

Public Member Functions

 SingleAxisConfig (Distance_t _minDistance, Distance_t _maxDistance, Distance_t _encoderDistancePerRevolution, std::optional< Distance_t > _absoluteEncoderDistancePerRevolution, Velocity_t _defaultSpeed, double _velocityScalar, Distance_t _tolerance, std::optional< frc::DigitalInput * > _minLimitSwitch, std::optional< frc::DigitalInput * > _maxLimitSwitch, bool _reversed, SingleAxisMechanism _mechanismConfig, std::optional< std::function< std::string(Distance_t)> > _conversionFunction, std::function< bool()> _ignoreLimit, frc::TrapezoidProfile< Distance >::Constraints _profileConstraints)
 

Public Attributes

Distance_t minDistance
 Minimum extent of motion.
 
Distance_t maxDistance
 Maximum extent of motion.
 
Distance_t encoderDistancePerRevolution
 
std::optional< Distance_tabsoluteEncoderDistancePerRevolution
 Similar to encoderDistancePerRevolution but using the absolute encoder.
 
Velocity_t defaultSpeed
 Default movement speed; used when homing.
 
double velocityScalar
 Multiply the motor output by this factor.
 
Distance_t tolerance
 Absolute positioning goal is reached within a range of +/- this value.
 
std::optional< frc::DigitalInput * > minLimitSwitch
 Optional. Will check for the limit switch being active when seeing if at limit.
 
std::optional< frc::DigitalInput * > maxLimitSwitch
 Optional. Will check for the limit switch being active when seeing if at limit.
 
bool reversed
 Motion is reversed if true; only used for simulations currently.
 
SingleAxisMechanism mechanismConfig
 Simulation configuration.
 
std::optional< std::function< std::string(Distance_t)> > conversionFunction
 Optional. Will be called on each loop; useful for outputting values to SmartDashboard in a different unit than the given one.
 
std::function< bool()> ignoreLimit
 If true, soft limits will be disabled.
 
frc::TrapezoidProfile< Distance >::Constraints profileConstraints
 Motion profile constraints.
 

Detailed Description

template<typename Distance>
struct subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig

The configuration for single-axis mechanisms.

Definition at line 50 of file ISingleAxisSubsystem.h.

Constructor & Destructor Documentation

◆ SingleAxisConfig()

template<typename Distance >
subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::SingleAxisConfig ( Distance_t _minDistance,
Distance_t _maxDistance,
Distance_t _encoderDistancePerRevolution,
std::optional< Distance_t > _absoluteEncoderDistancePerRevolution,
Velocity_t _defaultSpeed,
double _velocityScalar,
Distance_t _tolerance,
std::optional< frc::DigitalInput * > _minLimitSwitch,
std::optional< frc::DigitalInput * > _maxLimitSwitch,
bool _reversed,
SingleAxisMechanism _mechanismConfig,
std::optional< std::function< std::string(Distance_t)> > _conversionFunction,
std::function< bool()> _ignoreLimit,
frc::TrapezoidProfile< Distance >::Constraints _profileConstraints )
inline

Definition at line 129 of file ISingleAxisSubsystem.h.

Member Data Documentation

◆ absoluteEncoderDistancePerRevolution

template<typename Distance >
std::optional<Distance_t> subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::absoluteEncoderDistancePerRevolution

Similar to encoderDistancePerRevolution but using the absolute encoder.

Definition at line 73 of file ISingleAxisSubsystem.h.

◆ conversionFunction

template<typename Distance >
std::optional<std::function<std::string(Distance_t)> > subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::conversionFunction

Optional. Will be called on each loop; useful for outputting values to SmartDashboard in a different unit than the given one.

Definition at line 117 of file ISingleAxisSubsystem.h.

◆ defaultSpeed

template<typename Distance >
Velocity_t subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::defaultSpeed

Default movement speed; used when homing.

Definition at line 78 of file ISingleAxisSubsystem.h.

◆ encoderDistancePerRevolution

template<typename Distance >
Distance_t subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::encoderDistancePerRevolution

Definition at line 67 of file ISingleAxisSubsystem.h.

◆ ignoreLimit

template<typename Distance >
std::function<bool()> subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::ignoreLimit

If true, soft limits will be disabled.

Definition at line 122 of file ISingleAxisSubsystem.h.

◆ maxDistance

template<typename Distance >
Distance_t subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::maxDistance

Maximum extent of motion.

Definition at line 60 of file ISingleAxisSubsystem.h.

◆ maxLimitSwitch

template<typename Distance >
std::optional<frc::DigitalInput *> subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::maxLimitSwitch

Optional. Will check for the limit switch being active when seeing if at limit.

Definition at line 101 of file ISingleAxisSubsystem.h.

◆ mechanismConfig

template<typename Distance >
SingleAxisMechanism subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::mechanismConfig

Simulation configuration.

Definition at line 111 of file ISingleAxisSubsystem.h.

◆ minDistance

template<typename Distance >
Distance_t subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::minDistance

Minimum extent of motion.

Definition at line 55 of file ISingleAxisSubsystem.h.

◆ minLimitSwitch

template<typename Distance >
std::optional<frc::DigitalInput *> subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::minLimitSwitch

Optional. Will check for the limit switch being active when seeing if at limit.

Definition at line 95 of file ISingleAxisSubsystem.h.

◆ profileConstraints

template<typename Distance >
frc::TrapezoidProfile<Distance>::Constraints subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::profileConstraints

Motion profile constraints.

Definition at line 127 of file ISingleAxisSubsystem.h.

◆ reversed

template<typename Distance >
bool subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::reversed

Motion is reversed if true; only used for simulations currently.

Definition at line 106 of file ISingleAxisSubsystem.h.

◆ tolerance

template<typename Distance >
Distance_t subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::tolerance

Absolute positioning goal is reached within a range of +/- this value.

Definition at line 89 of file ISingleAxisSubsystem.h.

◆ velocityScalar

template<typename Distance >
double subzero::ISingleAxisSubsystem< Distance >::SingleAxisConfig::velocityScalar

Multiply the motor output by this factor.

Definition at line 83 of file ISingleAxisSubsystem.h.


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