Toppra Class Reference

Time-optimal reparametrization under per-motor torque and command-ramp limits. More...

#include <armarx/navigation/algorithms/parametrization/Toppra.h>

+ Inheritance diagram for Toppra:

Classes

struct  DriveParams
 Everything the python side needs that does not change between paths. More...
 
class  Impl
 
struct  MecanumGeometry
 ARMAR-6's and ARMAR-DE's four-wheel drive, following VirtualRobot::MecanumPlatformKinematics. More...
 
struct  OmniWheelGeometry
 ARMAR-7's three-wheel drive, in the units VirtualRobot::OmniWheelPlatformKinematics uses: mm for the radii, rad for the angles. More...
 

Public Types

enum class  DriveType { OmniWheel , Mecanum }
 Which drive the platform has. More...
 
enum  SampleColumn {
  T = 0 , X = 1 , Y = 2 , YAW = 3 ,
  VELOCITY = 4 , ANGULAR_VELOCITY = 5 , TANGENTIAL_ACCELERATION = 6 , ANGULAR_ACCELERATION = 7 ,
  SAMPLE_COLUMN_COUNT = 8
}
 Column layout of lastSamples(). More...
 

Public Member Functions

void apply (core::GlobalTrajectory &trajectory, float startVelocity) const override
 Re-assign the velocities of trajectory in place.
 
double lastDuration () const
 Duration [s] of the profile behind lastSamples(). Zero until apply() has run.
 
const Eigen::MatrixXd & lastSamples () const
 The time-parametrized profile from the most recent apply(), (M, 8).
 
 Toppra (const core::GeneralConfig &config, const DriveParams &drive)
 
 ~Toppra () override
 
- Public Member Functions inherited from TrajectoryParametrization
virtual ~TrajectoryParametrization ()=default
 

Static Public Member Functions

static bool available ()
 Whether the python side was found at configure time. False means apply() throws.
 
static std::string unavailableReason ()
 Why it is unavailable, as recorded at configure time. Empty when available.
 

Detailed Description

Time-optimal reparametrization under per-motor torque and command-ramp limits.

Delegates to armarx_navigation.reparametrization through an embedded Python interpreter. The robot model and the wheel Jacobian are loaded once, when this object is constructed; each apply() then exchanges two arrays with it and nothing else.

The header is deliberately not guarded by the build-time availability macro, so the class exists whether or not the python side was found. When it was not, the constructor succeeds and apply() throws with the reason recorded at configure time – that keeps the factory free of preprocessor branches.

Note
Called once per global path segment, not per control cycle. The solve takes on the order of a second and holds the GIL; do not move it onto a control path.

Definition at line 51 of file Toppra.h.

Member Enumeration Documentation

◆ DriveType

enum class DriveType
strong

Which drive the platform has.

Selects how the geometry below is read, and is not inferable from the geometry itself – a mecanum robot simply leaves the omni-wheel fields at zero, which would otherwise reach the solver as a degenerate Jacobian.

Enumerator
OmniWheel 
Mecanum 

Definition at line 72 of file Toppra.h.

◆ SampleColumn

Column layout of lastSamples().

Mirrors SampleColumn in the python package, which is the single source of truth for the array boundary.

Enumerator
YAW 
VELOCITY 
ANGULAR_VELOCITY 
TANGENTIAL_ACCELERATION 
ANGULAR_ACCELERATION 
SAMPLE_COLUMN_COUNT 

Definition at line 56 of file Toppra.h.

Constructor & Destructor Documentation

◆ Toppra()

Toppra ( const core::GeneralConfig & config,
const DriveParams & drive )

Definition at line 362 of file Toppra.cpp.

◆ ~Toppra()

~Toppra ( )
overridedefault

Member Function Documentation

◆ apply()

void apply ( core::GlobalTrajectory & trajectory,
float startVelocity ) const
overridevirtual

Re-assign the velocities of trajectory in place.

Parameters
startVelocitySpeed the robot already carries [mm/s]. The caller passes the measured platform speed when picking a trajectory up mid-motion, and GeneralConfig::boundaryVelocity when starting from rest.
Exceptions
std::runtime_errorif the implementation is unavailable in this build.

Implements TrajectoryParametrization.

Definition at line 401 of file Toppra.cpp.

+ Here is the call graph for this function:

◆ available()

bool available ( )
static

Whether the python side was found at configure time. False means apply() throws.

Definition at line 217 of file Toppra.cpp.

◆ lastDuration()

double lastDuration ( ) const

Duration [s] of the profile behind lastSamples(). Zero until apply() has run.

Definition at line 357 of file Toppra.cpp.

◆ lastSamples()

const Eigen::MatrixXd & lastSamples ( ) const

The time-parametrized profile from the most recent apply(), (M, 8).

Introspection only – for plots and offline analysis, never for control. apply() hands back a GlobalTrajectory, which stores a speed per position, so the time axis TOPP-RA computed is lost the moment the result is converted. This keeps it.

Empty until apply() has run; overwritten by each call. Columns are SampleColumn.

Definition at line 351 of file Toppra.cpp.

+ Here is the caller graph for this function:

◆ unavailableReason()

std::string unavailableReason ( )
static

Why it is unavailable, as recorded at configure time. Empty when available.

Definition at line 227 of file Toppra.cpp.

+ Here is the caller graph for this function:

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