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

#include <chassisScales.hpp>

Public Member Functions

 ChassisScales (const std::initializer_list< QLength > &idimensions, double itpr, const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
 The scales a ChassisController needs to do all of its closed-loop control.
 
 ChassisScales (const std::initializer_list< double > &iscales, double itpr, const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
 The scales a ChassisController needs to do all of its closed-loop control.
 

Public Attributes

QLength wheelDiameter
 
QLength wheelTrack
 
QLength middleWheelDistance
 
QLength middleWheelDiameter
 
double straight
 
double turn
 
double middle
 
double tpr
 

Static Protected Member Functions

static void validateInputSize (std::size_t inputSize, const std::shared_ptr< Logger > &logger)
 

Detailed Description

Definition at line 17 of file chassisScales.hpp.

Constructor & Destructor Documentation

◆ ChassisScales() [1/2]

okapi::ChassisScales::ChassisScales ( const std::initializer_list< QLength > &  idimensions,
double  itpr,
const std::shared_ptr< Logger > &  ilogger = Logger::getDefaultLogger() 
)

The scales a ChassisController needs to do all of its closed-loop control.

The first element is the wheel diameter, the second element is the wheel track. For three-encoder configurations, the length from the center of rotation to the middle wheel and the middle wheel diameter are passed as the third and fourth elements.

The wheel track is the center-to-center distance between the wheels (center-to-center meaning the width between the centers of both wheels). For example, if you are using four inch omni wheels and there are 11.5 inches between the centers of each wheel, you would call the constructor like so: ChassisScales scales({4_in, 11.5_in}, imev5GreenTPR); // imev5GreenTPR for a green gearset

                      Wheel diameter

                       +-+      Center of rotation
                       | |      |
                       v v      +----------+ Length to middle wheel
                                |          | from center of rotation
              +--->    ===      |      === |
              |         +       v       +  |
              |        ++---------------++ |
              |        |                 | v
Wheel track   |        |                 |
              |        |        x        |+|  <-- Middle wheel
              |        |                 |
              |        |                 |
              |        ++---------------++
              |         +               +
              +--->    ===             ===
Parameters
idimensions{wheel diameter, wheel track} or {wheel diameter, wheel track, length to middle wheel, middle wheel diameter}.
itprThe ticks per revolution of the encoders.
iloggerThe logger this instance will log to.

◆ ChassisScales() [2/2]

okapi::ChassisScales::ChassisScales ( const std::initializer_list< double > &  iscales,
double  itpr,
const std::shared_ptr< Logger > &  ilogger = Logger::getDefaultLogger() 
)

The scales a ChassisController needs to do all of its closed-loop control.

The first element is the straight scale, the second element is the turn scale. Optionally, the length from the center of rotation to the middle wheel and the middle scale can be passed as the third and fourth elements. The straight scale converts motor degrees to meters, the turn scale converts motor degrees to robot turn degrees, and the middle scale converts middle wheel degrees to meters.

Parameters
iscales{straight scale, turn scale} or {straight scale, turn scale, length to middle wheel in meters, middle scale}.
itprThe ticks per revolution of the encoders.
iloggerThe logger this instance will log to.

Member Function Documentation

◆ validateInputSize()

static void okapi::ChassisScales::validateInputSize ( std::size_t  inputSize,
const std::shared_ptr< Logger > &  logger 
)
staticprotected

Member Data Documentation

◆ middle

double okapi::ChassisScales::middle

Definition at line 82 of file chassisScales.hpp.

◆ middleWheelDiameter

QLength okapi::ChassisScales::middleWheelDiameter

Definition at line 79 of file chassisScales.hpp.

◆ middleWheelDistance

QLength okapi::ChassisScales::middleWheelDistance

Definition at line 78 of file chassisScales.hpp.

◆ straight

double okapi::ChassisScales::straight

Definition at line 80 of file chassisScales.hpp.

◆ tpr

double okapi::ChassisScales::tpr

Definition at line 83 of file chassisScales.hpp.

◆ turn

double okapi::ChassisScales::turn

Definition at line 81 of file chassisScales.hpp.

◆ wheelDiameter

QLength okapi::ChassisScales::wheelDiameter

Definition at line 76 of file chassisScales.hpp.

◆ wheelTrack

QLength okapi::ChassisScales::wheelTrack

Definition at line 77 of file chassisScales.hpp.


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