bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::trajectory::TrapezoidalTimeScaling Class Reference

Accelerate at a constant rate, cruise at constant speed, and brake at the same rate: the speed over time is a trapezoid. More...

#include <time_scaling.h>

Inheritance diagram for bitsim::trajectory::TrapezoidalTimeScaling:
Collaboration diagram for bitsim::trajectory::TrapezoidalTimeScaling:

Public Member Functions

 TrapezoidalTimeScaling (real_t duration, real_t cruise_speed)
real_t s (real_t t) const override
 s(t); 0 before the start and 1 after the end
real_t ds (real_t t) const override
 \(\dot s(t)\) [1/s]
real_t dds (real_t t) const override
 \(\ddot s(t)\) [1/s^2]
real_t cruise_speed () const noexcept
real_t acceleration () const noexcept
real_t accel_time () const noexcept
Public Member Functions inherited from bitsim::trajectory::TimeScaling
virtual ~TimeScaling ()=default
real_t duration () const noexcept
 The duration T [s].

Static Public Member Functions

static TrapezoidalTimeScaling with_accel_share (real_t duration, real_t accel_share)
 The trapezoid that takes duration and spends a share of it, accel_share, in each of the speeding up and the slowing down. accel_share is in (0, 1/2].

Additional Inherited Members

Protected Member Functions inherited from bitsim::trajectory::TimeScaling
 TimeScaling (real_t duration)
real_t clamp_ (real_t t) const noexcept
Protected Attributes inherited from bitsim::trajectory::TimeScaling
real_t T_

Detailed Description

Accelerate at a constant rate, cruise at constant speed, and brake at the same rate: the speed over time is a trapezoid.

It is what motor controllers do when they are given a top speed and an acceleration. For a motion of duration T with a cruise speed of \(\dot s = v\) the acceleration lasts \(t_a = T - 1/v\), which needs \(1/T < v \le 2/T\); at \(v = 2/T\) there is no cruise, and the trapezoid becomes a triangle.

Constructor & Destructor Documentation

◆ TrapezoidalTimeScaling()

bitsim::trajectory::TrapezoidalTimeScaling::TrapezoidalTimeScaling ( real_t duration,
real_t cruise_speed )
Parameters
durationT [s]
cruise_speed\(v\), the speed of s while cruising [1/s], in \((1/T, 2/T]\)

Member Function Documentation

◆ accel_time()

real_t bitsim::trajectory::TrapezoidalTimeScaling::accel_time ( ) const
inlinenoexcept

◆ acceleration()

real_t bitsim::trajectory::TrapezoidalTimeScaling::acceleration ( ) const
inlinenoexcept

◆ cruise_speed()

real_t bitsim::trajectory::TrapezoidalTimeScaling::cruise_speed ( ) const
inlinenoexcept

◆ dds()

real_t bitsim::trajectory::TrapezoidalTimeScaling::dds ( real_t t) const
overridevirtual

\(\ddot s(t)\) [1/s^2]

Implements bitsim::trajectory::TimeScaling.

◆ ds()

real_t bitsim::trajectory::TrapezoidalTimeScaling::ds ( real_t t) const
overridevirtual

\(\dot s(t)\) [1/s]

Implements bitsim::trajectory::TimeScaling.

◆ s()

real_t bitsim::trajectory::TrapezoidalTimeScaling::s ( real_t t) const
overridevirtual

s(t); 0 before the start and 1 after the end

Implements bitsim::trajectory::TimeScaling.

◆ with_accel_share()

TrapezoidalTimeScaling bitsim::trajectory::TrapezoidalTimeScaling::with_accel_share ( real_t duration,
real_t accel_share )
static

The trapezoid that takes duration and spends a share of it, accel_share, in each of the speeding up and the slowing down. accel_share is in (0, 1/2].


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