2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::cancoder_config Namespace Reference

Classes

struct  has_direction
 
struct  has_direction< T, decltype((void) T::direction, void())>
 
struct  has_initMode
 
struct  has_initMode< T, decltype((void) T::initMode, void())>
 
struct  has_magOffset
 
struct  has_magOffset< T, decltype((void) T::magOffset, void())>
 
struct  has_range
 
struct  has_range< T, decltype((void) T::range, void())>
 

Functions

template<typename T >
bool CanCoderConfig (CANCoder &encoder, units::millisecond_t configTimeout)
 Configures a CTRE CanCoder with only the fields provided. All other fields are given the factory default values.
 
template<typename CompetitionConfig , typename PracticeConfig >
bool CanCoderConfig (CANCoder &encoder, units::millisecond_t configTimeout, argos_lib::RobotInstance instance)
 Configures a CTRE CanCoder with configuration values according to specified robot instance.
 

Function Documentation

◆ CanCoderConfig() [1/2]

template<typename T >
bool argos_lib::cancoder_config::CanCoderConfig ( CANCoder &  encoder,
units::millisecond_t  configTimeout 
)

Configures a CTRE CanCoder with only the fields provided. All other fields are given the factory default values.

Template Parameters
TStructure containing any combination of the following members:
  • direction
  • initMode
  • magOffset
  • range
Parameters
encoderCANCoder object to configure
configTimeoutTime to wait for response from CANCoder
Returns
true Configuration succeeded
false Configuration failed

◆ CanCoderConfig() [2/2]

template<typename CompetitionConfig , typename PracticeConfig >
bool argos_lib::cancoder_config::CanCoderConfig ( CANCoder &  encoder,
units::millisecond_t  configTimeout,
argos_lib::RobotInstance  instance 
)

Configures a CTRE CanCoder with configuration values according to specified robot instance.

Template Parameters
CompetitionConfigConfigurations to use in competition robot instance
PracticeConfigConfigurations to use in practice robot instance
Parameters
encoderCANCoder object to configure
configTimeoutTime to wait for response from CANCoder
instanceRobot instance to use
Returns
true Configuration succeeded
false Configuration failed