LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::OdomState Struct Reference

#include <odomState.hpp>

Public Member Functions

std::string str (QLength idistanceUnit, QAngle iangleUnit) const
 Get a string for the current odometry state (optionally with the specified units).
 
std::string str (QLength idistanceUnit=meter, std::string distUnitName="_m", QAngle iangleUnit=degree, std::string angleUnitName="_deg") const
 Get a string for the current odometry state (optionally with the specified units).
 
bool operator== (const OdomState &rhs) const
 
bool operator!= (const OdomState &rhs) const
 

Public Attributes

QLength x {0_m}
 
QLength y {0_m}
 
QAngle theta {0_deg}
 

Detailed Description

Definition at line 14 of file odomState.hpp.

Member Function Documentation

◆ operator!=()

bool okapi::OdomState::operator!= ( const OdomState rhs) const

◆ operator==()

bool okapi::OdomState::operator== ( const OdomState rhs) const

◆ str() [1/2]

std::string okapi::OdomState::str ( QLength  idistanceUnit,
QAngle  iangleUnit 
) const

Get a string for the current odometry state (optionally with the specified units).

Examples:

  • OdomState::str(1_m, 1_deg): The default (no arguments specified).
  • OdomState::str(1_tile, 1_radian): distance tiles and angle radians.

Throws std::domain_error if the units passed are undefined.

Parameters
idistanceUnitThe units you want your distance to be in. This must be an exact, predefined QLength (such as foot, meter, inch, tile etc.).
iangleUnitThe units you want your angle to be in. This must be an exact, predefined QAngle (degree or radian).
Returns
A string representing the state.

◆ str() [2/2]

std::string okapi::OdomState::str ( QLength  idistanceUnit = meter,
std::string  distUnitName = "_m",
QAngle  iangleUnit = degree,
std::string  angleUnitName = "_deg" 
) const

Get a string for the current odometry state (optionally with the specified units).

Examples:

  • OdomState::str(1_m, "_m", 1_deg, "_deg"): The default (no arguments specified), prints in meters and degrees.
  • OdomState::str(1_in, "_in", 1_deg, "_deg") or OdomState::str(1_in, "\"", 1_deg, "°"): to print values in inches and degrees with different suffixes.
  • OdomState::str(6_tile / 100, "%", 360_deg / 100, "%") to get the distance values in % of the vex field, and angle values in % of a full rotation.
Parameters
idistanceUnitThe units you want your distance to be in. The x or y position will be output in multiples of this length.
distUnitNameThe suffix you as your distance unit.
iangleUnitThe units you want your angle to be in. The angle will be output in multiples of this unit.
angleUnitNameThe suffix you want as your angle unit.
Returns
A string representing the state.

Member Data Documentation

◆ theta

QAngle okapi::OdomState::theta {0_deg}

Definition at line 17 of file odomState.hpp.

◆ x

QLength okapi::OdomState::x {0_m}

Definition at line 15 of file odomState.hpp.

◆ y

QLength okapi::OdomState::y {0_m}

Definition at line 16 of file odomState.hpp.


The documentation for this struct was generated from the following file: