Template Function ouster::sdk::core::interp_pose(const std::vector<T>&, const std::vector<T>&, const std::vector<Matrix4dR>&)

Function Documentation

template<typename T>
std::vector<Matrix4dR> ouster::sdk::core::interp_pose(const std::vector<T> &x_interp, const std::vector<T> &x_known, const std::vector<Matrix4dR> &poses_known)

One-dimensional linear interpolation for monotonically increasing sample transformation matrices.

This function performs linear interpolation on a set of monotonically increasing and non-repeated x-coordinate values and their corresponding 4x4 pose matrices. It evaluates the interpolated poses at the specified x-coordinate values provided in x_interp.

Note

If x_interp contains values outside the range of x_known, the function uses the first two and last two poses to extrapolate accordingly.

Note

x_interp must be sorted in ascending order otherwise, it will throw std::invalid_argument.

Parameters:
  • x_interp[in] A vector of x-coordinate values at which to compute the interpolated transformation matrices.

  • x_known[in] A vector of x-coordinate values corresponding to the known transformation matrices. Must be monotonically increasing and not repeated.

  • poses_known[in] A vector of 4x4 transformation matrices associated with each x-coordinate value in x_known.

Throws:

std::invalid_argument – if the sizes of x_known and poses_known do not match, if their sizes are less than 2, or if x_known is not monotonically increasing or if x_interp is not monotonically increasing.

Returns:

A vector of 4x4 transformation matrices representing the interpolated poses at x-coordinate values given by x_interp.