|
libstp
Robotics library for Botball
|
#include <motion.hpp>
Public Member Functions | |
| Motion (MotionContext ctx) | |
| virtual | ~Motion ()=default |
| virtual void | start ()=0 |
| virtual void | update (double dt)=0 |
| virtual bool | isFinished () const =0 |
Protected Member Functions | |
| drive::Drive & | drive () |
| const drive::Drive & | drive () const |
| odometry::IOdometry & | odometry () |
| const odometry::IOdometry & | odometry () const |
Protected Attributes | |
| MotionContext | ctx_ |
| bool | started_ {false} |
Base interface for stateful motion primitives.
Concrete motions follow a simple lifecycle:
Callers are responsible for invoking update(dt) at a stable cadence.
Definition at line 32 of file motion.hpp.
|
inlineexplicit |
Definition at line 35 of file motion.hpp.
|
virtualdefault |
|
inlinenodiscardprotected |
Definition at line 46 of file motion.hpp.
|
inlinenodiscardprotected |
Definition at line 47 of file motion.hpp.
|
nodiscardpure virtual |
Return true once the primitive has met its completion criteria.
Implemented in libstp::motion::ArcMotion, libstp::motion::DiagonalMotion, libstp::motion::DirectionalLineFollowMotion, libstp::motion::LinearMotion, libstp::motion::SplineMotion, and libstp::motion::TurnMotion.
|
inlinenodiscardprotected |
Definition at line 48 of file motion.hpp.
|
inlinenodiscardprotected |
Definition at line 49 of file motion.hpp.
|
pure virtual |
Capture initial state and prepare controller internals.
Implemented in libstp::motion::ArcMotion, libstp::motion::DiagonalMotion, libstp::motion::DirectionalLineFollowMotion, libstp::motion::LinearMotion, libstp::motion::SplineMotion, and libstp::motion::TurnMotion.
|
pure virtual |
Advance the controller by one iteration using the loop delta in seconds.
Implemented in libstp::motion::ArcMotion, libstp::motion::DiagonalMotion, libstp::motion::DirectionalLineFollowMotion, libstp::motion::LinearMotion, libstp::motion::SplineMotion, and libstp::motion::TurnMotion.
|
protected |
Definition at line 51 of file motion.hpp.
|
protected |
Definition at line 52 of file motion.hpp.