11import json
2+ from typing import Union
23
34import numpy as np
45
56import avstack
67
78from . import transformations as tforms
89from .base import q_mult_vec
9- from .refchoc import ReferenceDecoder , ReferenceFrame , Rotation , Vector
10+ from .refchoc import ReferenceDecoder , ReferenceFrame , PassiveReferenceFrame , Rotation , Vector
1011
1112
1213class VectorDecoder (json .JSONDecoder ):
@@ -70,7 +71,7 @@ def object_hook(json_object):
7071
7172
7273class Position (Vector ):
73- def _pull_from_reference (self , reference : ReferenceFrame ):
74+ def _pull_from_reference (self , reference : Union [ ReferenceFrame , PassiveReferenceFrame ] ):
7475 return reference .x
7576
7677 @property
@@ -83,7 +84,7 @@ def factory():
8384
8485
8586class Velocity (Vector ):
86- def _pull_from_reference (self , reference : ReferenceFrame ):
87+ def _pull_from_reference (self , reference : Union [ ReferenceFrame , PassiveReferenceFrame ] ):
8788 return reference .v
8889
8990 @staticmethod
@@ -92,7 +93,7 @@ def factory():
9293
9394
9495class Acceleration (Vector ):
95- def _pull_from_reference (self , reference : ReferenceFrame ):
96+ def _pull_from_reference (self , reference : Union [ ReferenceFrame , PassiveReferenceFrame ] ):
9697 return reference .acc
9798
9899 @staticmethod
@@ -101,7 +102,7 @@ def factory():
101102
102103
103104class Attitude (Rotation ):
104- def _pull_from_reference (self , reference : ReferenceFrame ):
105+ def _pull_from_reference (self , reference : Union [ ReferenceFrame , PassiveReferenceFrame ] ):
105106 return reference .q
106107
107108 @staticmethod
@@ -110,7 +111,7 @@ def factory():
110111
111112
112113class AngularVelocity (Rotation ):
113- def _pull_from_reference (self , reference : ReferenceFrame ):
114+ def _pull_from_reference (self , reference : Union [ ReferenceFrame , PassiveReferenceFrame ] ):
114115 return reference .ang
115116
116117 @staticmethod
0 commit comments