RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
rz::TrackingWheel Class Referencefinal

How far a wheel has rolled, from the encoder measuring it: an unpowered tracking wheel on a rotation sensor, or a drive wheel read through its motor's encoder (motor.encoder(), which already accounts for the cartridge). More...

#include <TrackingWheel.hpp>

Inheritance diagram for rz::TrackingWheel:
rz::Sensor< Length >

Public Member Functions

 TrackingWheel (Sensor< Angle > &encoder, Length diameter, GearRatio gears={})
bool connected () const override
Public Member Functions inherited from rz::Sensor< Length >
 Sensor ()=default
Sensor & operator= (const Sensor &)=delete
virtual ~Sensor ()=default
Length get ()
 The current reading. The last good value while disconnected.
Length delta ()
 Change since the previous snapshot (covers several ticks if nobody read in between).

Protected Member Functions

Length raw () const override
 This tick's reading from the source; the last good value while disconnected. May restart after a reconnect.
Protected Member Functions inherited from rz::Sensor< Length >
virtual std::uint32_t epoch () const
 Increments every time the source reconnects. Readings across a reconnect are not comparable.

Detailed Description

How far a wheel has rolled, from the encoder measuring it: an unpowered tracking wheel on a rotation sensor, or a drive wheel read through its motor's encoder (motor.encoder(), which already accounts for the cartridge).

Constructor & Destructor Documentation

◆ TrackingWheel()

rz::TrackingWheel::TrackingWheel ( Sensor< Angle > & encoder,
Length diameter,
GearRatio gears = {} )
inline
Parameters
gearsFrom the encoder's shaft (driving) to the wheel's (driven), e.g. {.driving = 36, .driven = 60} for a drive wheel geared down from its motor. Leave it out when the wheel is on the encoder's shaft.
Exceptions
std::invalid_argumentif a tooth count or the diameter is not positive.

Member Function Documentation

◆ connected()

bool rz::TrackingWheel::connected ( ) const
inlinenodiscardoverridevirtual

Implements rz::Sensor< Length >.

◆ raw()

Length rz::TrackingWheel::raw ( ) const
inlinenodiscardoverrideprotectedvirtual

This tick's reading from the source; the last good value while disconnected. May restart after a reconnect.

Implements rz::Sensor< Length >.


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