Пример #1
0
def call_guide_to(loc_name, world):

    tosay = "Please follow me to the " + str(loc_name)
    speak = speaker(tosay)
    speak.execute()
    rospy.logwarn('call_guide_to ' + loc_name)
    #     #############################################################################
    if SKILLS:
        if (time.time() - TIME_INIT) > 270:
            return "succeeded"

        out = 'aborted'
        tries = 0
        while (out == 'aborted' and tries < 3):
            tries = tries + 1
            sm = nav_to_poi(poi_name=loc_name)
            sm.execute()

        if out == 'aborted':
            tosay = "I can't reach the " + loc_name + ". The door is closed. The sentence was from category 3"
            speak = speaker(tosay)
            speak.execute()
            rospy.logwarn('FAIL IN REACHING ' + loc_name)
            time.sleep(SLEEP_TIME)
            return "aborted"
    #############################################################################
    world.set_current_position(loc_name)
    time.sleep(SLEEP_TIME)
    return "succeeded"
Пример #2
0
def call_go_to(loc_name,world):
    '''
    out = aborted
    tries = 0
    while(out==aborted and tries<3):
        if loc_name == 'exit':
            out = call_exit()
        else:
            print "SM : go_to %s" % (loc_name)
            tosay = "I'm going to the "+loc_name
            speak = SpeakActionState(text=tosay)
            speak.execute(ud=None)
            mr = nav_to_poi()
            mr.userdata._data = {'nav_to_poi_name': loc_name.replace(' ', '_')}#{'room_name': loc_name.replace(' ', '_')}
            #mr.userdata.room_name = loc_name
            out = mr.execute()
        tries = tries+1

    return succeeded '''
    
    tosay = "I'm going to the "+str(loc_name)
    speak = speaker(tosay)
    speak.execute()
    rospy.logwarn('call_go_to '+ loc_name)
    #############################################################################
    '''sm = nav_to_poi(poi_name = loc_name)
    sm.execute()'''
    #############################################################################
    world.set_current_position(loc_name)
    time.sleep(SLEEP_TIME)  
    return "succeeded" 
Пример #3
0
def call_guide_to(loc_name,world):

    tosay = "Please follow me to the "+str(loc_name)
    speak = speaker(tosay)
    speak.execute()
    rospy.logwarn('call_guide_to '+ loc_name)  
#     #############################################################################
    if SKILLS :      
        if (time.time()-TIME_INIT) > 270:
            return "succeeded"
         
        out = 'aborted'
        tries = 0
        while(out=='aborted' and tries<3):       
            tries = tries+1
            sm = nav_to_poi(poi_name = loc_name)
            sm.execute()
             
             
        if out=='aborted':
            tosay = "I can't reach the " + loc_name + ". The door is closed. The sentence was from category 3"
            speak = speaker(tosay)
            speak.execute()
            rospy.logwarn('FAIL IN REACHING ' + loc_name)
            time.sleep(SLEEP_TIME)            
            return "aborted"
    #############################################################################
    world.set_current_position(loc_name)
    time.sleep(SLEEP_TIME)  
    return "succeeded" 
Пример #4
0
def call_go_to(loc_name, world):
    '''
    out = aborted
    tries = 0
    while(out==aborted and tries<3):
        if loc_name == 'exit':
            out = call_exit()
        else:
            print "SM : go_to %s" % (loc_name)
            tosay = "I'm going to the "+loc_name
            speak = SpeakActionState(text=tosay)
            speak.execute(ud=None)
            mr = nav_to_poi()
            mr.userdata._data = {'nav_to_poi_name': loc_name.replace(' ', '_')}#{'room_name': loc_name.replace(' ', '_')}
            #mr.userdata.room_name = loc_name
            out = mr.execute()
        tries = tries+1

    return succeeded '''

    tosay = "I'm going to the " + str(loc_name)
    speak = speaker(tosay)
    speak.execute()
    rospy.logwarn('call_go_to ' + loc_name)
    #############################################################################
    '''sm = nav_to_poi(poi_name = loc_name)
    sm.execute()'''
    #############################################################################
    world.set_current_position(loc_name)
    time.sleep(SLEEP_TIME)
    return "succeeded"
