def talker(): pub = rospy.Publisher('/oculus2wd/base_command', drive) rospy.init_node('drive_node') while not rospy.is_shutdown(): pub.publish(drive(ord('b'), 10, 1)) print 'published' rospy.sleep(1.0)
def do_release_cam(self): 'Release cam' self.cmdpub.publish(drive(ord('w'), 0, 1))
def do_setcam(self): 'Set cam angle [55-80]' pos = 80 - self.campos * (80-55) / 100. self.cmdpub.publish(drive(ord('v'), pos, 1))
def do_right(self): 'Step right' self.cmdpub.publish(drive(ord('r'), 150, 1))
def do_left(self): 'Step left' self.cmdpub.publish(drive(ord('l'), 150, 1))
def do_stop(self): 'Stop motors' self.cmdpub.publish(drive(ord('s'), 0, 1))
def do_back(self): 'Back (0-255)' self.cmdpub.publish(drive(ord('b'), 255, 1))
def do_forward(self): 'Forward (0-255)' self.cmdpub.publish(drive(ord('f'), 255, 1))