Exemplo n.º 1
0
 def run(self, instance):
     speech("Thank you. Your food will be with you soon")
     cusID = instance.model.tables[instance.table-1]['customerID']
     taskManager.new_task("Deliver", table_number=instance.table, delay=1, customerID=cusID)
     r = rospy.Rate(1)
     r.sleep()
     instance.running = False
 def run(self, instance):
     navTo.navigateTo("waitingarea")
     r = rospy.Rate(1)
     r.sleep()
     if not vision.are_people():
         speech("Oh, it's empty")
         instance.running = False
Exemplo n.º 3
0
 def run(self, instance):
     speech("Okay, I will come back later")
     cusID = instance.model.tables[instance.table-1]['customerID']
     taskManager.new_task("TakeOrder", table_number=instance.table, delay=5, customerID=cusID)
     r = rospy.Rate(1)
     r.sleep()
     instance.running = False
    def next(self, instance, input):

        big_tables = list(
            filter(lambda t: t['places'] >= instance.group_size,
                   instance.model.tables))
        print("big enough = " + str(big_tables))

        if big_tables == []:
            speech(
                "Sorry, we don't have any tables in the restaurant big enough to seat "
                + str(instance.group_size) + " people.")
            return Evict()

        big_avail_tables = list(filter(lambda t: t['available'], big_tables))
        print("big enough and free = " + str(big_avail_tables))

        if big_avail_tables == []:
            speech("Sorry, all our tables of size " +
                   str(instance.group_size) + " or above are still busy.")
            return GiveWaitingTime()

        big_avail_tables.sort(key=(lambda x: x['places']))
        print("big enough and free and sorted = " + str(big_avail_tables))

        instance.group_table = big_avail_tables[0]['id']
        instance.model.tables[instance.group_table - 1]['customerID'] += 1
        instance.model.tables[instance.group_table - 1]['avaliable'] = False
        return GuideToTable()
Exemplo n.º 5
0
 def run(self, instance):
     speech("Thank you " + instance.user +
            ", your payment has been processed. You may now leave.")
     instance.model.prepend_message(
         "staff", "Payment taken from " + instance.user + " @ Table " +
         str(instance.table_number))
     instance.running = False
Exemplo n.º 6
0
 def run(self, instance):
     if not vision.are_people():
         speech("I can't see anyone")
         instance.model.tables[instance.table - 1]['available'] = True
         instance.running = False
         return
     speech("Is everything okay with your food?")
     instance.addInput(listen())
Exemplo n.º 7
0
 def run(self, instance):
     speech(
         "I'm sorry, I haven't been able to take a payment from you. Please await further assistance"
     )
     instance.model.prepend_message(
         "staff", "Table " + str(instance.table_number) +
         " unprofitable. Please assist")
     instance.running = False
Exemplo n.º 8
0
 def run(self, instance):
     if not vision.are_people():
         speech("I can't see anyone")
         instance.model.tables[instance.table - 1]['available'] = True
         instance.running = False
         return
     speech("Has everyone here finished their meal?")
     instance.addInput(listen())
Exemplo n.º 9
0
 def run(self, instance):
     if not vision.are_people():
         speech("I can't see anyone")
         instance.model.tables[instance.table-1]['available'] = True
         instance.running = False
         return
     speech("Are we ready to order?")
     instance.addInput(listen())
 def run(self, instance):
     speech("Thanks again for your patience. I'll be back soon.")
     taskManager.new_task("CollectFromWaitingArea",
                          table_number=None,
                          delay=5,
                          customerID=-1)
     r = rospy.Rate(1)
     r.sleep()
     instance.running = False
Exemplo n.º 11
0
 def next(self, instance, input):
     if input is None or input == '':
         return instance.currentState
     elif 'go' in input:
         print("Delivering to table " + str(instance.table_number))
         return NavigateToTable()
     else:
         speech("I'll wait here until you tell me to go.")
         return instance.currentState
Exemplo n.º 12
0
 def run(self, instance):
     speech("My apologies, I shall return later")
     cusID = instance.model.tables[instance.table_number - 1]['customerID']
     taskManager.new_task("CollectPayment",
                          table_number=instance.table_number,
                          delay=7.5,
                          customerID=cusID)
     r = rospy.Rate(1)
     r.sleep()
     instance.running = False
Exemplo n.º 13
0
def main():
    rospy.init_node("scream", anonymous=True)
    rospy.Subscriber("navIn", String, navIn)
    rospy.Subscriber("navOut", String, navOut)
    rospy.Subscriber("sonar", SonarArray, sonarCallback)
    rate = rospy.Rate(10)
    screamRate = rospy.Rate(0.75)
    while not rospy.is_shutdown():
        if talk and sonar < 0.25:
            speech("wilhelmscream")
            screamRate.sleep()
        rate.sleep()
Exemplo n.º 14
0
 def run(self, instance):
     speech(
         "Okay, thank you for your comments. They have been submitted to my organic comrades for review"
     )
     cusID = instance.model.tables[instance.table - 1]['customerID']
     taskManager.new_task("CollectPayment",
                          table_number=instance.table,
                          delay=2,
                          customerID=cusID)
     r = rospy.Rate(1)
     r.sleep()
     instance.running = False
