From 36ccdb364bec54157e083a5c8898bcc4283ee8e0 Mon Sep 17 00:00:00 2001 From: Alex Davies Date: Wed, 8 Nov 2023 06:45:11 -0800 Subject: [PATCH] Cleaned up code a bit --- ros_relay/scripts/relay.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/ros_relay/scripts/relay.py b/ros_relay/scripts/relay.py index 873f4c4..19097d8 100755 --- a/ros_relay/scripts/relay.py +++ b/ros_relay/scripts/relay.py @@ -10,26 +10,6 @@ import os rosbridge = roslibpy.Ros(host=os.environ['HOST'], port=int(os.environ['PORT'])) rosbridge.run() -def callback_battery(data): - print(data) - print("-------") - - -class GenericMessageSubscriber(object): - def __init__(self, topic_name, callback): - self._binary_sub = rospy.Subscriber( - topic_name, rospy.AnyMsg, self.generic_message_callback) - self._callback = callback - - def generic_message_callback(self, data): - connection_header = data._connection_header['type'].split('/') - ros_pkg = connection_header[0] + '.msg' - msg_type = connection_header[1] - msg_class = getattr(import_module(ros_pkg), msg_type) - msg = msg_class().deserialize(data._buff) - self._callback(msg) - - class GenericMessageRelay(object): def __init__(self, topic_name,topic_prefix=""): """topic_prefix is what we prefix the topic with