diff --git a/rb_ws/src/buggy/launch/nand-system.launch b/rb_ws/src/buggy/launch/nand-system.launch index f6726a3..cac7d2d 100644 --- a/rb_ws/src/buggy/launch/nand-system.launch +++ b/rb_ws/src/buggy/launch/nand-system.launch @@ -2,7 +2,7 @@ - + diff --git a/rb_ws/src/buggy/scripts/serial/ros_to_bnyahaj.py b/rb_ws/src/buggy/scripts/serial/ros_to_bnyahaj.py index b7a77c1..18a5400 100755 --- a/rb_ws/src/buggy/scripts/serial/ros_to_bnyahaj.py +++ b/rb_ws/src/buggy/scripts/serial/ros_to_bnyahaj.py @@ -28,7 +28,11 @@ def __init__(self, self_name, other_name, teensy_name): rospy.Subscriber(self_name + "/buggy/input/steering", Float64, self.set_steering) rospy.Subscriber(self_name + "/debug/sanity_warning", Int8, self.set_alarm) - self.odom_publisher = rospy.Publisher(other_name + "/nav/odom", ROSOdom, queue_size=1) + + if other_name is None: + self.odom_publisher = rospy.Publisher(self_name + "/nav/odom", ROSOdom, queue_size=1) + else: + self.odom_publisher = rospy.Publisher(other_name + "/nav/odom", ROSOdom, queue_size=1) # upper bound of steering update rate, make sure auton sends slower than this self.steer_send_rate = rospy.Rate(500) self.read_rate = rospy.Rate(1000) @@ -114,7 +118,7 @@ def loop(self): if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--self_name", type=str, help="name of ego-buggy", required=True) - parser.add_argument("--other_name", type=str, help="name of other buggy", required=True) + parser.add_argument("--other_name", type=str, help="name of other buggy", required=False, default=None) parser.add_argument("--teensy_name", type=str, help="name of teensy port", required=True) args, _ = parser.parse_known_args() self_name = args.self_name