Main Page
Namespaces
Classes
Files
File List
File Members
sample
simple_image_transport.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
4
import
rospy
5
6
from
sensor_msgs.msg
import
Image
7
8
from
jsk_topic_tools
import
ConnectionBasedTransport
9
10
11
class
SimpleImageTransport
(ConnectionBasedTransport):
12
def
__init__
(self):
13
super(SimpleImageTransport, self).
__init__
()
14
self.
_pub
= self.advertise(
'~output'
, Image, queue_size=1)
15
16
def
subscribe
(self):
17
self.
sub_img
= rospy.Subscriber(
'~input'
, Image, self.
_process
)
18
19
def
unsubscribe
(self):
20
self.sub_img.unregister()
21
22
def
_process
(self, img_msg):
23
self._pub.publish(img_msg)
24
25
26
if
__name__ ==
'__main__'
:
27
rospy.init_node(
'sample_image_transport'
)
28
img_trans =
SimpleImageTransport
()
29
rospy.spin()
simple_image_transport.SimpleImageTransport._process
def _process(self, img_msg)
Definition:
simple_image_transport.py:22
simple_image_transport.SimpleImageTransport.sub_img
sub_img
Definition:
simple_image_transport.py:17
simple_image_transport.SimpleImageTransport._pub
_pub
Definition:
simple_image_transport.py:14
simple_image_transport.SimpleImageTransport.__init__
def __init__(self)
Definition:
simple_image_transport.py:12
simple_image_transport.SimpleImageTransport
Definition:
simple_image_transport.py:11
simple_image_transport.SimpleImageTransport.unsubscribe
def unsubscribe(self)
Definition:
simple_image_transport.py:19
simple_image_transport.SimpleImageTransport.subscribe
def subscribe(self)
Definition:
simple_image_transport.py:16
jsk_topic_tools
Author(s): Kei Okada
, Yusuke Furuta
autogenerated on Tue Feb 6 2018 03:45:19