Skip to content
Snippets Groups Projects
Unverified Commit 37077467 authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

Fixed rotation/angular velocity interpolation (#482)

parent e898629c
No related branches found
No related tags found
No related merge requests found
......@@ -268,8 +268,8 @@ class TimeDependentRotation:
# Determine interpolation intervals for input times
av_idx = np.searchsorted(self.times, vec_times)
rot_idx = av_idx - 1
rot_idx[rot_idx < 0] = 0
rot_idx = av_idx
rot_idx[rot_idx > len(self.times) - 1] = len(self.times) - 1
# Interpolate/extrapolate rotations
time_diffs = vec_times - self.times[rot_idx]
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -470,14 +470,14 @@ def usgscsm_compare_dict():
-404.65806593586274
],
[
3509.6584138034805,
-1143.4324359444547,
-502.6029463187759
3509.658413803481,
-1143.4324359444558,
-502.60294631877633
],
[
3509.443153282348,
-1124.8866548757137,
-551.4851113671583
-551.4851113671589
]
],
"Velocities": [
......@@ -487,14 +487,14 @@ def usgscsm_compare_dict():
-3.987265079143158
],
[
0.00039300972273872503,
1.5024971608516042,
-3.9781429683723304
0.0003930097236827663,
1.5024971609204454,
-3.978142968522354
],
[
-0.03540185319107661,
1.5140837760075843,
-3.9728346759699815
-0.03540185319249475,
1.5140837760766446,
-3.9728346761198696
]
]
},
......@@ -507,16 +507,16 @@ def usgscsm_compare_dict():
],
"Positions": [
[
97397666.49661352,
-201380879.84291452,
-94392949.82617083
99139014.8191443,
-200427816.19676697,
-94608347.50413091
]
],
"Velocities": [
[
21.26085734409839,
7.173393107736484,
2.739595059792977
21.199131882686167,
7.334313602125272,
2.7913538260189816
]
]
}
......
......@@ -61,7 +61,7 @@ def test_time_dependent_time_dependent_composition():
assert rot1_3.source == 1
assert rot1_3.dest == 3
expected_times = [0, 1, 2]
expected_quats = [[0, 0, 0, -1], [-1, 0, 0, 0], [0, 0, 0, 1]]
expected_quats = [[0, 0, 0, -1], [1, 0, 0, 0], [0, 0, 0, -1]]
expected_av = [[np.pi, 0, 0], [np.pi, 0, 0], [np.pi, 0, 0]]
np.testing.assert_equal(rot1_3.times, expected_times)
np.testing.assert_almost_equal(rot1_3.quats, expected_quats)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment