Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
tap::algorithms::odometry::Odometry2DTracker Class Reference

#include <odometry_2d_tracker.hpp>

Inheritance diagram for tap::algorithms::odometry::Odometry2DTracker:
Collaboration diagram for tap::algorithms::odometry::Odometry2DTracker:

Public Member Functions

 Odometry2DTracker (ChassisWorldYawObserverInterface *chassisYawObserver, ChassisDisplacementObserverInterface *chassisDisplacementObserver)
 
void update ()
 
modm::Location2D< float > getCurrentLocation2D () const final
 
modm::Vector2f getCurrentVelocity2D () const final
 
float getYaw () const final
 
uint32_t getLastComputedOdometryTime () const final
 
void overrideOdometryPosition (const float positionX, const float positionY)
 

Detailed Description

Class for tracking the 2D position of an object over time.

The faster update() is called the better.

Constructor & Destructor Documentation

◆ Odometry2DTracker()

tap::algorithms::odometry::Odometry2DTracker::Odometry2DTracker ( ChassisWorldYawObserverInterface chassisYawObserver,
ChassisDisplacementObserverInterface chassisDisplacementObserver 
)
inline
Parameters
[in]chassisYawObserverpointer to an object which implements the ChassisWorldYawObserverInterface. Should return the angle of the chassis forward vector relative to the x-axis of the field.
[in]chassisDisplacementObserverpointer to an object which implements the ChassisDisplacementObserverInterface. Used for getting the chassis displacement
Note
It is essential that the chassisYawObserver and chassisDisplacementObserver use the same positive z-axis. The getter interfaces should enforce that they they use positive z-axis is up, but it's worth noting here again.

Member Function Documentation

◆ getCurrentLocation2D()

modm::Location2D< float > tap::algorithms::odometry::Odometry2DTracker::getCurrentLocation2D ( ) const
inlinefinalvirtual

◆ getCurrentVelocity2D()

modm::Vector2f tap::algorithms::odometry::Odometry2DTracker::getCurrentVelocity2D ( ) const
inlinefinalvirtual
Returns
The current x and y velocity (in m/s).

Implements tap::algorithms::odometry::Odometry2DInterface.

◆ getLastComputedOdometryTime()

uint32_t tap::algorithms::odometry::Odometry2DTracker::getLastComputedOdometryTime ( ) const
inlinefinalvirtual
Returns
The last time that odometry was computed (in microseconds).

Implements tap::algorithms::odometry::Odometry2DInterface.

◆ getYaw()

float tap::algorithms::odometry::Odometry2DTracker::getYaw ( ) const
inlinefinalvirtual
Returns
The current yaw orientation of the chassis in the world frame in radians.

Implements tap::algorithms::odometry::Odometry2DInterface.

◆ overrideOdometryPosition()

void tap::algorithms::odometry::Odometry2DTracker::overrideOdometryPosition ( const float  positionX,
const float  positionY 
)
virtual

◆ update()

void tap::algorithms::odometry::Odometry2DTracker::update ( )

Run logic and update tracked chassis position. Call frequently for better results.

< Rotational velocity doesn't matter


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