Function navtk::utils::linear_interpolate(const std::vector<double>&, const std::vector<double>&, const std::vector<double>&)

Function Documentation

std::pair<std::vector<Size>, std::vector<double>> navtk::utils::linear_interpolate(const std::vector<double> &time_source, const std::vector<double> &data_source, const std::vector<double> &time_interp)

Interpolates the source data and source time using the vector of interpolation times (as doubles).

If source data/time is not available to interpolate for a time_interp time tag, then, that time tag is unused. The unused index is reported to the user.

Parameters
  • time_source – the source time stamps to be interpolated

  • data_source – the source data to be interpolated

  • time_interp – the time stamps to interpolate the data

Returns

A pair, where the first element is vector of unused indexes from time_interp, and the second element is interpolated source data.