Skip to content
Browse files

duration parameter for draw_bounding_box

  • Loading branch information...
1 parent 4d0be00 commit 47602dd270d969440dd142147645d1fcaadb51be @lorenzoriano lorenzoriano committed Sep 4, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 tabletop_actions/src/tabletop_actions/object_detector.py
View
13 tabletop_actions/src/tabletop_actions/object_detector.py
@@ -836,7 +836,17 @@ def point_head_at(self, mover, box_msg = None,
mover.point_head_to(position, frame)
return True
- def draw_bounding_box(self, id, box_msg, color = (1.0, 1.0, 0.0, 0.0)):
+ def draw_bounding_box(self, id, box_msg, color = (1.0, 1.0, 0.0, 0.0),
+ duration = 0.0):
+ """
+ Draws a bounding box as detectd by detect_bounding_box.
+
+ Parameters:
+ box_msg is a FindClusterBoundingBoxResponse msg.
+ color: a quadruple with alpha, r,g,b
+ duration: how long should the bounding box last. 0 means forever.
+ """
+
marker = Marker()
marker.header.stamp = rospy.Time.now()
marker.ns = "object_detector"
@@ -854,6 +864,7 @@ def draw_bounding_box(self, id, box_msg, color = (1.0, 1.0, 0.0, 0.0)):
marker.color.r = color[1]
marker.color.g = color[2]
marker.color.b = color[3]
+ marker.lifetime = rospy.Duration(duration)
self.box_drawer.publish(marker)

0 comments on commit 47602dd

Please sign in to comment.
Something went wrong with that request. Please try again.