![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
Tracks the robot's pose on the field from its sensors. More...
#include <Odometry.hpp>
Public Member Functions | |
| const Pose & | pose () const noexcept |
| void | setPose (const Pose &pose) noexcept |
| Sets where the robot is now, e.g. its starting position at the start of autonomous. distance() is unchanged. | |
| Sensor< Rotation > & | heading () noexcept |
| The heading on the field (the pose's rotation), counterclockwise positive. | |
| Sensor< Length > & | distance () noexcept |
| How far the robot has driven along its own forward axis in total; driving backward counts down. | |
| Public Member Functions inherited from rz::Component | |
| Component (const Component &)=delete | |
| Component & | operator= (const Component &)=delete |
| Component (Component &&)=delete | |
| Component & | operator= (Component &&)=delete |
| virtual | ~Component () |
| std::string_view | name () const noexcept |
| Used in log and error messages. | |
Protected Member Functions | |
| Odometry (std::string_view name) | |
| virtual Twist | displacement ()=0 |
| How the robot moved in its own frame since the previous tick. | |
| Protected Member Functions inherited from rz::Component | |
| Component (std::string_view name) | |
Additional Inherited Members | |
| Static Public Member Functions inherited from rz::Component | |
| static Task | runAll () |
| Runs the loop of every component constructed so far, in construction order, until cancelled. rz::robot runs it; tests without rz::robot run it alongside their script. | |
Tracks the robot's pose on the field from its sensors.
Runs at sensorsUpdated(), so everything waiting for estimatorsUpdated() sees this tick's pose. Each tick the subclass measures how the robot moved in its own frame (x forward, y left, counterclockwise positive), and that is applied along a constant-curvature arc.
Wheels are distance sensors, usually TrackingWheels: a wheel that rolls forward counts up when the robot drives forward, and one that rolls sideways counts up when it moves left.
Besides the pose, it provides its heading and the distance driven as sensors, for controllers that only need one of them (a turn needs the heading, driving a distance needs the distance).
|
inlineexplicitprotected |
|
nodiscardprotectedpure virtual |
How the robot moved in its own frame since the previous tick.
Implemented in rz::ThreeEncoderOdometry, rz::TwoEncoderImuOdometry, and rz::TwoEncoderOdometry.
How far the robot has driven along its own forward axis in total; driving backward counts down.
The heading on the field (the pose's rotation), counterclockwise positive.
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
Sets where the robot is now, e.g. its starting position at the start of autonomous. distance() is unchanged.