emilib
Public Member Functions | List of all members
emilib::RotationTracker Class Reference

Made to take into account the cyclic nature of angles (in radians, btw) More...

#include <movement_tracker.hpp>

Inheritance diagram for emilib::RotationTracker:
emilib::MovementTracker< float >

Public Member Functions

virtual float velocity (double now) const override
 
- Public Member Functions inherited from emilib::MovementTracker< float >
void clear ()
 
void add (const float &pos, double time)
 
std::vector< float > points () const
 
bool empty () const
 
size_t size () const
 
double start_time () const
 
float start_pos () const
 
double latest_time () const
 
float latest_pos () const
 
float rel () const
 Last movement delta.
 
double duration () const
 
float velocity () const
 
bool is_still (F max_dist, double duration) const
 Has all movement been within "max_dist" radius, during the last "duration" seconds?
 
void flush (double now)
 Flush out oldes entries.
 

Additional Inherited Members

- Public Types inherited from emilib::MovementTracker< float >
using value_type = float
 
- Protected Types inherited from emilib::MovementTracker< float >
using TimePosList = std::deque< TimePosPair >
 
- Protected Member Functions inherited from emilib::MovementTracker< float >
bool velocity_calc_begin (size_t &out_index, double now) const
 From where shall we calculate velocity? Return false on "not at all".
 
- Static Protected Member Functions inherited from emilib::MovementTracker< float >
static constexpr size_t min_velocity_samples ()
 The minimum number of samples for there to be any velocity calculated.
 
static constexpr double min_velocity_time ()
 Minimum time before we have a good velocity.
 
static constexpr double velocity_time ()
 The time over which we calculate velocity.
 
- Protected Attributes inherited from emilib::MovementTracker< float >
bool _has_start
 
TimePosPair _start
 
TimePosList _list
 
double _max_history_time
 

Detailed Description

Made to take into account the cyclic nature of angles (in radians, btw)

Member Function Documentation

◆ velocity()

virtual float emilib::RotationTracker::velocity ( double  now) const
overridevirtual

Return T() on fail Calculates the average velocity over the last VelocityTime() seconds.

Reimplemented from emilib::MovementTracker< float >.


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