copp.Profile3rd

Third-order path-speed profile.

Syntax

P = copp.Profile3rd(A, B)
P = ...Profile3rd(..., num_stationary=[NS0, NSF])

Description

A Profile3rd stores the two station profiles used by TOPP3/COPP3:

= \((ds/dt)^2\) \(b(k) = d^2s/dt^2\)

The stationary counters describe how many grid points at each end are treated as stationary by the third-order interpolation formulas. Solver outputs are copied into MATLAB-owned double column vectors of length N, so users do not manage native buffers or handles. A and B may be passed as row or column vectors, but obj.a and obj.b are always \(N \times 1\).

Input Arguments

a

Second-order node profile. Element a(k) stores the squared path speed \((ds/dt)^2\) at station s(k).

b

Interval or edge acceleration profile. For TOPP2 interpolation this is an (N-1)-by-1 column vector.

Name-Value Arguments

num_stationary

Stationary interval counts [start, end] of a third-order profile. Default: [0, 0]

Properties

a

Node profile a(s) = \((ds/dt)^2\) as an \(N \times 1\) double column vector.

b

Node profile b(s) = \(d^2s/dt^2\) as an \(N \times 1\) double column vector.

len

Number of station samples in a and b.

Methods

Profile3rd

Construct a MATLAB-owned third-order profile.

Method Details

Profile3rd

Syntax

P = copp.Profile3rd(A, B)
P = ...Profile3rd(..., num_stationary=[NS0, NSF])

copies real finite vectors A and B into \(N \times 1\) double column vectors. A and B may be \(1 \times N\) or \(N \times 1\), but they must have the same number of elements. A must be nonnegative because a(k) stores \((ds/dt)^2\).

stores the stationary-node metadata returned by TOPP3 solvers.

length

Syntax

value = length(obj)

force_positive_a

Syntax

[P, SUCCEEDED] = force_positive_a(P, S)
vector with numel(S) == P.len and at least four stations. The

Returns a copy of profile P whose a and b node values are adjusted so the third-order interpolated a(s) stays strictly positive on every interval of the station grid S. S must be a strictly increasing real finite vector with numel(S) == P.len and at least four stations. The returned object keeps the class of P, including solver-local Profile3rd aliases, and its num_stationary metadata.

SUCCEEDED is false when the adjustment failed for some interval. This is not an error, but other intervals may still have been adjusted, so keep using the original profile in that case. Invalid input raises copp:InvalidArgument: a length mismatch, fewer than four stations, negative a or a_min, non-finite values, non-increasing S, or stationary counts that leave no motion interval.

This is a numerical safety pass for profiles whose a values may touch zero because of finite precision, applied before s_to_t_topp3. It rewrites a and b without knowing the robot limits, so re-check the delivered profile with topp3">Robot.exceed_topp3 afterwards.

Name-value options: a_min: Nonnegative lower target for interpolated a. Defaults to 1e-12.

Examples

MATLAB
profile = copp.Profile3rd(ones(3,1), zeros(3,1), ...
num_stationary=[0, 0]);

See Also

copp