Skip to content

Commit 77d03d8

Browse files
committed
Fix topic specification.
Signed-off-by: Chris Lalancette <[email protected]>
1 parent ecffc52 commit 77d03d8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

image_tools_py/cam2image_py.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def main(args=None):
126126

127127
# Create the image publisher with our custom QoS profile.
128128
pub = node.create_publisher(
129-
sensor_msgs.msg.Image, 'image',
129+
sensor_msgs.msg.Image, args.topic,
130130
qos_profile=custom_camera_qos_profile)
131131

132132
is_flipped = False

image_tools_py/showimage_py.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ def main(args=None):
6565
parser.add_argument(
6666
'-s', '--show', dest='show_camera', action='store', default=1, type=int, choices=[0, 1],
6767
help='Show the camera stream')
68+
parser.add_argument(
69+
'-t', '--topic', dest='topic', action='store', default='image', type=str,
70+
help='use topic TOPIC instead of the default')
6871
args = parser.parse_args()
6972

7073
if args.show_camera == 1:
@@ -113,7 +116,7 @@ def image_cb(msg):
113116
cv2.waitKey(1)
114117

115118
node.create_subscription(
116-
sensor_msgs.msg.Image, 'image', image_cb, qos_profile=custom_qos_profile)
119+
sensor_msgs.msg.Image, args.topic, image_cb, qos_profile=custom_qos_profile)
117120

118121
while rclpy.ok():
119122
rclpy.spin_once(node)

0 commit comments

Comments
 (0)