Skip to content

Commit

Permalink
Adds latch functionality to topic_tools/transform (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
prarobo authored and mikepurvis committed Apr 23, 2018
1 parent d21a33c commit 5c7bcc0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/topic_tools/scripts/transform
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class TopicOp:
'--wait-for-start', action='store_true',
help='Wait for input messages.'
)
parser.add_argument(
'--latch', action='store_true',
help='Set publisher to latched.'
)

# get and strip out ros args first
argv = rospy.myargv()
Expand All @@ -84,7 +88,7 @@ class TopicOp:
self.output_class = roslib.message.get_message_class(args.output_type)

self.sub = rospy.Subscriber(input_topic, input_class, self.callback)
self.pub = rospy.Publisher(args.output_topic, self.output_class, queue_size=1)
self.pub = rospy.Publisher(args.output_topic, self.output_class, queue_size=1, latch=args.latch)

def callback(self, m):
if self.input_fn is not None:
Expand Down

0 comments on commit 5c7bcc0

Please sign in to comment.