2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
|
Namespaces | |
namespace | angle |
namespace | cancoder_config |
namespace | colors |
namespace | falcon_config |
namespace | gamma_corrected_colors |
namespace | led |
namespace | status_frame_config |
namespace | swerve |
namespace | talonsrx_config |
namespace | testing |
namespace | triggers |
Classes | |
struct | ArgosColor |
class | ArgosLogger |
Log to the console in a clean, repeatable manner. More... | |
struct | CANAddress |
struct | ClosedLoopSensorConversions |
Conversion factors to aid displaying sensor values as meaningful numbers. More... | |
class | Debouncer |
struct | DebounceSettings |
class | EdgeDetector |
class | FSHomingStorage |
Saves and loads home positions from filesystem. More... | |
class | GenericDebouncer |
class | HomingStorageInterface |
Interface capable of saving and loading home positions from persistent storage. More... | |
class | HysteresisFilter |
A simple hysteresis filter for giving a bool output for a threshold. More... | |
struct | InterpMapPoint |
Point that helps generate an interpolation map. More... | |
class | InterpolationMap |
Performs linear interpolation of a value based on a set of input->output mapping points. More... | |
struct | LEDState |
Color and animation status for an individual LED. More... | |
class | LEDSubsystem |
class | NTMotorPIDTuner |
Allows user to set PID parameters from network tables and update the motor configurations on updates. Also monitors status information from motors to aid tuning. More... | |
class | NTSubscriber |
Subscribes to Network Tables entry updates and calls a specified callback to use the new value. More... | |
class | SwapControllersCommand |
Swaps rolls of two controllers. Useful if one controller breaks during a match. More... | |
class | SwappableControllersSubsystem |
Allows two controllers to swap between "Driver" and "Operator" control schemes on the fly by swapping the m_driverController and m_operatorController objects. More... | |
class | SwerveFSHomingStorage |
class | SwerveHomeStorageInterface |
Interface capable of saving and loading module home positions from persistent storage. More... | |
struct | VibrationStatus |
Vibration percentages that can be sent to controller for user feedback. More... | |
class | XboxController |
Typedefs | |
using | VibrationModel = std::function< VibrationStatus()> |
Enumerations | |
enum struct | RobotInstance { Competition , Practice } |
Differentiates between practice robot and competition robot. More... | |
enum | LogLevel { INFO , ERR } |
Represents a log level of either information, or error. More... | |
Functions | |
RobotInstance | GetRobotInstance () |
Detect robot instance. | |
static int | GetCANAddr (const argos_lib::CANAddress &compAddress, const argos_lib::CANAddress &practiceAddress, argos_lib::RobotInstance instance) |
Gets integer address from CANAddress objects based on robot instance. | |
static std::string_view | GetCANBus (const argos_lib::CANAddress &compAddress, const argos_lib::CANAddress &practiceAddress, argos_lib::RobotInstance instance) |
Gets std::string_view bus name from CANAddress objects based on robot instance. | |
VibrationModel | VibrationOff () |
Turn off vibration. | |
VibrationModel | VibrationConstant (double intensity) |
Set vibration to a constant value where left and right are the same intensity. | |
VibrationModel | VibrationConstant (double intensityLeft, double intensityRight) |
Set vibration to a constant value where left and right have discrete intensities. | |
VibrationModel | VibrationSyncPulse (units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0) |
Toggle vibration between intensityOn and intensityOff levels. Left and right have the same vibration intensity. | |
VibrationModel | VibrationSyncWave (units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0) |
Smoothly transition vibration between intensityOn and intensityOff levels. Left and right have the same vibration intensity. | |
VibrationModel | VibrationAlternatePulse (units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0) |
Toggle vibration between intensityOn and intensityOff levels. Left output is in intensityOn phase while right output is in intensityOff phase and vice-versa. | |
VibrationModel | VibrationAlternateWave (units::millisecond_t pulsePeriod, double intensityOn, double intensityOff=0.0) |
Smoothly transition vibration between intensityOn and intensityOff levels. Left output is in intensityOn phase while right output is in intensityOff phase and vice-versa. | |
VibrationModel | TemporaryVibrationPattern (VibrationModel temporaryModel, units::millisecond_t temporaryModelDuration, VibrationModel lastingModel=VibrationOff()) |
Run a vibration model for a specified duration, then run another model in perpetuity thereafter. | |
constexpr ArgosColor | GammaCorrect (ArgosColor original) |
template<typename T > | |
static constexpr bool | InThreshold (const T value, const T target, const T threshold) |
Detect if a value is within a threshold of a target value. | |
template<class T , class V > | |
constexpr bool | operator< (const InterpMapPoint< T, V > &a, const T &b) |
template<class T , class V > | |
constexpr bool | operator< (const T &a, const InterpMapPoint< T, V > &b) |
template<class Callable > | |
constexpr double | GetSensorConversionFactor (Callable toPhysicalUnitsFunction) |
Generates a double value to convert raw sensor values to physical units represented as a double. | |
Variables | |
constexpr std::array< uint8_t, 256 > | gamma8 |
using argos_lib::VibrationModel = typedef std::function<VibrationStatus()> |
enum argos_lib::LogLevel |
|
strong |
|
constexpr |
|
inlinestatic |
Gets integer address from CANAddress objects based on robot instance.
compAddress | The competiton robot CANAddress object |
practiceAddress | The practice robot CANAddress object |
instance | Current instance of robot |
|
inlinestatic |
Gets std::string_view bus name from CANAddress objects based on robot instance.
compAddress | The competiton robot CANAddress object |
practiceAddress | The practice robot CANAddress object |
instance | Current instance of robot |
argos_lib::RobotInstance argos_lib::GetRobotInstance | ( | ) |
Detect robot instance.
|
constexpr |
Generates a double value to convert raw sensor values to physical units represented as a double.
Callable | Function that generates a units value from a double |
toPhysicalUnitsFunction | Conversion function |
|
staticconstexpr |
Detect if a value is within a threshold of a target value.
T | Type that implements operator+(), operator-(), operator<=() and operator>=() |
value | Value to check |
target | Center of range |
threshold | Allowable error from target |
|
constexpr |
|
constexpr |
VibrationModel argos_lib::TemporaryVibrationPattern | ( | argos_lib::VibrationModel | temporaryModel, |
units::millisecond_t | temporaryModelDuration, | ||
argos_lib::VibrationModel | lastingModel = VibrationOff() |
||
) |
Run a vibration model for a specified duration, then run another model in perpetuity thereafter.
temporaryModel | Model to run for the specified duration |
temporaryModelDuration | Amount of time to run temporaryModel |
lastingModel | Model to run forever after the specified duration |
VibrationModel argos_lib::VibrationAlternatePulse | ( | units::millisecond_t | pulsePeriod, |
double | intensityOn, | ||
double | intensityOff = 0.0 |
||
) |
Toggle vibration between intensityOn and intensityOff levels. Left output is in intensityOn phase while right output is in intensityOff phase and vice-versa.
pulsePeriod | Time to complete one intensityOn->intensityOff cycle |
intensityOn | Vibration percent output when in intensityOn portion of cycle [0,1.0] |
intensityOff | Vibration percent output when in intensityOff portion of cycle [0,1.0] |
VibrationModel argos_lib::VibrationAlternateWave | ( | units::millisecond_t | pulsePeriod, |
double | intensityOn, | ||
double | intensityOff = 0.0 |
||
) |
Smoothly transition vibration between intensityOn and intensityOff levels. Left output is in intensityOn phase while right output is in intensityOff phase and vice-versa.
pulsePeriod | Time to complete one intensityOn->intensityOff cycle |
intensityOn | Vibration percent output when at peak of intensityOn portion of cycle [0,1.0] |
intensityOff | Vibration percent output when in trough of intensityOff portion of cycle [0,1.0] |
VibrationModel argos_lib::VibrationConstant | ( | double | intensity | ) |
Set vibration to a constant value where left and right are the same intensity.
intensity | Percent vibration output [0,1.0] |
VibrationModel argos_lib::VibrationConstant | ( | double | intensityLeft, |
double | intensityRight | ||
) |
Set vibration to a constant value where left and right have discrete intensities.
intensityLeft | Left vibration percent output [0,1.0] |
intensityRight | Right vibration percent output [0,1.0] |
VibrationModel argos_lib::VibrationOff | ( | ) |
Turn off vibration.
VibrationModel argos_lib::VibrationSyncPulse | ( | units::millisecond_t | pulsePeriod, |
double | intensityOn, | ||
double | intensityOff = 0.0 |
||
) |
Toggle vibration between intensityOn and intensityOff levels. Left and right have the same vibration intensity.
pulsePeriod | Time to complete one intensityOn->intensityOff cycle |
intensityOn | Vibration percent output when in intensityOn portion of cycle [0,1.0] |
intensityOff | Vibration percent output when in intensityOff portion of cycle [0,1.0] |
VibrationModel argos_lib::VibrationSyncWave | ( | units::millisecond_t | pulsePeriod, |
double | intensityOn, | ||
double | intensityOff = 0.0 |
||
) |
Smoothly transition vibration between intensityOn and intensityOff levels. Left and right have the same vibration intensity.
pulsePeriod | Time to complete one intensityOn->intensityOff cycle |
intensityOn | Vibration percent output when at peak of intensityOn portion of cycle [0,1.0] |
intensityOff | Vibration percent output when in trough of intensityOff portion of cycle [0,1.0] |
|
constexpr |