TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ISpeedSource Class Referenceabstract

Interface for speed sources. More...

#include <ISpeedSource.h>

Inheritance diagram for ISpeedSource:
Inheritance graph
[legend]

Public Member Functions

virtual Speed getSpeed (uint8_t motor=0) const =0
 Get the current speed.
 
virtual void setThrottlePercent (float value, uint8_t motor=0)=0
 Publish actual speed for a specific motor.
 
virtual Speed updateSpeed (uint32_t deltaTimeMs, uint8_t motor=0)=0
 For sources with inertia, call this in your main loop with the elapsed time (in milliseconds) to update the speed estimate for a specific motor.
 
virtual size_t getMotorCount () const =0
 

Detailed Description

Interface for speed sources.

Member Function Documentation

◆ getSpeed()

virtual Speed getSpeed ( uint8_t  motor = 0) const
pure virtual

Get the current speed.

Returns
Speed value (with units)

Implemented in SpeedFromThrottle, SpeedFromThrottleWithInertia, and WheelEncoder.

◆ setThrottlePercent()

virtual void setThrottlePercent ( float  value,
uint8_t  motor = 0 
)
pure virtual

Publish actual speed for a specific motor.

Implemented in SpeedFromThrottleWithInertia, SpeedFromThrottle, and WheelEncoder.

◆ updateSpeed()

virtual Speed updateSpeed ( uint32_t  deltaTimeMs,
uint8_t  motor = 0 
)
pure virtual

For sources with inertia, call this in your main loop with the elapsed time (in milliseconds) to update the speed estimate for a specific motor.

Implemented in SpeedFromThrottle, SpeedFromThrottleWithInertia, and WheelEncoder.


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