37
37
class ApriltagsModule (PerceptionModule ):
38
38
39
39
def __init__ (self , marker_topic , marker_data_path , kinbody_path ,
40
- detection_frame , destination_frame ):
40
+ detection_frame , destination_frame , reference_link , ):
41
41
"""
42
42
This initializes an April Tags detector.
43
43
@@ -55,6 +55,7 @@ def __init__(self, marker_topic, marker_data_path, kinbody_path,
55
55
self .kinbody_path = kinbody_path
56
56
self .detection_frame = detection_frame
57
57
self .destination_frame = destination_frame
58
+ self .reference_link = reference_link
58
59
59
60
60
61
def __str__ (self ):
@@ -63,7 +64,7 @@ def __str__(self):
63
64
64
65
def _DetectObjects (self , env , marker_topic = None , marker_data_path = None ,
65
66
kinbody_path = None , detection_frame = None ,
66
- destination_frame = None , ** kw_args ):
67
+ destination_frame = None , reference_link = None , ** kw_args ):
67
68
"""
68
69
Use the apriltags service to detect objects and add them to the
69
70
environment. Params are as in __init__.
@@ -88,14 +89,16 @@ def _DetectObjects(self, env, marker_topic=None, marker_data_path=None,
88
89
89
90
if kinbody_path is None :
90
91
kinbody_path = self .kinbody_path
91
-
92
92
93
93
if detection_frame is None :
94
94
detection_frame = self .detection_frame
95
95
96
96
if destination_frame is None :
97
97
destination_frame = self .destination_frame
98
98
99
+ if reference_link is None :
100
+ reference_link = self .reference_link
101
+
99
102
# TODO: Creating detector is not instant...might want
100
103
# to just do this once in the constructor
101
104
import kinbody_detector .kinbody_detector as kd
@@ -104,7 +107,8 @@ def _DetectObjects(self, env, marker_topic=None, marker_data_path=None,
104
107
kinbody_path ,
105
108
marker_topic ,
106
109
detection_frame ,
107
- destination_frame )
110
+ destination_frame ,
111
+ reference_link )
108
112
109
113
logger .warn ('Waiting to detect objects...' )
110
114
return detector .Update ()
0 commit comments