|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
Namespaces | |
| namespace | ballistics |
| namespace | odometry |
| namespace | transforms |
Classes | |
| class | Angle |
| class | Butterworth |
| struct | CMSISMat |
| class | DiscreteFilter |
| DiscreteFilter class implements a discrete-time filter using the finite difference equation. More... | |
| class | ExtendedKalman |
| class | FuzzyPD |
| struct | FuzzyPDConfig |
| Specifies Fuzzy-specific configurable parameters in the PD controller. More... | |
| class | FuzzyPDRuleTable |
| class | FuzzyRuleTableInterface |
| class | KalmanFilter |
| class | LinearInterpolationPredictor |
| class | LinearInterpolationPredictorWrapped |
| class | Ramp |
| class | SmoothPid |
| struct | SmoothPidConfig |
| class | WrappedFloat |
Enumerations | |
| enum | FilterType : uint8_t { LOWPASS = 0b00 , HIGHPASS = 0b01 , BANDPASS = 0b10 , BANDSTOP = 0b11 } |
Functions | |
| constexpr std::complex< double > | s2z (std::complex< double > s, double Ts) |
| template<uint8_t ORDER> | |
| constexpr std::array< double, ORDER+1 > | expandPolynomial (std::array< std::complex< double >, ORDER > zeros) |
| template<uint8_t ORDER> | |
| constexpr std::complex< double > | evaluateFrequencyResponse (const std::array< double, ORDER+1 > &b, const std::array< double, ORDER+1 > &a, double w, double Ts) |
| constexpr double | complex_abs (std::complex< double > z) |
| constexpr std::complex< double > | complex_sqrt (std::complex< double > z) |
| template<uint16_t A_ROWS, uint16_t A_COLS, uint16_t B_ROWS, uint16_t B_COLS> | |
| CMSISMat< A_ROWS, A_COLS > | operator+ (const CMSISMat< A_ROWS, A_COLS > &a, const CMSISMat< B_ROWS, B_COLS > &b) |
| template<uint16_t A_ROWS, uint16_t A_COLS, uint16_t B_ROWS, uint16_t B_COLS> | |
| CMSISMat< A_ROWS, A_COLS > | operator- (const CMSISMat< A_ROWS, A_COLS > &a, const CMSISMat< B_ROWS, B_COLS > &b) |
| template<uint16_t ROWS, uint16_t COLS> | |
| CMSISMat< ROWS, COLS > | operator- (const CMSISMat< ROWS, COLS > &a) |
| template<uint16_t A_ROWS, uint16_t A_COLS, uint16_t B_ROWS, uint16_t B_COLS> | |
| CMSISMat< A_ROWS, B_COLS > | operator* (const CMSISMat< A_ROWS, A_COLS > &a, const CMSISMat< B_ROWS, B_COLS > &b) |
| template<uint16_t ROWS, uint16_t COLS> | |
| CMSISMat< ROWS, COLS > | operator* (const CMSISMat< ROWS, COLS > &a, float b) |
| template<uint16_t ROWS, uint16_t COLS> | |
| CMSISMat< ROWS, COLS > | operator* (float b, const CMSISMat< ROWS, COLS > &a) |
| template<uint16_t ROWS, uint16_t COLS> | |
| CMSISMat< ROWS, COLS > | operator/ (const CMSISMat< ROWS, COLS > &a, float b) |
| uint8_t | calculateCRC8 (const uint8_t *message, uint32_t messageLength, uint8_t initCRC8) |
| uint16_t | calculateCRC16 (const uint8_t *message, uint32_t messageLength, uint16_t initCRC16) |
| float | computeGain (const array< float, FuzzyPDRuleTable::NUM_FUZZY_MEMBERS > &weights, const array< float, FuzzyPDRuleTable::NUM_FUZZY_MEMBERS > &values) |
| bool | compareFloatClose (float val1, float val2, float epsilon) |
| template<typename T > | |
| T | limitVal (T val, T min, T max) |
| float | lowPassFilter (float prevValue, float newValue, float alpha) |
| template<typename From , typename To > | |
| To | reinterpretCopy (From from) |
| float | fastInvSqrt (float x) |
| CMSISMat< 3, 1 > | cross (const CMSISMat< 3, 1 > &a, const CMSISMat< 3, 1 > &b) |
| CMSISMat< 3, 3 > | fromEulerAngles (const float roll, const float pitch, const float yaw) |
| void | rotateVector (float *x, float *y, float radians) |
| constexpr int32_t | ceil (float num) |
| modm::Vector3f | eulerAnglesFromQuaternion (modm::Quaternion< float > &q) |
| template<typename T > | |
| int | getSign (T val) |
| template<typename T , size_t xSize, size_t ySize> | |
| float | interpolateLinear2D (const std::array< std::array< T, ySize >, xSize > &values, const float xMin, const float xMax, const float dx, const float yMin, const float yMax, const float dy, float xDes, float yDes) |
| Bilinear Interpolation of a regularly-spaced grid of values. Let x = dimension 1 and y = dimension 2 of the 2D array of values. | |
Variables | |
| const uint8_t | CRC8Table [256] |
| const uint16_t | CRC16Table [256] |
| enum tap::algorithms::FilterType : uint8_t |
| uint16_t tap::algorithms::calculateCRC16 | ( | const uint8_t * | message, |
| uint32_t | messageLength, | ||
| uint16_t | initCRC16 = CRC16_INIT |
||
| ) |
Fast crc16 calculation using a lookup table.
| [in] | message | the message to be used for calculation. |
| [in] | messageLength | the number of bytes to look at when calculating the crc. |
| [in] | initCRC8 | normally leave as CRC8_INIT. |
| uint8_t tap::algorithms::calculateCRC8 | ( | const uint8_t * | message, |
| uint32_t | messageLength, | ||
| uint8_t | initCRC8 = CRC8_INIT |
||
| ) |
Fast crc8 calculation using a lookup table. The crc looks at messageLength bytes in the message to calculate the crc.
| [in] | message | the message to be used for calculation. |
| [in] | messageLength | the number of bytes to look at when calculating the crc. |
| [in] | initCRC8 | normally leave as CRC8_INIT. |
|
constexpr |
|
inline |
Use this instead of the == operator when asserting equality for floats. Performs
| [in] | val1 | the first value to compare. |
| [in] | val2 | the second value to compare. |
| [in] | epsilon | the floating point equality tolerance, for equality a recommended epsilon is 1E-6, though any small epsilon will do. |
|
constexpr |
used to calculate the magnitude of a complex number, created for constexpr useage
| [in] | z | the complex number to calculate the magnitude of |
|
constexpr |
used to calculate the square root of a complex number, created for constexpr useage
| [in] | z | the complex number to calculate the square root of |
|
inline |
Computes dot product of weights and values, in essence computing the weighted gain, a linear combination of the values
| tap::algorithms::CMSISMat< 3, 1 > tap::algorithms::cross | ( | const CMSISMat< 3, 1 > & | a, |
| const CMSISMat< 3, 1 > & | b | ||
| ) |
Compute the cross product of two 3x1 matrices
| modm::Vector3f tap::algorithms::eulerAnglesFromQuaternion | ( | modm::Quaternion< float > & | q | ) |
Returns <roll, pitch, yaw> decoded from q
|
constexpr |
used to evaluate the frequency response of a filter at a given frequency
| [in] | b | the numerator coefficients of the filter |
| [in] | a | the denominator coefficients of the filter |
| [in] | w | the frequency to evaluate at in rad/s |
| [in] | Ts | the sample time |
|
constexpr |
used to multiply out a series of zeros to obtain a list of coefficients
| [in] | zeros | a vector of complex poles or zeros to multiply out, works for any polynomial in the form of (x - z1)(x - z2)...(x - zn) where z1, z2, ... zn are the value of zeros. |
| float tap::algorithms::fastInvSqrt | ( | float | x | ) |
Fast inverse square-root, to calculate 1/Sqrt(x).
| [in] | input:x |
| 1/Sqrt(x) |
| tap::algorithms::CMSISMat< 3, 3 > tap::algorithms::fromEulerAngles | ( | const float | roll, |
| const float | pitch, | ||
| const float | yaw | ||
| ) |
Generates a 3x3 rotation matrix from euler angles (in radians)
| int tap::algorithms::getSign | ( | T | val | ) |
Returns the sign of the value passed in. Either -1, 0, or 1. Works for all base types and any types that implement construction from an int. Faster than copysign.
| float tap::algorithms::interpolateLinear2D | ( | const std::array< std::array< T, ySize >, xSize > & | values, |
| const float | xMin, | ||
| const float | xMax, | ||
| const float | dx, | ||
| const float | yMin, | ||
| const float | yMax, | ||
| const float | dy, | ||
| float | xDes, | ||
| float | yDes | ||
| ) |
Bilinear Interpolation of a regularly-spaced grid of values. Let x = dimension 1 and y = dimension 2 of the 2D array of values.
| values | 2D-array pointer of f(x,y) values |
|
inline |
Limits the value between some min an max (between [min, max]).
| T | the type you would like to limit. |
| [in] | val | the value to limit. |
| [in] | min | the min that val will be limited to. |
| [in] | max | the max that val will be limited to. |
|
inline |
A simple floating point low pass filter, e.g. 
Here is a simple use case. To use the low pass filter, pass in the val you are low passing in as the first parameter and have that value accept what lowPassFilter returns.
| [in] | prevValue | The previous low passed value. |
| [in] | newValue | The new data to be passed into the low pass filter. |
| [in] | alpha | The amount of smoothing. The larger the alpha, the less smoothing occurs. An alpha of 1 means that you want to favor the newValue and thus is not doing any filtering. Must be between [0, 1]. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| To tap::algorithms::reinterpretCopy | ( | From | from | ) |
| void tap::algorithms::rotateVector | ( | float * | x, |
| float * | y, | ||
| float | radians | ||
| ) |
Performs a rotation matrix on the given x and y components of a vector.
| x | the x component of the vector to be rotated. |
| y | the y component of the vector to be rotated. |
| angle | the angle by which to rotate the vector <x, y>, in radians. |
| none. |
|
constexpr |
used to transform poles from the laplace domain to the Z domain for discrete time using the bilinear transform
| [in] | s | a pole or zero from the laplace domain |
| [in] | Ts | the sample time |
| const uint16_t tap::algorithms::CRC16Table[256] |
| const uint8_t tap::algorithms::CRC8Table[256] |