|
libstp
Robotics library for Botball
|
#include <turn_motion.hpp>
Public Member Functions | |
| TurnMotion (MotionContext ctx, TurnConfig config) | |
| void | start () override |
| void | update (double dt) override |
| bool | isFinished () const override |
| void | startWarm (double heading_offset_rad, double initial_angular_velocity) |
| void | setSuppressHardStopOnComplete (bool suppress) |
| bool | hasReachedAngle () const |
| double | getFilteredVelocity () const |
| Public Member Functions inherited from libstp::motion::Motion | |
| Motion (MotionContext ctx) | |
| virtual | ~Motion ()=default |
Additional Inherited Members | |
| Protected Member Functions inherited from libstp::motion::Motion | |
| drive::Drive & | drive () |
| const drive::Drive & | drive () const |
| odometry::IOdometry & | odometry () |
| const odometry::IOdometry & | odometry () const |
| Protected Attributes inherited from libstp::motion::Motion | |
| MotionContext | ctx_ |
| bool | started_ {false} |
Profiled PID turn controller.
Uses a TrapezoidalProfile to generate smooth angular setpoints, then PID tracks those setpoints with velocity feedforward. Supports asymmetric acceleration/deceleration rates.
Definition at line 30 of file turn_motion.hpp.
| libstp::motion::TurnMotion::TurnMotion | ( | MotionContext | ctx, |
| TurnConfig | config ) |
|
inlinenodiscard |
Current filtered angular velocity (rad/s).
Definition at line 56 of file turn_motion.hpp.
|
nodiscard |
Check if target angle is reached, ignoring velocity settling.
|
nodiscardoverridevirtual |
Return true once the primitive has met its completion criteria.
Implements libstp::motion::Motion.
|
inline |
When true, complete() sets finished_ without calling hardStop().
Definition at line 50 of file turn_motion.hpp.
|
overridevirtual |
Capture initial state and prepare controller internals.
Implements libstp::motion::Motion.
| void libstp::motion::TurnMotion::startWarm | ( | double | heading_offset_rad, |
| double | initial_angular_velocity ) |
Begin turn from current state without resetting odometry.
Used by smooth_path() to carry angular velocity across segment boundaries.
| heading_offset_rad | Current accumulated heading (subtracted from reads) |
| initial_angular_velocity | Current angular velocity to seed the profile with |
|
overridevirtual |
Advance the controller by one iteration using the loop delta in seconds.
Implements libstp::motion::Motion.