Clear Filters
Clear Filters

Help Interpolating GPS coordinates with two different time stamps [Error in interp1 (line 161)]

4 views (last 30 days)
I am working with a LiDAR scanner and GPS module; they do not scan in sync. The LiDAR scans at a frequency far greater than the GPS unit. Currently, the GPS is recorded to one computer, and the LiDAR is recorded on another. Implying that the timestamps can be slightly out of time. This is a proof of concept at this stage, and at a later date, this will all run on one computer. The goal of this exercise is to interpolate the GPS data points to find the estimate position of the LiDAR scan location between the two known GPS data points.
The time stamps from both systems are converted to datnum()*24*60*60, thus converting the datum to seconds. The difficulty arrises when I attempt to interpolate the GPS data, as MATLAB returns an error of:
I have attempted this interpolation with different time arguments.
1. With no call of the LiDAR time argument. The function runs, but returns a vector of NaN.
2. Calling a single variable from the LiDAR_time matrix, ie LiDAR_TIME(500). I ran this call to ensure that the time value was inside the max&min values of the GPS_TIME(:,1).
3. Calling the GPS_TIME variable time as the third argument, implying that each data point overlaps with the interpolated data point. This was done to to see if it could be a problem with the LiDAR_Time containing max & min values outside the range of the GPS_TIME vector. This did not work either, and returned the same error.
Now I have three theories about what could be causing this error.
  • That the sensor data is being recorded to a high level of precision, and when the data is imported from the CSV file to Matlab, it is converted to a double precision number. Could this precision be placing data points on top of one another, due to rounding that Matlab has applied when importing data?
  • Am I forcing too many data points into the interp1 or spline functions? Would it be better if I broke the data up into segments and processed in in smaller quantities? IE 400 data points rather than 1200 data points.
  • The route traveled will be attached as a graph, is there a problem that I drove in a loop? Would the spline/ interp1 function return an error because of this?
Any Assistance would be greatly appreciated.
Please note: I have imported the data in through the use of Matlab's data import tool. Please see the importing screen shots below.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!