Created
April 26, 2015 11:41
-
-
Save marjinal1st/17a114c081dbadf3b2f2 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import rospy | |
from geometry_msgs.msg import Twist | |
def main(): | |
rospy.init_node("move_test", anonymous=False) | |
cmd_vel = rospy.Publisher("/r1/cmd_vel", Twist, queue_size=10) | |
r = rospy.Rate(10) | |
move_cmd = Twist() | |
move_cmd.linear.x = 0.2 | |
move_cmd.angular.z = 0.5 | |
while not rospy.is_shutdown(): | |
cmd_vel.publish(move_cmd) | |
r.sleep() | |
cmd_vel.publish(Twist()) | |
rospy.sleep(1) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment