prev_start_autonomous = False pub_start_autonomous.publish(msg) continue if key in keyBindings.keys(): x = keyBindings[key][0] th = keyBindings[key][1] else: x = 0 th = 0 if (key == '\x03'): break msg = AckermannDrive() msg.speed = x * speed msg.acceleration = 1 msg.jerk = 1 msg.steering_angle = th * turn msg.steering_angle_velocity = 1 print (msg) pub_ackermann.publish(msg) except: print 'error' finally: msg = AckermannDrive() msg.speed = 0 msg.acceleration = 1 msg.jerk = 1