Class with basic utility methods.
More...
#include <ctre/phoenix/Utilities.h>
|
| static float | abs (float f) |
| | Calculates absolute value of f. More...
|
| |
| static float | bound (float value, float capValue=1) |
| | Caps the value. More...
|
| |
| static float | cap (float value, float peak) |
| | Caps the value. More...
|
| |
| static void | Deadband (float &value, float deadband=-.10f) |
| | Deadbands the value. More...
|
| |
| static bool | IsWithin (float value, float compareTo, float allowDelta) |
| | Calculates if value is within a delta. More...
|
| |
| static int | SmallerOf (int value_1, int value_2) |
| | Gets the minimum of the two values. More...
|
| |
| static void | Split_1 (float forward, float turn, float *left, float *right) |
| | Converts forward and turn to left and right speeds. More...
|
| |
| static void | Split_2 (float left, float right, float *forward, float *turn) |
| | Converts left and right to forward and turn speeds. More...
|
| |
Class with basic utility methods.
◆ abs()
| static float ctre::phoenix::Utilities::abs |
( |
float |
f | ) |
|
|
static |
Calculates absolute value of f.
- Parameters
-
| f | value to calculate absolute value of |
- Returns
- absolute value of f
◆ bound()
| static float ctre::phoenix::Utilities::bound |
( |
float |
value, |
|
|
float |
capValue = 1 |
|
) |
| |
|
static |
Caps the value.
- Parameters
-
| value | Value to cap |
| capValue | Maximum/-Minimum value can be |
- Returns
- Capped value
◆ cap()
| static float ctre::phoenix::Utilities::cap |
( |
float |
value, |
|
|
float |
peak |
|
) |
| |
|
static |
Caps the value.
- Parameters
-
| value | Value to cap |
| peak | Maximum/-Minimum value can be |
- Returns
- Capped value
◆ Deadband()
| static void ctre::phoenix::Utilities::Deadband |
( |
float & |
value, |
|
|
float |
deadband = -.10f |
|
) |
| |
|
static |
Deadbands the value.
- Parameters
-
| value | reference of value to deadband |
| deadband | If abs of value is under this, it will be brought to 0 |
◆ IsWithin()
| static bool ctre::phoenix::Utilities::IsWithin |
( |
float |
value, |
|
|
float |
compareTo, |
|
|
float |
allowDelta |
|
) |
| |
|
static |
Calculates if value is within a delta.
- Parameters
-
| value | initial value to compare |
| compareTo | value to compare against first value |
| allowDelta | the range value can be away from compareTo |
- Returns
- true if value is within allowDelta range of compareTo
◆ SmallerOf()
| static int ctre::phoenix::Utilities::SmallerOf |
( |
int |
value_1, |
|
|
int |
value_2 |
|
) |
| |
|
static |
Gets the minimum of the two values.
- Parameters
-
| value_1 | first value |
| value_2 | second value |
- Returns
- minimum value
◆ Split_1()
| static void ctre::phoenix::Utilities::Split_1 |
( |
float |
forward, |
|
|
float |
turn, |
|
|
float * |
left, |
|
|
float * |
right |
|
) |
| |
|
static |
Converts forward and turn to left and right speeds.
- Parameters
-
| forward | forward value of robot |
| turn | turn value of robot |
| left | Pointer to the left speed of robot, this will be filled |
| right | Pointer to the right speed of robot, this will be filled |
◆ Split_2()
| static void ctre::phoenix::Utilities::Split_2 |
( |
float |
left, |
|
|
float |
right, |
|
|
float * |
forward, |
|
|
float * |
turn |
|
) |
| |
|
static |
Converts left and right to forward and turn speeds.
- Parameters
-
| left | left speed of robot |
| right | right speed of robot |
| forward | Pointer to the forward speed of the robot, this will be filled |
| turn | Pointer to the turn speed of the robot, this will be filled |
The documentation for this class was generated from the following file: