2

I'm experiencing some issues with the naoqi sdk with Choreographe. I need to pass synchronously two or more variables by means of QiChat module to a Python function:

u:(Is someone in _~lab lab working on _~themes) $lab=$1 $themes=$2

or better:

u:(Is someone in _* lab working on _*) $lab=$1 $themes=$2

I have not found anything online, can someone help me?

Thanks in advance

carlocciu
  • 55
  • 5

1 Answers1

2

QiChat raises ALMemory events when a variable is set, but processing ALMemory events is asynchronous, therefore you cannot rely on them in your case.

However, QiChat provides a way to make synchronous calls to any API exposed in NAOqi, using the ^call keyword. You can take advantage of this to call a method you would have exposed in a Python service you would have written yourself. In QiChat you would have something like that:

u:(_$myConcept): alright ^call(MyService.myMethod($1))

I suppose you write your program using Choregraphe, so please note that you already have access to a valid Qi Session in every Python box, by calling self.session().

Victor Paléologue
  • 2,025
  • 1
  • 17
  • 27