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

#include <threeEncoderOdometry.hpp>

Inheritance diagram for okapi::ThreeEncoderOdometry:
okapi::TwoEncoderOdometry okapi::Odometry

Public Member Functions

 ThreeEncoderOdometry (const TimeUtil &itimeUtil, const std::shared_ptr< ReadOnlyChassisModel > &imodel, const ChassisScales &ichassisScales, const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
 Odometry.
 
- Public Member Functions inherited from okapi::TwoEncoderOdometry
 TwoEncoderOdometry (const TimeUtil &itimeUtil, const std::shared_ptr< ReadOnlyChassisModel > &imodel, const ChassisScales &ichassisScales, const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
 TwoEncoderOdometry.
 
virtual ~TwoEncoderOdometry ()=default
 
void setScales (const ChassisScales &ichassisScales) override
 Sets the drive and turn scales.
 
void step () override
 Do one odometry step.
 
OdomState getState (const StateMode &imode=StateMode::FRAME_TRANSFORMATION) const override
 Returns the current state.
 
void setState (const OdomState &istate, const StateMode &imode=StateMode::FRAME_TRANSFORMATION) override
 Sets a new state to be the current state.
 
std::shared_ptr< ReadOnlyChassisModelgetModel () override
 
ChassisScales getScales () override
 
- Public Member Functions inherited from okapi::Odometry
 Odometry ()=default
 Odometry.
 
virtual ~Odometry ()=default
 

Protected Member Functions

OdomState odomMathStep (const std::valarray< std::int32_t > &itickDiff, const QTime &ideltaT) override
 Does the math, side-effect free, for one odom step.
 

Additional Inherited Members

- Protected Attributes inherited from okapi::TwoEncoderOdometry
std::shared_ptr< Loggerlogger
 
std::unique_ptr< AbstractRaterate
 
std::unique_ptr< AbstractTimertimer
 
std::shared_ptr< ReadOnlyChassisModelmodel
 
ChassisScales chassisScales
 
OdomState state
 
std::valarray< std::int32_t > newTicks {0, 0, 0}
 
std::valarray< std::int32_t > tickDiff {0, 0, 0}
 
std::valarray< std::int32_t > lastTicks {0, 0, 0}
 
const std::int32_t maximumTickDiff {1000}
 

Detailed Description

Definition at line 14 of file threeEncoderOdometry.hpp.

Constructor & Destructor Documentation

◆ ThreeEncoderOdometry()

okapi::ThreeEncoderOdometry::ThreeEncoderOdometry ( const TimeUtil itimeUtil,
const std::shared_ptr< ReadOnlyChassisModel > &  imodel,
const ChassisScales ichassisScales,
const std::shared_ptr< Logger > &  ilogger = Logger::getDefaultLogger() 
)

Odometry.

Tracks the movement of the robot and estimates its position in coordinates relative to the start (assumed to be (0, 0)).

Parameters
itimeUtilThe TimeUtil.
imodelThe chassis model for reading sensors.
ichassisScalesSee ChassisScales docs (the middle wheel scale is the third member)
iwheelVelDeltaThe maximum delta between wheel velocities to consider the robot as driving straight.
iloggerThe logger this instance will log to.

Member Function Documentation

◆ odomMathStep()

OdomState okapi::ThreeEncoderOdometry::odomMathStep ( const std::valarray< std::int32_t > &  itickDiff,
const QTime &  ideltaT 
)
overrideprotectedvirtual

Does the math, side-effect free, for one odom step.

Parameters
itickDiffThe tick difference from the previous step to this step.
ideltaTThe time difference from the previous step to this step.
Returns
The newly computed OdomState.

Reimplemented from okapi::TwoEncoderOdometry.


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