Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import rospy
- from std_msgs.msg import String
- from geometry_msgs.msg import Twist
- #def getKey():
- # tty.setraw(sys.stdin.fileno())
- # select.select([sys.stdin], [], [], 0)
- # key = sys.stdin.read(1)
- #termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)
- #return key
- def talker():
- pub = rospy.Publisher('chatter', Twist, queue_size=10)
- rospy.init_node('talker', anonymous=True)
- rate = rospy.Rate(10) # 10hz
- while not rospy.is_shutdown():
- msg = Twist()
- msg.linear.x = 2
- msg.linear.y = 0
- msg.linear.z = 0
- sg.angular.x = 0
- msg.angular.y = 0
- msg.angular.z = 0
- #key = getkey()
- rospy.loginfo(key)
- pub.publish(msg)
- rate.sleep()
- if __name__ == '__main__':
- try:
- talker()
- except rospy.ROSInterruptException:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement