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

Functions

units::degree_t NearestAngle (units::degree_t desiredAngle, units::degree_t referenceAngle)
 Finds closest angle alias of desiredAngle relative to referencedAngle. All inputs are normalized so ranges are unbounded.
 
units::degree_t InvertedAngle (units::degree_t desiredAngle, units::degree_t referenceAngle)
 Finds closest angle alias of a vector 180-degrees offset from desiredAngle relative to referencedAngle. All inputs are normalized so ranges are unbounded.
 
units::degree_t ConstrainAngle (units::degree_t inVal, units::degree_t minVal, units::degree_t maxVal)
 Normalize angle to specified range.
 
double ConstrainAngle (double inVal, double minVal, double maxVal)
 Normalize angle to specified range.
 

Function Documentation

◆ ConstrainAngle() [1/2]

double argos_lib::angle::ConstrainAngle ( double  inVal,
double  minVal,
double  maxVal 
)

Normalize angle to specified range.

Parameters
inValAngle to constrain (degrees)
minValNormalization lower bound (degrees)
maxValNormalization upper bound (degrees)
Returns
Normalized value in range [minVal, maxVal] (degrees)

◆ ConstrainAngle() [2/2]

units::degree_t argos_lib::angle::ConstrainAngle ( units::degree_t  inVal,
units::degree_t  minVal,
units::degree_t  maxVal 
)

Normalize angle to specified range.

Parameters
inValAngle to constrain
minValNormalization lower bound
maxValNormalization upper bound
Returns
Normalized value in range [minVal, maxVal]

◆ InvertedAngle()

units::degree_t argos_lib::angle::InvertedAngle ( units::degree_t  desiredAngle,
units::degree_t  referenceAngle 
)

Finds closest angle alias of a vector 180-degrees offset from desiredAngle relative to referencedAngle. All inputs are normalized so ranges are unbounded.

Parameters
desiredAngleAngle to find 180-degree offset alias for
referenceAngleDefines desired alias range
Returns
Offset angle alias of desiredAngle in range (referencedAngle - 180_deg, referencedAngle + 180_deg]

◆ NearestAngle()

units::degree_t argos_lib::angle::NearestAngle ( units::degree_t  desiredAngle,
units::degree_t  referenceAngle 
)

Finds closest angle alias of desiredAngle relative to referencedAngle. All inputs are normalized so ranges are unbounded.

Parameters
desiredAngleAngle to find alias for
referenceAngleDefines desired alias range
Returns
Angle alias of desiredAngle in range (referencedAngle - 180_deg, referencedAngle + 180_deg]