Go to the documentation of this file.00001
00002 import rospy
00003 import sys
00004 from geometry_msgs.msg import Twist
00005
00006
00007 class Program:
00008 def main(self):
00009 if len(sys.argv) < 5:
00010 raise ValueError("Need two argument to run the program, those argument are <from> <to>")
00011
00012 topic_from = sys.argv[1]
00013 topic_to = sys.argv[2]
00014
00015 self._pub = rospy.Publisher(topic_to, Twist, queue_size=10)
00016 rospy.Subscriber(topic_from, Twist, self.callback, queue_size=10)
00017
00018 def callback(self, msg):
00019 self._pub.publish(msg)
00020
00021 if __name__ == '__main__':
00022 rospy.init_node('driver_remaper')
00023 try:
00024 Program().main()
00025 rospy.spin()
00026 except ValueError as error:
00027 rospy.logerr(error.message)