Sam
Sam

Reputation: 537

Standalone application requires IP to access naoQI API methods

I want to create a session in standalone mode so that I can access the API without priorly assigning any robot API, so I simply want to access the API in order to process the data according to some functions defined in naoQi framework (is that even possible?), what I have tried is this (basically using standalone and ALProxy):

from naoqi import ALProxy
if __name__ == "__main__":
    app = qi.Application(["app", "--qi-standalone"])
    instance_app = myModule(app)
    instance_app.run()


class myModule(object):
    def __init__(self, app):
        super(myModule, self).__init__()
        app.start()
        self.memory = ALProxy("ALMemory")...

But I am getting the following error:

RuntimeError:   proxy::proxy

Could not create a proxy, as there is no current broker in Python's world.

How to circumvent the requirement of entering an IP for the robot to use the naoqi API?

UPDATE: More specifically can I use the ALDialog module API functions without entering the robot IP address?

ALDialog.setLanguage("English")
topicName = ALDialog.loadTopic("/home/nao/aldialog_test_topic_file.top")
ALDialog.activateTopic(topicName)
ALDialog.subscribe("my_setConcept_test")
ALDialog.setConcept("things_you_can_ride", "English", ["bike", "dragon", "unicorn", "double-decker bus"])
try:
    ALDialog.forceInput("I want to ride a double-decker bus")
    ALDialog.forceInput("I want to ride a dragon")
finally:
    ALDialog.unsubscribe("my_setConcept_test")
    ALDialog.clearConcepts()
    ALDialog.deactivateTopic(topicName)
    ALDialog.unloadTopic(topicName)

src: [http://doc.aldebaran.com/2-8/naoqi/interaction/dialog/aldialog-api.html][1]

At the end I want to use the .topic file data so that for each input text, and according to the topic defined, a result is given as text, example:

u:(what's in the fridge) The fridge contains ^size(~fridge) drinks

I want to input the question as text and given the topic file, I would like to get the reply associated e.g., The fridge contains drinks as text [1]: http://doc.aldebaran.com/2-8/naoqi/interaction/dialog/aldialog-api.html

Upvotes: 0

Views: 27

Answers (0)

Related Questions