Aldebaran documentation What's new in NAOqi 2.4.3?

qi.Property API

Introduction

Reference

class qi.Property
addCallback(cb) → int
Parameters:cb – the callback to call when the property changes

add a callback to the property

connect(cb) → int
Parameters:cb – the callback to call when the property changes

add a callback to the property

disconnect(id) → bool
Parameters:id – the connection id returned by connect
Returns:true on success

Disconnect the callback associated to id.

disconnectAll() → bool
Returns:true on success

disconnect all callback associated to the signal. This function should be used very carefully. It’s extremely rare that it is needed.

setValue(value) → None
Parameters:value – the value of the property

set the value of the property

value() → value
Returns:the value stored inside the property

Examples

def myCallback(value):
    print 'value changed to', value

prop = qi.Property()
link = prop.addCallback(myCallback)
prop.setValue(42)
prop.disconnect(link)
print 'value is still', prop.value()