Created
May 13, 2019 10:15
-
-
Save pbloem/1fa9f6c0ed595274b7ec0daa0823f077 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import roslib #; roslib.load_manifest('sr_example') | |
import rospy | |
from geometry_msgs.msg import Twist | |
from std_msgs.msg import Float64, String | |
rospy.init_node('turtlebot_controller', anonymous=True) | |
def move(dist, angle): | |
pub = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10) | |
message = Twist() | |
message.linear.x = dist | |
message.angular.z = angle | |
pub.publish(message) | |
rate = rospy.Rate(10) | |
for _ in range(100): | |
move(1.0, 1.0) | |
rospy.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment