Example #1
0
    def __init__(self):
        # TODO: Check whether the tool is early or on time
        rand = random.choice([0, 1, 2])
        if rand == 0:
            publish_state_update(YEETBotState.RECEIVING_TOOL_EARLY)
        else:
            publish_state_update(YEETBotState.RECEIVING_TOOL_ON_TIME)

        user_interface.reset()

        tool = user_interface.tool_requested
        if (tool != 'pliers' and tool != 'screw_driver'
                and tool != 'wire_strippers' and tool != 'vernier_calipers'):
            raise RuntimeError("Unknown tool {}".format(tool))

        speech_msg = String()
        if item_database.is_tool_missing(tool):
            speech_msg.data = "Please return the {} to the drawer that I am opening for you.".format(
                tool.replace('_', ' '))
            item_database.change_drawer_state(tool, True)
            self.false_request = False
        else:
            speech_msg.data = "I'm not missing any of those!"
            self.false_request = True

        text_msg_pub.publish(speech_msg)

        self.tool = tool

        user_interface.tool_requested = ''
        user_interface.user_requested_borrow = False

        self.time_started = rospy.Time.now()
Example #2
0
    def __init__(self):
        publish_state_update(YEETBotState.GIVING_TOOL)

        user_interface.reset()

        tool = user_interface.tool_requested
        if (tool != 'pliers' and tool != 'screw_driver'
                and tool != 'wire_strippers' and tool != 'vernier_calipers'):
            raise RuntimeError("Unknown tool {}".format(tool))

        speech_msg = String()
        if item_database.contains_tool(tool):
            speech_msg.data = "Please take the {} from the drawer that I am opening for you.".format(
                tool.replace('_', ' '))
            item_database.change_drawer_state(tool, True)
            self.false_request = False
        else:
            speech_msg.data = "I'm sorry, I don't have that tool in stock. Perhaps you could return it to me?"
            self.false_request = True

        text_msg_pub.publish(speech_msg)

        self.tool = tool

        user_interface.tool_requested = ''
        user_interface.user_requested_borrow = False

        self.time_started = rospy.Time.now()
Example #3
0
    def __init__(self, goal=PoseStamped()):
        publish_state_update(YEETBotState.TRAVELLING)

        user_interface.reset()
        self.current_goal = goal
        self.new_goal = goal
        nav_interface.goto_pos(self.current_goal)

        self.state = navigation_interface.ACTIVE
Example #4
0
    def __init__(self):
        publish_state_update(YEETBotState.IDLE)

        speech_msg = String()
        speech_msg.data = "Hello, I am yeetbot3000!\n\nTo get my attention, just wave and say \"Snow Boi\".\n\nHow can I help you today?"
        text_msg_pub.publish(speech_msg)

        user_interface.idle_screen_choices()

        self.start_time = rospy.Time.now()
Example #5
0
    def __init__(self):
        pose = PoseStamped()
        pose.pose.position.x = 5.89
        pose.pose.position.y = 2.15
        pose.pose.orientation.w = 1
        pose.header.frame_id = 'map'
        pose.header.stamp = rospy.Time.now()
        super(ForceReturn, self).__init__(goal=pose)
        publish_state_update(YEETBotState.RECEIVING_TOOL_LATE)
        self.tool = item_database.get_timed_out_tool_named()

        speech_msg = String()
        speech_msg.data = "I am looking for my " + self.tool + ". Please return it to me."
        user_interface.return_choices()
        text_msg_pub.publish(speech_msg)
Example #6
0
    def __init__(self, request_type):
        publish_state_update(YEETBotState.RECEIVING_REQUEST)

        self.request_type = request_type

        speech_msg = String()
        if request_type == 'lend':
            speech_msg.data = "Which tool would you like to borrow?"
            user_interface.borrow_choices()
        elif request_type == 'return':
            speech_msg.data = "Which tool would you like to return?"
            user_interface.return_choices()
        else:
            speech_msg.data = "How may I help you?"
            user_interface.idle_screen_choices()
        text_msg_pub.publish(speech_msg)