Matching¶
matching ¶
match_non_overlapping_stamps ¶
match_non_overlapping_stamps(
trajectory: Trajectory,
other: Trajectory,
max_distance: float = 0.0,
) -> float
Roughly matches two trajectories.
Parameters:
-
trajectory(Trajectory) –Trajectory to match.
-
other(Trajectory) –Other trajectory to match against.
-
max_distance(float, default:0.0) –Maximum distance for spatial matching. Defaults to 0.0.
Returns:
-
float(float) –Mean offset.
Source code in trajectopy\processing\matching.py
match_stamps ¶
match_stamps(
trajectory: Trajectory,
index: ndarray,
inplace: bool = True,
) -> Trajectory
Truncates trajectory to only those poses where the indices exactly match "index".
Parameters:
-
trajectory(Trajectory) –Input trajectory.
-
index(ndarray) –Input indices.
-
inplace(bool, default:True) –Perform matching in-place. Defaults to True.
Returns:
-
Trajectory(Trajectory) –Trajectory with matched indices.
Source code in trajectopy\processing\matching.py
match_trajectories ¶
match_trajectories(
trajectory: Trajectory,
other: Trajectory,
matching_settings: MatchingSettings | None = None,
inplace: bool = True,
) -> tuple[Trajectory, Trajectory]
Matches two trajectories using the specified method.
Supported methods:
- INTERPOLATION: Interpolates the test trajectory onto the reference trajectory using its timestamps. The interpolation is linear for both positions and rotations (SLERP).
- NEAREST_TEMPORAL: Finds the nearest temporal match without interpolation by finding the nearest timestamp in the target trajectory for each timestamp in the source trajectory.
- NEAREST_SPATIAL: Finds the nearest spatial match without interpolation by finding the nearest pose in the target trajectory for each pose in the source trajectory using Euclidean distance.
- NEAREST_SPATIAL_INTERPOLATED: Finds the nearest k spatial matches and spatially interpolates using a 3d line. Both trajectories will have the length of the test trajectory. This method does not support rotation matching.
Parameters:
-
trajectory(Trajectory) –Trajectory to match.
-
other(Trajectory) –Other trajectory to match against.
-
matching_settings(MatchingSettings, default:None) –Matching settings. Defaults to MatchingSettings().
-
inplace(bool, default:True) –Whether to modify the input trajectories. Defaults to True.
Returns:
-
tuple[Trajectory, Trajectory]–Tuple[Trajectory, Trajectory]: Matched trajectories.
Source code in trajectopy\processing\matching.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |