SampledProperty requests


I have a couple requests for SampledProperty that I think could be useful to others as well. Or if these exist already and I have overlooked them, please let me know :wink:

1. Allow a getValue function that will return the closest actual sample instead of the interpolated value. The index is already retrieved internally form the binarySearch function, but it would be nice and simple to expose this function. Sometimes there are cases where you want to get an actual value and not an interpolated value even when in general you want the interpolated functionality.

2. Similarly, I would really like the ability to turn the interpolation on/off with a flag. So given a SampledProperty with many samples over a period of time, I can flip interpolation on/off with a button click or some other method. Maybe add an InterpolationType of None?

For 1 the ability to easily get actual sample data is on the roadmap and having a function to get the sample closest time sounds useful as well. For 2, Iā€™m not sure how this would work in practice. What is the actual goal, to debug the way points?

Hey Matthew, there are a couple different uses. For position/orientation, I would like to allow it just as a user preference - to show only the real known positions without the interpolated positions in between. Of course, the interpolation is much more appealing, but there may be cases where a user only wants to see the factual data, and may even want to toggle it on/off during the same viewing session. This would basically appear the same way it currently appears if you are adding real time samples but have extrapolation set to HOLD.

Other reasons this would be useful for me is I plan to use sampled properties to store additional time specific data other than the position. For example, I may have a numeric status code for a vehicle with each sample. However, if it has a status code of 1 in sample 1 and a status code of 10 at sample 2, it does not mean it has a linearly increasing status code between the two samples.

If I were looking to implement data over time I would want to be able to assign an interpolation calculation method for each datapoint separately.

I would want something like this for a property of my datapoint:

interpolationMethod =

none: no automatic adjustment to the value over time

linear: adjust the numeric value over time as though they are directly scaler

rounded: linear, but round the value to integer

floor: linear, but always remove decimal

ceil: linear, but always round up

custom: user provided callback returning the value at time(n)