Created
December 27, 2014 14:25
-
-
Save detik19/48a1c5b9d384bb6c1921 to your computer and use it in GitHub Desktop.
How to Suscribe to turtle1/command_velocity in node turtlesim turtle_teleop_key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import roslib; roslib.load_manifest('second_tutorials') | |
import rospy | |
from turtlesim.msg import Velocity | |
def callback(data): | |
rospy.loginfo(rospy.get_name()+"I heard %f", data.linear) | |
def listener(): | |
rospy.init_node('TedyGanteng', anonymous=True) | |
rospy.Subscriber("turtle1/command_velocity", Velocity, callback) | |
rospy.spin() | |
if __name__=='__main__': | |
listener() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment