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: ...@@ -268,8 +268,8 @@ class TimeDependentRotation:
# Determine interpolation intervals for input times # Determine interpolation intervals for input times
av_idx = np.searchsorted(self.times, vec_times) av_idx = np.searchsorted(self.times, vec_times)
rot_idx = av_idx - 1 rot_idx = av_idx
rot_idx[rot_idx < 0] = 0 rot_idx[rot_idx > len(self.times) - 1] = len(self.times) - 1
# Interpolate/extrapolate rotations # Interpolate/extrapolate rotations
time_diffs = vec_times - self.times[rot_idx] time_diffs = vec_times - self.times[rot_idx]
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -470,14 +470,14 @@ def usgscsm_compare_dict(): ...@@ -470,14 +470,14 @@ def usgscsm_compare_dict():
-404.65806593586274 -404.65806593586274
], ],
[ [
3509.6584138034805, 3509.658413803481,
-1143.4324359444547, -1143.4324359444558,
-502.6029463187759 -502.60294631877633
], ],
[ [
3509.443153282348, 3509.443153282348,
-1124.8866548757137, -1124.8866548757137,
-551.4851113671583 -551.4851113671589
] ]
], ],
"Velocities": [ "Velocities": [
...@@ -487,14 +487,14 @@ def usgscsm_compare_dict(): ...@@ -487,14 +487,14 @@ def usgscsm_compare_dict():
-3.987265079143158 -3.987265079143158
], ],
[ [
0.00039300972273872503, 0.0003930097236827663,
1.5024971608516042, 1.5024971609204454,
-3.9781429683723304 -3.978142968522354
], ],
[ [
-0.03540185319107661, -0.03540185319249475,
1.5140837760075843, 1.5140837760766446,
-3.9728346759699815 -3.9728346761198696
] ]
] ]
}, },
...@@ -507,16 +507,16 @@ def usgscsm_compare_dict(): ...@@ -507,16 +507,16 @@ def usgscsm_compare_dict():
], ],
"Positions": [ "Positions": [
[ [
97397666.49661352, 99139014.8191443,
-201380879.84291452, -200427816.19676697,
-94392949.82617083 -94608347.50413091
] ]
], ],
"Velocities": [ "Velocities": [
[ [
21.26085734409839, 21.199131882686167,
7.173393107736484, 7.334313602125272,
2.739595059792977 2.7913538260189816
] ]
] ]
} }
......
...@@ -61,7 +61,7 @@ def test_time_dependent_time_dependent_composition(): ...@@ -61,7 +61,7 @@ def test_time_dependent_time_dependent_composition():
assert rot1_3.source == 1 assert rot1_3.source == 1
assert rot1_3.dest == 3 assert rot1_3.dest == 3
expected_times = [0, 1, 2] 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]] 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_equal(rot1_3.times, expected_times)
np.testing.assert_almost_equal(rot1_3.quats, expected_quats) 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