navlie.utils.common.state_interp¶
- navlie.utils.common.state_interp(query_stamps: float | List[float] | Any, state_list: List[State], method='linear') → State | List[State]¶
Performs “linear” (geodesic) interpolation between
State
objects. Multiple interpolations can be performed at once in a vectorized fashion. If the query point is out of bounds, the end points are returned...code-block:: python
x_data = [SE3State.random(stamp=i) for i in range(10)] x_query = [0.2, 0.5, 10] x_interp = state_interp(x_query, x_data)
- Parameters:
query_stamps (float or object with
.stamp
attribute (or Lists thereof)) – Query stamps. Can either be a float, or an object containing astamp
attribute. If a list is provided, it will be treated as multiple query points and the return value will be a list ofState
objects.state_list (List[State]) – List of
State
objects to interpolate between.
- Returns:
The interpolated state(s).
- Return type:
State
or List[State
]- Raises:
TypeError – If query point is not a float or object with a
stamp
attribute.