concepts.math.interpolation_utils.SlerpSpline#

class SlerpSpline[source]#

Bases: SplineInterface

Slerp spline interpolation.

This class is a wrapper of scipy.interpolate.interp1d that mimics the CubicSpline interface.

Methods

derivative([n, x])

from_points(ys[, quat_format])

get_max_x()

get_min_x()

get_next(y, step_size[, minimum_x])

Get the next target point on a spline interpolation.

project_to(y[, minimum_x])

Project a point to a slerp spline interpolation.

__call__(x)[source]#

Call self as a function.

Parameters:

x (float)

Return type:

ndarray

__init__(xs, ys, quat_format='xyzw')[source]#
Parameters:
__new__(**kwargs)#
derivative(n=1, x=None)#
Parameters:
Return type:

SplineInterface | Tuple[SplineInterface, …]

classmethod from_points(ys, quat_format='xyzw')[source]#
Parameters:
Return type:

SlerpSpline

get_max_x()[source]#
Return type:

float

get_min_x()[source]#
Return type:

float

get_next(y, step_size, minimum_x=None)#

Get the next target point on a spline interpolation.

Parameters:
  • y (ndarray | Tuple[ndarray, ...]) – the current point.

  • step_size (float) – the step size.

  • minimum_x (float | None) – the minimum x value to be considered.

Returns:

the next x-value and the next target point.

Return type:

Tuple[float, ndarray | Tuple[ndarray, …]]

project_to(y, minimum_x=None)[source]#

Project a point to a slerp spline interpolation.

Parameters:
  • y (ndarray) – the point to be projected.

  • minimum_x (float | None) – the minimum x value to be considered.

Returns:

the time of the projected point.

Return type:

float