Skip to content

Instantly share code, notes, and snippets.

@mikepurvis
Created September 30, 2015 20:53
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 mikepurvis/ca466b1b55cce0486e6c to your computer and use it in GitHub Desktop.
Save mikepurvis/ca466b1b55cce0486e6c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#
# Issue some random commands to your ROS robot, yay!
import rospy, random
from geometry_msgs.msg import Twist
rospy.init_node("huskytest")
pub = rospy.Publisher("cmd_vel", Twist, queue_size=1)
msg = Twist()
while not rospy.is_shutdown():
msg.linear.x = random.random() * 1.4 - 0.7
for a in range(50):
pub.publish(msg)
rospy.sleep(rospy.Duration(0.05))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment