def test_surreal(self): """Read from a Surreal json file.""" # Expected pose. expected_pose = Pose3(t=Vector3(1, 2, 3)) # Read json file path_to_json_linear = os.path.join(PATH, 'pose3_test.json') data = json.load(open(path_to_json_linear)) pose = Pose3.from_surreal(data['T_cr']) # Test pose pose.assert_almost_equal(expected_pose)
def test_surreal_coding(self): """Test conversion to/from surreal-style json dict.""" json_dict = self.pose.to_surreal() decoded_pose = Pose3.from_surreal(json_dict) decoded_pose.assert_almost_equal(self.pose)