libstp
Robotics library for Botball
Loading...
Searching...
No Matches
libstp::motion::ArcMotion Class Referencefinal

#include <arc_motion.hpp>

Inheritance diagram for libstp::motion::ArcMotion:
[legend]
Collaboration diagram for libstp::motion::ArcMotion:
[legend]

Public Member Functions

 ArcMotion (MotionContext ctx, ArcMotionConfig 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
const std::vector< ArcMotionTelemetry > & getTelemetry () 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}

Detailed Description

Closed-loop controller for driving along a circular arc.

Uses a profiled PID on heading (like TurnMotion) and derives the forward velocity from the angular velocity command: vx = |omega| * radius. This produces coordinated acceleration/deceleration along the arc.

The max angular velocity is limited to ensure the derived forward velocity does not exceed the linear axis limits.

Definition at line 74 of file arc_motion.hpp.

Constructor & Destructor Documentation

◆ ArcMotion()

libstp::motion::ArcMotion::ArcMotion ( MotionContext ctx,
ArcMotionConfig config )

Member Function Documentation

◆ getFilteredVelocity()

double libstp::motion::ArcMotion::getFilteredVelocity ( ) const
inlinenodiscard

Current filtered angular velocity (rad/s).

Definition at line 98 of file arc_motion.hpp.

◆ getTelemetry()

const std::vector< ArcMotionTelemetry > & libstp::motion::ArcMotion::getTelemetry ( ) const
inlinenodiscard

Definition at line 100 of file arc_motion.hpp.

◆ hasReachedAngle()

bool libstp::motion::ArcMotion::hasReachedAngle ( ) const
nodiscard

Check if target arc angle is reached, ignoring velocity settling.

◆ isFinished()

bool libstp::motion::ArcMotion::isFinished ( ) const
nodiscardoverridevirtual

Return true once the primitive has met its completion criteria.

Implements libstp::motion::Motion.

◆ setSuppressHardStopOnComplete()

void libstp::motion::ArcMotion::setSuppressHardStopOnComplete ( bool suppress)
inline

When true, complete() sets finished_ without calling hardStop().

Definition at line 92 of file arc_motion.hpp.

◆ start()

void libstp::motion::ArcMotion::start ( )
overridevirtual

Capture initial state and prepare controller internals.

Implements libstp::motion::Motion.

◆ startWarm()

void libstp::motion::ArcMotion::startWarm ( double heading_offset_rad,
double initial_angular_velocity )

Begin arc from current state without resetting odometry.

Parameters
heading_offset_radCurrent heading (subtracted from reads)
initial_angular_velocityCurrent angular velocity to seed the profile with

◆ update()

void libstp::motion::ArcMotion::update ( double dt)
overridevirtual

Advance the controller by one iteration using the loop delta in seconds.

Implements libstp::motion::Motion.


The documentation for this class was generated from the following file:
  • /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-motion/include/motion/arc_motion.hpp