def execute(self, userdata): """DriveBackward state Driving backwards for a given time. """ return_state = "locate" Utils.drive(Twist(linear=Vector3(x = -userdata.in_drive_speed, y = 0.0 , z = 0.0))) rospy.sleep(userdata.in_drive_time) Utils.drive(Utils.STOP) return return_state
def execute(self, userdata): """TurnRight state Turning to the right for a given time. """ return_state = "locate" Utils.drive(Twist(angular=Vector3(x = 0.0, y = 0.0 , z = -userdata.in_turn_speed))) print "###Driving for:", userdata.in_drive_time print "###Driving with:", userdata.in_turn_speed rospy.sleep(userdata.in_drive_time) Utils.drive(Utils.STOP) return return_state
def execute(self, userdata): """DriveLeft state Driving to the left for a given time. """ return_state = "locate" Utils.drive(Twist(linear=Vector3(x = 0.0, y = userdata.in_drive_speed , z = 0.0))) print "###Driving for:", userdata.in_drive_time print "###Driving with:", userdata.in_turn_speed rospy.sleep(userdata.in_drive_time) Utils.drive(Utils.STOP) return return_state