Skip to content

Commit

Permalink
Create talker_drive.py
Browse files Browse the repository at this point in the history
  • Loading branch information
garryellard authored Aug 16, 2023
1 parent e891ad2 commit 012aee6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions talker_drive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

import rospy
from geometry_msgs.msg import Twist

def talker():
pub = rospy.Publisher('cmd_vel', Twist, queue_size=10)
rospy.init_node('talker', anonymous=True)
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
velocity = Twist()
velocity.linear.x = 0.05
velocity.angular.z = 0.2
pub.publish(velocity)
rate.sleep()

if __name__ == '__main__':
try:
talker()
except rospy.ROSInterruptException:
pass

0 comments on commit 012aee6

Please sign in to comment.