Beispiel #1
0
def main():
    tts = ALProxy("ALTextToSpeech", "10.0.0.7", 9559)
    tts.say("It's time to get testing!")

    motions = CustomMotions()

    motions.standUp()

    tts.say("Hello")
    motions.wave()

    motions.sitDown()
def main():
    tts = ALProxy("ALTextToSpeech", "10.0.0.7", 9559)
    tts.say("It's time to get testing!")

    motions = CustomMotions()

    motions.standUp()

    tts.say("Now where oh where is mark 80?")
    motions.detectMarkWalkStraight(80)
    tts.say("Here it is.")
    tts.say("Now it's time to rest.")

    motions.sitDown()
Beispiel #3
0
def main():
    tts = ALProxy("ALTextToSpeech", "10.0.0.7", 9559)

    motions = CustomMotions()

    tts.say("Time for a little stretch of the legs.")
    motions.standUp()
    motions.sitDown()
Beispiel #4
0
 def connect(self, IP_PR="10.0.0.7", port_PR=9559):
     self.speechProxy = ALProxy("ALTextToSpeech", IP_PR, port_PR)
     self.autonomousLifeProxy = ALProxy("ALAutonomousLife",
                                        IP_PR, port_PR)
     # IP and port overridden in case they change
     self.motions = CustomMotions(IP_PR, port_PR)
Beispiel #5
0
class PhaseThreeRoutine(Routine.Routine):
    '''
    Tour demo phase 3
    '''

    def __init__(self):
        '''
        Constructor
        '''
        self.numberSteps = 16
    # __init__

    def connect(self, IP_PR="10.0.0.7", port_PR=9559):
        self.speechProxy = ALProxy("ALTextToSpeech", IP_PR, port_PR)
        self.autonomousLifeProxy = ALProxy("ALAutonomousLife",
                                           IP_PR, port_PR)
        # IP and port overridden in case they change
        self.motions = CustomMotions(IP_PR, port_PR)
    #connect

    def perform(self):
        self.autonomousLifeProxy.setState("disabled")

        self.motions.sitDown()

        self.motions.standUp()
        self.speechProxy.say("I'm looking for the student guide"
                             " carrying mark 114.")

        if not self.motions.lookAroundForMark(
                114, maxAttemptsPR=float('inf')):
            self.fail()
        self.speechProxy.say("I've seen it. Time to welcome our visitors.")
        time.sleep(1)

        self.motions.wave(True)
        self.speechProxy.say("Hello, I'm Robbie. I'm a NAO robot."
                             "I'm designed and manufactured by the"
                             " Aldebaran company in France, but all"
                             " of my present behaviors have been"
                             " programmed as part of a Senior"
                             " Software Engineering project.")
        time.sleep(1)

        self.speechProxy.say("There's very little I can do without the"
                             " programs made by the students here at"
                             " Montana Tech; programming me is not easy,"
                             " but these students have been well-equipped"
                             " by their education here to deal with"
                             " complex problems.")
        time.sleep(1)

        self.speechProxy.say("I hope you have a pleasant and "
                             "informative visit here at Montana Tech.")
        time.sleep(1)

        self.speechProxy.say("Unfortunately, I can't stay with you longer "
                             "as I must return to my post. Have a nice day.")
    #run

    def fail(self):
        self.speechProxy.say("I couldn't find the mark.")
        self.motions.sitDown()
        self.running = False
    #fail
