#include <odometry.hpp>
Definition at line 56 of file odometry.hpp.
◆ ~IOdometry()
| virtual libstp::odometry::IOdometry::~IOdometry |
( |
| ) |
|
|
virtualdefault |
◆ getAbsoluteHeading()
| virtual double libstp::odometry::IOdometry::getAbsoluteHeading |
( |
| ) |
const |
|
nodiscardpure virtual |
Get the absolute IMU heading that is unaffected by reset().
- Returns
- Heading in radians (CCW-positive). Stable across odometry resets.
◆ getActiveSource()
| virtual OdometrySource libstp::odometry::IOdometry::getActiveSource |
( |
| ) |
const |
|
inlinenodiscardvirtual |
Which source currently backs getPose()/getHeading()/etc.
Implementations that have no external reference (mock, sim) always report ::Internal. Implementations that support a secondary source may still report ::Internal here when that source is not preferred or not currently available.
- Returns
- Active odometry source.
Definition at line 163 of file odometry.hpp.
◆ getDistanceFromOrigin()
Get distance measurements from the origin (set by last reset)
- Returns
- Forward, lateral, and straight-line distances from origin
◆ getHeading()
| virtual double libstp::odometry::IOdometry::getHeading |
( |
| ) |
const |
|
nodiscardpure virtual |
Get current heading (yaw angle) in radians relative to origin orientation
- Returns
- Heading in radians, range [-π, π] 0 = facing initial forward direction positive = rotated CCW from initial negative = rotated CW from initial
◆ getHeadingError()
| virtual double libstp::odometry::IOdometry::getHeadingError |
( |
double | target_heading_rad | ) |
const |
|
nodiscardpure virtual |
Get heading error to reach a target heading
Computes the shortest angular path from current heading to target. Properly handles angle wraparound (e.g., from 170° to -170°).
- Parameters
-
| target_heading_rad | Target heading in radians |
- Returns
- Signed angular error in radians, range [-π, π]
- Positive: turn CCW to reach target
- Negative: turn CW to reach target
Use this as input to heading PID controllers.
◆ getInternalDistanceFromOrigin()
| virtual DistanceFromOrigin libstp::odometry::IOdometry::getInternalDistanceFromOrigin |
( |
| ) |
const |
|
inlinenodiscardvirtual |
Get distance-from-origin computed from the internal pose, regardless of which source is currently active.
- Returns
- Forward, lateral, and straight-line distances from origin (m).
Definition at line 239 of file odometry.hpp.
◆ getInternalHeading()
| virtual double libstp::odometry::IOdometry::getInternalHeading |
( |
| ) |
const |
|
inlinenodiscardvirtual |
Get the internal (on-board dead-reckoning) heading in radians, regardless of which source is currently active.
- Returns
- Internal heading in radians, range [-π, π].
Definition at line 229 of file odometry.hpp.
◆ getInternalPose()
Get the internal (on-board dead-reckoning) pose, regardless of which source is currently active.
When no external source exists this is identical to getPose(). On the wombat platform this always returns the cheap STM32 estimate even when the accurate calibration board is driving getPose() — letting callers read both side by side to tune the internal model against the external reference.
- Returns
- Internal planar pose in world coordinates (meters / radians).
Definition at line 219 of file odometry.hpp.
◆ getPathLength()
| virtual double libstp::odometry::IOdometry::getPathLength |
( |
| ) |
const |
|
nodiscardpure virtual |
Get the cumulative path length (odometer) in meters.
Monotonically increasing — NOT affected by reset(). Accumulates the Euclidean distance traveled each update cycle, regardless of direction (forward, strafe, curved).
- Returns
- Total distance traveled in meters since construction
◆ getPose()
Get the current pose estimate
- Returns
- Current planar pose expressed in world coordinates
◆ getPoseFromSource()
Read a specific source's pose directly, regardless of the preferred or active source.
This lets callers passively sample an alternate source (for example the external calibration board) to compare against the one currently driving the motion system, WITHOUT switching the preferred source — which would re-route the whole motion system and hard-reset the odometry frame. Use this for tuning/measurement; use setPreferredSource() only when the motion system should actually follow the other source.
Implementations with no external reference return getInternalPose() for any source.
- Parameters
-
- Returns
- Pose from that source in world coordinates (meters / radians).
Definition at line 186 of file odometry.hpp.
◆ getPreferredSource()
| virtual OdometrySource libstp::odometry::IOdometry::getPreferredSource |
( |
| ) |
const |
|
inlinenodiscardvirtual |
Get the caller-selected preferred source.
Implementations that do not support source switching always report ::Internal here.
- Returns
- Preferred odometry source.
Definition at line 148 of file odometry.hpp.
◆ isSourceAvailable()
| virtual bool libstp::odometry::IOdometry::isSourceAvailable |
( |
OdometrySource | source | ) |
const |
|
inlinenodiscardvirtual |
Whether a given source is currently connected and usable as a reference, independent of which source is preferred or active.
Implementations with no external reference report true only for ::Internal.
- Parameters
-
- Returns
- True if the source can currently be read.
Definition at line 202 of file odometry.hpp.
◆ reset()
| virtual void libstp::odometry::IOdometry::reset |
( |
| ) |
|
|
pure virtual |
Reset the odometry to origin (zero position, identity orientation)
◆ setPreferredSource()
| virtual void libstp::odometry::IOdometry::setPreferredSource |
( |
OdometrySource | source | ) |
|
|
inlinevirtual |
Select which source should back getPose()/getHeading()/etc. when available.
Implementations may fall back to ::Internal when the requested source is unavailable (for example when the calibration board is not connected). Callers can inspect getActiveSource() to see which source is actually in use right now.
- Parameters
-
| source | Preferred odometry source. |
Definition at line 135 of file odometry.hpp.
◆ update()
| virtual void libstp::odometry::IOdometry::update |
( |
double | dt | ) |
|
|
pure virtual |
Update the odometry estimate with the latest sensor data
- Parameters
-
| dt | Time delta since last update in seconds |
The documentation for this struct was generated from the following file:
- /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-hal/include/hal/odometry.hpp