10#include "ctre/Phoenix.h"
13 namespace cancoder_config {
36 ctre::phoenix::sensors::CANCoderConfiguration config;
37 auto timeout = configTimeout.to<
int>();
40 config.sensorDirection = T::direction;
43 config.initializationStrategy = T::initMode;
46 config.absoluteSensorRange = T::range;
49 config.magnetOffsetDegrees = T::magOffset;
52 encoder.ConfigFactoryDefault(timeout);
53 return ErrorCode::OKAY == encoder.ConfigAllSettings(config, timeout);
67 template <
typename CompetitionConfig,
typename PracticeConfig>
#define HAS_MEMBER(X)
Helper function generator to detect if a namespace has a member defined.
Definition compile_time_member_check.h:14
bool CanCoderConfig(CANCoder &encoder, units::millisecond_t configTimeout)
Configures a CTRE CanCoder with only the fields provided. All other fields are given the factory defa...
Definition cancoder_config.h:35
Definition swap_controllers_command.h:12
RobotInstance
Differentiates between practice robot and competition robot.
Definition config_types.h:13
@ Competition
Competition robot.
@ Practice
Practice robot.
Definition custom_units.h:11
Definition cancoder_config.h:15
Definition cancoder_config.h:16
Definition cancoder_config.h:17
Definition cancoder_config.h:18