#include <velMath.hpp>
|
| | VelMath (double iticksPerRev, std::unique_ptr< Filter > ifilter, QTime isampleTime, std::unique_ptr< AbstractTimer > iloopDtTimer, std::shared_ptr< Logger > ilogger=Logger::getDefaultLogger()) |
| | Velocity math helper.
|
| |
| virtual | ~VelMath () |
| |
| virtual QAngularSpeed | step (double inewPos) |
| | Calculates the current velocity and acceleration.
|
| |
| virtual void | setTicksPerRev (double iTPR) |
| | Sets ticks per revolution (or whatever units you are using).
|
| |
| virtual QAngularSpeed | getVelocity () const |
| |
| virtual QAngularAcceleration | getAccel () const |
| |
Definition at line 17 of file velMath.hpp.
◆ VelMath()
Velocity math helper.
Calculates filtered velocity. Throws a std::invalid_argument exception if iticksPerRev is zero.
- Parameters
-
| iticksPerRev | The number of ticks per revolution (or whatever units you are using). |
| ifilter | The filter used for filtering the calculated velocity. |
| isampleTime | The minimum time between velocity measurements. |
| ilogger | The logger this instance will log to. |
◆ ~VelMath()
| virtual okapi::VelMath::~VelMath |
( |
| ) |
|
|
virtual |
◆ getAccel()
| virtual QAngularAcceleration okapi::VelMath::getAccel |
( |
| ) |
const |
|
virtual |
- Returns
- The last calculated acceleration.
◆ getVelocity()
| virtual QAngularSpeed okapi::VelMath::getVelocity |
( |
| ) |
const |
|
virtual |
- Returns
- The last calculated velocity.
◆ setTicksPerRev()
| virtual void okapi::VelMath::setTicksPerRev |
( |
double |
iTPR | ) |
|
|
virtual |
Sets ticks per revolution (or whatever units you are using).
Throws a std::invalid_argument exception if iticksPerRev is zero.
- Parameters
-
| iTPR | The number of ticks per revolution. |
◆ step()
| virtual QAngularSpeed okapi::VelMath::step |
( |
double |
inewPos | ) |
|
|
virtual |
Calculates the current velocity and acceleration.
Returns the (filtered) velocity.
- Parameters
-
| inewPos | The new position measurement. |
- Returns
- The new velocity estimate.
◆ accel
| QAngularAcceleration okapi::VelMath::accel {0.0} |
|
protected |
◆ filter
| std::unique_ptr<Filter> okapi::VelMath::filter |
|
protected |
◆ lastPos
| double okapi::VelMath::lastPos {0} |
|
protected |
◆ lastVel
| QAngularSpeed okapi::VelMath::lastVel {0_rpm} |
|
protected |
◆ logger
| std::shared_ptr<Logger> okapi::VelMath::logger |
|
protected |
◆ loopDtTimer
◆ sampleTime
| QTime okapi::VelMath::sampleTime |
|
protected |
◆ ticksPerRev
| double okapi::VelMath::ticksPerRev |
|
protected |
◆ vel
| QAngularSpeed okapi::VelMath::vel {0_rpm} |
|
protected |
The documentation for this class was generated from the following file: