Skip to content

Commit 8928e77

Browse files
author
Shushman Choudhury
committed
For transforms relative to links
1 parent 8649654 commit 8928e77

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/prpy/perception/apriltags.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
class ApriltagsModule(PerceptionModule):
3838

3939
def __init__(self, marker_topic, marker_data_path, kinbody_path,
40-
detection_frame, destination_frame):
40+
detection_frame, destination_frame,reference_link,):
4141
"""
4242
This initializes an April Tags detector.
4343
@@ -55,6 +55,7 @@ def __init__(self, marker_topic, marker_data_path, kinbody_path,
5555
self.kinbody_path = kinbody_path
5656
self.detection_frame = detection_frame
5757
self.destination_frame = destination_frame
58+
self.reference_link = reference_link
5859

5960

6061
def __str__(self):
@@ -63,7 +64,7 @@ def __str__(self):
6364

6465
def _DetectObjects(self, env, marker_topic=None, marker_data_path=None,
6566
kinbody_path=None, detection_frame=None,
66-
destination_frame=None, **kw_args):
67+
destination_frame=None, reference_link=None,**kw_args):
6768
"""
6869
Use the apriltags service to detect objects and add them to the
6970
environment. Params are as in __init__.
@@ -88,14 +89,16 @@ def _DetectObjects(self, env, marker_topic=None, marker_data_path=None,
8889

8990
if kinbody_path is None:
9091
kinbody_path = self.kinbody_path
91-
9292

9393
if detection_frame is None:
9494
detection_frame = self.detection_frame
9595

9696
if destination_frame is None:
9797
destination_frame = self.destination_frame
9898

99+
if reference_link is None:
100+
reference_link = self.reference_link
101+
99102
# TODO: Creating detector is not instant...might want
100103
# to just do this once in the constructor
101104
import kinbody_detector.kinbody_detector as kd
@@ -104,7 +107,8 @@ def _DetectObjects(self, env, marker_topic=None, marker_data_path=None,
104107
kinbody_path,
105108
marker_topic,
106109
detection_frame,
107-
destination_frame)
110+
destination_frame,
111+
reference_link)
108112

109113
logger.warn('Waiting to detect objects...')
110114
return detector.Update()

0 commit comments

Comments
 (0)