diff --git a/teleop_twist_keyboard.py b/teleop_twist_keyboard.py index de14848..9d7967b 100755 --- a/teleop_twist_keyboard.py +++ b/teleop_twist_keyboard.py @@ -1,4 +1,7 @@ #!/usr/bin/env python + +from __future__ import print_function + import roslib; roslib.load_manifest('teleop_twist_keyboard') import rospy @@ -88,8 +91,8 @@ def vels(speed,turn): status = 0 try: - print msg - print vels(speed,turn) + print(msg) + print(vels(speed,turn)) while(1): key = getKey() if key in moveBindings.keys(): @@ -101,9 +104,9 @@ def vels(speed,turn): speed = speed * speedBindings[key][0] turn = turn * speedBindings[key][1] - print vels(speed,turn) + print(vels(speed,turn)) if (status == 14): - print msg + print(msg) status = (status + 1) % 15 else: x = 0 @@ -118,8 +121,8 @@ def vels(speed,turn): twist.angular.x = 0; twist.angular.y = 0; twist.angular.z = th*turn pub.publish(twist) - except: - print e + except Exception as e: + print(e) finally: twist = Twist()