Пример #5
0
def call_go_to(loc_name,world):

    tosay = "I'm going to the "+str(loc_name)
    speak = speaker(tosay,wait=False)
    speak.execute() 
    rospy.logwarn('call_go_to '+ loc_name + ' from :')  
    #############################################################################
    if SKILLS :      
        if (time.time()-TIME_INIT) > 270:
            return "succeeded"
         
        out = 'aborted'
        tries = 0       
        while(out=='aborted' and tries<3):
            tries = tries+1
            if world.get_current_position() == loc_name:  
                out = 'succeeded'
            else:
                if loc_name == "exit":
                    sm = nav_to_poi(poi_name = "door_B")
                    out = sm.execute() 
                 
                sm = nav_to_poi(poi_name = loc_name)
                out = sm.execute()     
             
             
        if out=='aborted':
            tosay = "I can't reach the " + loc_name + ". The door is closed. I'm going to inform"
            speak = speaker(tosay)
            speak.execute()
            rospy.logwarn('FAIL IN REACHING ' + loc_name)
            time.sleep(SLEEP_TIME)
             
             
            sm = nav_to_poi(poi_name = 'referee')
            out = sm.execute()     
            tosay = "I can't reach the " + loc_name + ". The door is closed. The sentence is from category 3"
            speak = speaker(tosay)
            speak.execute() 
             
            return "aborted"
        else:
            tosay = "I arrived to the " + loc_name
            speak = speaker(tosay)
            speak.execute()
    #############################################################################
    world.set_current_position(loc_name)
    rospy.logwarn(world.get_current_position())
    time.sleep(SLEEP_TIME)  
    return "succeeded" 
Пример #6
0
def call_guide_to(loc_name,world):
    
    tosay = "Please follow me to the "+str(loc_name)
    speak = speaker(tosay)
    speak.execute()
    rospy.logwarn('call_guide_to '+ loc_name)
    #############################################################################
    '''sm = nav_to_poi(poi_name = loc_name)
    sm.execute()'''
    #############################################################################
    print(world.robot.locId)
    world.set_current_position(loc_name)
    print(world.robot.locId)
    time.sleep(SLEEP_TIME)  
    return "succeeded" 
Пример #7
0
def call_guide_to(loc_name, world):

    tosay = "Please follow me to the " + str(loc_name)
    speak = speaker(tosay)
    speak.execute()
    rospy.logwarn('call_guide_to ' + loc_name)
    #############################################################################
    '''sm = nav_to_poi(poi_name = loc_name)
    sm.execute()'''
    #############################################################################
    print(world.robot.locId)
    world.set_current_position(loc_name)
    print(world.robot.locId)
    time.sleep(SLEEP_TIME)
    return "succeeded"
Пример #8
0
def call_go_to(loc_name, world):

    tosay = "I'm going to the " + str(loc_name)
    speak = speaker(tosay, wait=False)
    speak.execute()
    rospy.logwarn('call_go_to ' + loc_name + ' from :')
    #############################################################################
    if SKILLS:
        if (time.time() - TIME_INIT) > 270:
            return "succeeded"

        out = 'aborted'
        tries = 0
        while (out == 'aborted' and tries < 3):
            tries = tries + 1
            if world.get_current_position() == loc_name:
                out = 'succeeded'
            else:
                if loc_name == "exit":
                    sm = nav_to_poi(poi_name="door_B")
                    out = sm.execute()

                sm = nav_to_poi(poi_name=loc_name)
                out = sm.execute()

        if out == 'aborted':
            tosay = "I can't reach the " + loc_name + ". The door is closed. I'm going to inform"
            speak = speaker(tosay)
            speak.execute()
            rospy.logwarn('FAIL IN REACHING ' + loc_name)
            time.sleep(SLEEP_TIME)

            sm = nav_to_poi(poi_name='referee')
            out = sm.execute()
            tosay = "I can't reach the " + loc_name + ". The door is closed. The sentence is from category 3"
            speak = speaker(tosay)
            speak.execute()

            return "aborted"
        else:
            tosay = "I arrived to the " + loc_name
            speak = speaker(tosay)
            speak.execute()
    #############################################################################
    world.set_current_position(loc_name)
    rospy.logwarn(world.get_current_position())
    time.sleep(SLEEP_TIME)
    return "succeeded"