Aldebaran documentation What's new in NAOqi 2.4.3?

qi.Session API

Introduction

A session connect to a standalone qi.Session. Once connected the session can:

  • advertise new services using qi.Session.registerService()
  • get services using qi.Session.service()

Reference

class qi.Session

Examples

Getting a service:

import qi

s = qi.Session("tcp://127.0.0.1:9559")
foo = s.service("Foo")

A more explicit example:

import qi

s = qi.Session()
s.connect("tcp://127.0.0.1:9559")

foo = s.service("foo")

Registering a service:

import qi

#sample service doing nothing
class Foo:
  pass

s = qi.Session()
s.connect("tcp://127.0.0.1:9559")

serviceId = s.registerService("Foo", Foo())