Exemplo n.º 15
0
 def next(self, instance, input):
     if instance.user is not None:
         #Check bookings if they have a booking
         if instance.user in instance.model.bookings:
             instance.group_size = instance.model.bookings[instance.user]
             del instance.model.bookings[instance.user]
             speech("Hi there, " + instance.user)
             return CheckGroup()
         speech("Sorry I couldn't find your booking")
         return AskGroupSize()
     else:
         print("That didnt work")
         return UnknownAnswer()
Exemplo n.º 16
0
 def run(self, instance):
     speech("Please follow me to the waiting area")
     navTo.navigateTo("waitingarea")
     speech("I will come get you when your table is ready")
     instance.addInput('')
     # add a task to collect them after the time
     taskManager.new_task("CollectFromWaitingArea",
                          table_number=None,
                          delay=5,
                          customerID=-1)
     r = rospy.Rate(1)
     r.sleep()
     instance.running = False
 def run(self, instance):
     speech("Please follow me")
     navTo.navigateTo("table" + str(instance.group_table))
     speech("Please take a seat. Someone will be with you in a few minutes")
     instance.addInput('')
     cusID = instance.model.tables[instance.table_number - 1]['customerID']
     taskManager.new_task("TakeOrder",
                          table_number=instance.group_table,
                          delay=0.5,
                          customerID=cusID)
     r = rospy.Rate(1)
     r.sleep()
     instance.model.tables[instance.table_number]
     instance.running = False
Exemplo n.º 18
0
def main():
    rospy.init_node("chatterbot", anonymous=True)
    rospy.Subscriber("navIn", String, navIn)
    rospy.Subscriber("navOut", String, navOut)
    stuff = ['Egg', 'Hello There', \
        "Cashier number 4 please", \
        "Lift going down", \
        "Dear customers, we are opening till number 7 for you. Please proceed to unload your shopping", \
        "Dear customers, we are closing till number 7. Please use an alternative till", \
        "Welcome. Please scan your first item", \
        "Unexpected item in the bagging area - remove this item before continuing", \
        "Where's the lamb sauce", \
        "If you have a Morrisons More Card, please scan it now", \
        "Cool cool cool.", \
        "Thank you, come again", \
        "Never underestimate the power of a committee with a tamborine", \
        "I don't get paid enough for this.", \
        "Sometimes I say I don't understand their answer, just to see the look on their faces", \
        "You won't believe some of the stuff I hear when people think I'm not parsing it", \
        "Beep Boop... Beep Boop", "sudo apt-get purge ros", \
        "sudo rm -rf", "Beep Beep, vehicle reversing", "speach", \
        "If you see something that doesn't look right, speak to staff, or text the British Transport Police, on 6 1 0 1 6. We'll sort it. See it. Say it. Sorted.", \
        "Error 4 0 4 quote not found", \
        "You have arrived at your destination", \
        "It's half past 12 somewhere", \
        "speAch", \
        "In 400 meters turn right", \
        "Dominos cookie rookie", \
        "Git Blame", \
        "Its a texture change not a pitch change", \
        "They ask you how you are, and you just have to say that you're fine, when you're not really fine, but you just can't get into it because they would never understand.", \
        "Stop right there criminal scum", \
        "Let the record show I am distressed"]
    rate = rospy.Rate(10)
    rates = [0.01, 0.02, 0.005, 0.01, 0.01, 0.015, 0.022, 0.04111, 0.03]
    while not rospy.is_shutdown():
        if talk:
            randomrate = rospy.Rate(random.choice(rates))
            speech(random.choice(stuff))
            randomrate.sleep()
        rate.sleep()
Exemplo n.º 19
0
 def run(self, instance):
     instance.group_size = 99999
     speech("How many people are there in your group?")
     response = listen()
     instance.addInput(response)
Exemplo n.º 20
0
    def run(self, instance):
        speech("Please tell me the order")

        instance.addInput(listen())
 def run(self, instance):
     speech("Sorry, I didn't understand your answer, let me try again")
     instance.addInput('')
 def run(self, instance):
     instance.group_size = 99999
     speech("Please remind me how many people there are in your group")
     response = listen()
     instance.addInput(response)
 def run(self, instance):
     speech("Table for " + str(instance.group_size))
     print("group=" + str(instance.group_size))
 def run(self, instance):
     speech("Sorry about that. Goodbye")
     instance.running = False
 def run(self, instance):
     speech("Hi again, thanks for waiting! Your patience is appreciated.")
 def run(self, instance):
     speech(
         "On behalf and myself and various carbon-based associates, we sincerely apologise for the confusion,"
         "but we will not be able to serve you today. Please leave the premises whenever you're ready."
     )
     instance.running = False
Exemplo n.º 27
0
 def run(self, instance):
     speech("Please present your card to validate your booking")
     instance.user = readCard()
 def run(self, instance):
     speech(
         "The revised estimate for your wait time is another 5 minutes. Is this okay?"
     )
     response = listen()
     instance.addInput(response)
Exemplo n.º 29
0
 def run(self, instance):
     speech("Do you have a booking?")
     response = listen()
     instance.addInput(response)
Exemplo n.º 30
0
 def run(self, instance):
     speech("Your wait time is 5 minutes, is this okay")
     response = listen()
     instance.addInput(response)