concepts.math.interpolation_utils.PoseSpline#

class PoseSpline[source]#

Bases: SplineInterface

Pose spline interpolation.

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

Methods

derivative([n, x])

from_points(y_pos, y_quat[, quat_format])

from_pose_sequence(pose_sequence[, 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 pose spline interpolation.

__call__(x)[source]#

Call self as a function.

Parameters:

x (float)

Return type:

Tuple[ndarray, ndarray]

__init__(xs, y_pos, y_quat, quat_format='xyzw', fixed_quat=None)[source]#

Initialize a pose spline interpolation.

Parameters:
  • xs (ndarray) – the time values.

  • y_pos (ndarray) – the position values.

  • y_quat (ndarray) – the quaternion values.

  • quat_format (str) – the quaternion format (‘xyzw’ or ‘wxyz’).

  • fixed_quat (bool | None) – whether the quaternion values are the same for all time steps.

__new__(**kwargs)#
derivative(n=1, x=None)#
Parameters:
Return type:

SplineInterface | Tuple[SplineInterface, …]

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

PoseSpline

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

PoseSpline

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 pose spline interpolation.

Parameters:
  • y (Tuple[ndarray, 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