当前位置: 首页>>代码示例>>Python>>正文


Python ALProxy.version方法代码示例

本文整理汇总了Python中naoqi.ALProxy.version方法的典型用法代码示例。如果您正苦于以下问题:Python ALProxy.version方法的具体用法?Python ALProxy.version怎么用?Python ALProxy.version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在naoqi.ALProxy的用法示例。


在下文中一共展示了ALProxy.version方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: SoundLocationModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class SoundLocationModule(object):
    nao = None
    proxy = None
    lastDetectionTime = datetime.now()

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting AudioSourceLocalizationProxy...")
        try:
            global myBroker
            myBroker = ALBroker("soundLocalizationBroker", "0.0.0.0", 0, self.nao.brokerIp(), self.nao.brokerPort())

            self.proxy = ALProxy("ALAudioSourceLocalization")
            log("Version " + self.proxy.version())

            self.nao.memory.proxy.subscribeToEvent(
                "ALAudioSourceLocalization/SoundLocated", "SoundLocator", "onSoundLocated"
            )
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:30,代码来源:soundLocationModule.py

示例2: SpeechRecognitionModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class SpeechRecognitionModule(object):
    nao = None
    proxy = None

    bShutdown = False

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):

        log("Connecting SpeechRecognitionProxy...")
        try:
            self.proxy = ALProxy("ALSpeechRecognition")
            log(self.proxy.version())
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False

        self.proxy.setVisualExpression(False)
        self.proxy.setAudioExpression(False)
        self.proxy.setLanguage("Portuguese")
        self.proxy.setVocabulary(["robou", "energia", "dinheiro", "ambiente", "felicidade", "sorriso", "bem estar", "electricidade", "oleo", u"petróleo", u"não renovável", "economia", "farol", "casas", u"população", "passar", u"nível", u"avançar", "solares", "melhorias", "melhora", "melhorar", "aplicar", u"política", "construir"], True) #"mar", "rio", 

        self.nao.memory.proxy.subscribeToEvent("WordRecognized","SpeechRecoWatcher","onWordRecognized")
        #volumeth = Thread(target=self.volumeCtrlCycle)
        #volumeth.start()
        #print "DEBUG>> Started volume control cycle"

        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:36,代码来源:speechRecognitionModule.py

示例3: VisionModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class VisionModule(object):
    nao = None
    proxy = None

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting VisionRecognitionProxy...")
        try:
            #global myBroker
            #myBroker = ALBroker("visionBroker", "0.0.0.0", 0, self.nao.brokerIp(), self.nao.brokerPort())

            self.proxy = ALProxy("ALVisionRecognition")
            log(self.proxy.version())

            self.nao.memory.proxy.subscribeToEvent("PictureDetected","VisionRecognizer","onPictureDetected")
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:27,代码来源:visionModule.py

示例4: SensorsModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class SensorsModule(object):
    nao = None
    proxy = None

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting SensorsProxy...")
        try:
            #global myBroker
            #myBroker = ALBroker("sensorsBroker", "0.0.0.0", 0, self.nao.brokerIp(), self.nao.brokerPort())

            self.proxy = ALProxy("ALSensors")
            log(self.proxy.version())


            self.nao.memory.proxy.subscribeToEvent("ChestButtonPressed","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("FrontTactilTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HandLeftBackTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HandLeftLeftTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HandLeftRightTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HandRightBackTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HandRightLeftTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HandRightRightTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("HotJoinDetected","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("LeftBumperPressed","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("MiddleTactilTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("RearTactilTouched","SensorsWatcher","onSensorTouched")
            self.nao.memory.proxy.subscribeToEvent("RightBumperPressed","SensorsWatcher","onSensorTouched")
            self.lastTouch = time.time()
            
            global instance
            instance.stopTouch = False
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:44,代码来源:sensorsModule.py

示例5: MemoryModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class MemoryModule(object):
    nao = None
    proxy = None

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting MemoryProxy...")
        try:
            self.proxy = ALProxy("ALMemory")
            log(self.proxy.version())
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:22,代码来源:memoryModule.py

示例6: AudioModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class AudioModule(object):
    nao = None
    proxy = None
    masterDeviceProxy = None

    bShutdown = False
    _targetVolume = 0

    _preloadedAudioFiles = dict()
    _playingSound = None

    _volumeIncrement = 5

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):

        log("Connecting AudioDeviceProxy...")
        try:
            self.masterDeviceProxy = ALProxy("ALAudioDevice")
            log(self.masterDeviceProxy.version())
            self._targetVolume = self.masterDeviceProxy.getOutputVolume()
            log("Current Master Volume: {0}".format(self._targetVolume))
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.masterDeviceProxy = None
            return False

        log("Connecting AudioPlayerProxy...")
        try:
            self.proxy = ALProxy("ALAudioPlayer")
            log(self.proxy.version())
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
开发者ID:emote-project,项目名称:Scenario1,代码行数:42,代码来源:audioModule.py

示例7: SpeechModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class SpeechModule(object):
    nao = None
    proxy = None
    stopProxy = None
    isSpeaking = False
    speechBookmarks = []
    speechMutex = Lock()

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting SpeechProxy...")
        try:
            #global myBroker
            #myBroker = ALBroker("speechBroker", "0.0.0.0", 0, self.nao.brokerIp(), self.nao.brokerPort())

            self.proxy = ALProxy("ALTextToSpeech")
            self.stopProxy = ALProxy("ALTextToSpeech")
            log(self.proxy.version())
            log("Available languages: " + str(self.proxy.getAvailableLanguages()))
            log("Available voices: " + str(self.proxy.getAvailableVoices()))
            #self.proxy.setVoice("Celia22Enhanced");
            try:
                self.proxy.enableNotifications()
            except Exception, Argument:
                log("Notifications are already enabled")

            self.nao.memory.proxy.subscribeToEvent("ALTextToSpeech/CurrentBookMark","SpeechWatcher","onCurrentBookMark")
            self.nao.memory.proxy.subscribeToEvent("ALTextToSpeech/TextStarted","SpeechWatcher","onTextStarted")
            self.nao.memory.proxy.subscribeToEvent("ALTextToSpeech/TextDone","SpeechWatcher","onTextDone")
            self.nao.memory.proxy.subscribeToEvent("ALTextToSpeech/CurrentSentence","SpeechWatcher","onCurrentSentence")
        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
开发者ID:emote-project,项目名称:Scenario1,代码行数:41,代码来源:speechModule.py

示例8: EyesModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class EyesModule(object):

    ExpressionDefaultTime = 500
    DefaultExpression = "neutral"
    BlinkExpression = "shut"

    nao = None
    proxy = None
    bShutdown = False
    expressionTime = 0

    eyesIntensity = 1.0
    lastIntensity = 0
    
    currentExpression = ""
    savedStates = dict()

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting LedsProxy...")
        try:
            self.proxy = ALProxy("ALLeds")
            log(self.proxy.version())

            #print str(eyes.proxy.listLEDs())

            self.lastLeftleds = set()
            self.lastRightleds = set()

            #self.leds[1]=("LeftFaceLed1", "RightFaceLed8")
            #self.leds[2]=("LeftFaceLed8", "RightFaceLed7")
            #self.leds[3]=("LeftFaceLed7", "RightFaceLed6")
            #self.leds[4]=("LeftFaceLed6", "RightFaceLed5")
            #self.leds[5]=("LeftFaceLed5", "RightFaceLed4")
            #self.leds[6]=("LeftFaceLed4", "RightFaceLed3")
            #self.leds[7]=("LeftFaceLed3", "RightFaceLed2")
            #self.leds[8]=("LeftFaceLed2", "RightFaceLed1")
            global ledsNames

            ledsNames["eyeRight1"]="RightFaceLed8"
            ledsNames["eyeRight2"]="RightFaceLed1"
            ledsNames["eyeRight3"]="RightFaceLed2"
            ledsNames["eyeRight4"]="RightFaceLed3"
            ledsNames["eyeRight5"]="RightFaceLed4"
            ledsNames["eyeRight6"]="RightFaceLed5"
            ledsNames["eyeRight7"]="RightFaceLed6"
            ledsNames["eyeRight8"]="RightFaceLed7"

            ledsNames["eyeLeft1"]="LeftFaceLed1"
            ledsNames["eyeLeft2"]="LeftFaceLed8"
            ledsNames["eyeLeft3"]="LeftFaceLed7"
            ledsNames["eyeLeft4"]="LeftFaceLed6"
            ledsNames["eyeLeft5"]="LeftFaceLed5"
            ledsNames["eyeLeft6"]="LeftFaceLed4"
            ledsNames["eyeLeft7"]="LeftFaceLed3"
            ledsNames["eyeLeft8"]="LeftFaceLed2"

            self.CreateBaseEyeStates()

            th = Thread(target=self.eyesCycle)
            th.start()

            #self.nao.NotifyEyeShapeList(self.savedStates.keys())

        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:76,代码来源:eyesModule.py

示例9: BehaviorModule

# 需要导入模块: from naoqi import ALProxy [as 别名]
# 或者: from naoqi.ALProxy import version [as 别名]
class BehaviorModule(object):
    nao = None
    proxy = None
    stopProxy = None
    goingIdle = False

    bShutdown = False
    _autoIdle = False
    #_resetBehavior = "resetPose"
    _resetBehavior = ""
    _shutdownBehavior = "endPose"
    _idleBehavior = "idle"
    _basePoseBehavior = "basePose"

    def __init__(self, naoServer):
        global instance
        instance = self
        self.nao = naoServer
        return

    def start(self):
        log("Connecting BehaviorManagerProxy...")
        try:

            #global myBroker
            #myBroker = ALBroker("behaviorBroker", "0.0.0.0", 0, self.nao.brokerIp(), self.nao.brokerPort())

            self.proxy = ALProxy("ALBehaviorManager")
            self.stopProxy = ALProxy("ALBehaviorManager")
            log(self.proxy.version())

            self._currentBehavior = ""
            self._nextBehavior = ""
            self._currentBehaviorId = None
            self._nextBehaviorId = ""
            self._stopBehavior = False
            self._idle = False

            self.runningBehaviors = []

            
            self._behaviors = self.proxy.getInstalledBehaviors()
            print "DEBUG>> loaded installed behaviors: "+str(len(self._behaviors))

            counter = 0
            for b in self._behaviors:
                counter = counter + 1
                print "DEBUG>> Preloading: "+str(counter)+"/"+str(len(self._behaviors))+" "+str(b)
                self.proxy.preloadBehavior(b)
            print "DEBUG>> Behaviors preloaded"

            self.nao.memory.proxy.subscribeToEvent("BehaviorsRun","BehaviorWatcher","onBehaviorRun")
            print "DEBUG>> Subscrived to event"

            if (self._resetBehavior in self._behaviors):
                self._nextBehavior = self._resetBehavior

            th = Thread(target=self.behaviorCycle)
            th.start()
            print "DEBUG>> Started thread behavior cycle"

            stopth = Thread(target=self.stopCycle)
            stopth.start()
            print "DEBUG>> Started thread stop cycle"
            self.nao.NotifyAnimationList(self._behaviors)

        except Exception, Argument:
            log("Failed: " + str(Argument))
            self.proxy = None
            return False
        return True
开发者ID:emote-project,项目名称:Scenario1,代码行数:73,代码来源:behaviorModule.py


注:本文中的naoqi.ALProxy.version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。