#end PhaseThreeRoutine.py
class PhaseFourAndFiveRoutine(Routine.Routine):
    '''
    Tour demo phases 4 and 5
    '''
    def __init__(self):
        '''
        Constructor
        '''
        self.numberSteps = 7

    # __init__

    def connect(self, IP_PR="10.0.0.7", port_PR=9559):
        self.speechProxy = ALProxy("ALTextToSpeech", IP_PR, port_PR)
        self.autonomousLifeProxy = ALProxy("ALAutonomousLife", IP_PR, port_PR)
        # IP and port overridden in case they change
        self.motions = CustomMotions(IP_PR, port_PR)

    #connect

    def perform(self):
        self.autonomousLifeProxy.setState("disabled")

        self.motions.sitDown()
        self.speechProxy.say("I've got to go back now.")

        self.motions.standUp()
        self.speechProxy.say("Going to stretch my legs a little"\
                             " to get a feel for the carpet")

        self.motions.turnLeft(.2)
        self.motions.turnRight(.2)

        self.motions.turnAround()
        self.speechProxy.say(
            "I must now find the mark to get back into the office.")
        if not self.motions.lookAroundForMark(64):
            self.fail()

        self.speechProxy.say("Ah! I see it.")
        markSeenAngle = self.motions.getLookAngle()
        self.motions.turnLeft(markSeenAngle)
        if not self.motions.detectMarkAndMoveTo(64, stoppingDistancePR=.35):
            self.fail()

        self.speechProxy.say("I will now return to my post. Mark 68 marks it.")
        if not self.motions.lookAroundForMark(68):
            self.fail()

        self.speechProxy.say("Ah! I see the mark.")
        markSeenAngle = self.motions.getLookAngle()
        self.motions.turnLeft(markSeenAngle)
        if not self.motions.detectMarkAndMoveTo(68, stoppingDistancePR=.2):
            self.fail()
        self.motions.turnAround()
        self.motions.sitDown()

    #run

    def fail(self):
        self.speechProxy.say("I couldn't find the mark.")
        self.motions.sitDown()
        self.running = False

    #fail


#end PhaseFourAndFiveRoutine.py
class PhaseOneAndTwoRoutine(Routine.Routine):
    '''
    Tour demo phases 1 and 2
    '''
    def __init__(self):
        '''
        Constructor
        '''
        self.numberSteps = 14

    # __init__

    def connect(self, IP_PR="10.0.0.7", port_PR=9559):
        self.speechProxy = ALProxy("ALTextToSpeech", IP_PR, port_PR)
        self.autonomousLifeProxy = ALProxy("ALAutonomousLife", IP_PR, port_PR)
        # IP and port overridden in case they change
        self.motions = CustomMotions(IP_PR, port_PR)

    #connect

    def perform(self):
        self.autonomousLifeProxy.setState("disabled")

        self.motions.sitDown()
        self.speechProxy.say("Thank you for waking me,"\
                             " I have a job to do.")

        self.motions.standUp()
        self.speechProxy.say("Going to stretch my legs a little"\
                             " to get a feel for the carpet")

        self.motions.turnLeft(.2)
        self.motions.turnRight(.2)

        self.speechProxy.say("I must now find the mark on the railing.")
        if not self.motions.lookAroundForMark(107):
            self.fail()

        self.speechProxy.say("Ah! I see the railing mark.")
        markSeenAngle = self.motions.getLookAngle()
        self.motions.turnLeft(markSeenAngle)
        if not self.motions.detectMarkAndMoveTo(107, 1):
            self.fail()

        self.motions.sitDown()

    #run

    def fail(self):
        self.speechProxy.say("I couldn't find the mark.")
        self.motions.sitDown()
        self.running = False
Beispiel #8
0
def main():
    tts = ALProxy("ALTextToSpeech", "10.0.0.7", 9559)
    motions = CustomMotions()
    motions.standUp()
    tts.say("Let's make sure I can turn.")
    motions.turnLeft(45)
    motions.turnRight(45)
    motions.turnAround("left")
    motions.turnAround("right")
    motions.sitDown()
Beispiel #9
0
def main():
    tts = ALProxy("ALTextToSpeech", "10.0.0.7", 9559)

    motions = CustomMotions()

    motions.standUp()

    motions.lookTo(60)
    tts.say("To the left to the left.")
    motions.turnToLookAngle()
    tts.say("And back.")
    motions.turnRight(60)

    motions.sitDown()