Skip to content

Instantly share code, notes, and snippets.

@marjinal1st
Created April 26, 2015 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marjinal1st/17a114c081dbadf3b2f2 to your computer and use it in GitHub Desktop.
Save marjinal1st/17a114c081dbadf3b2f2 to your computer and use it in GitHub Desktop.
#!/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