Several PoppyHumanoid objects and stop_sync

While working on the webapp project, I have to create some PoppyHumanoid Python objects to interact with the robot I start wondering what happens if I have several PoppyHumanoid objects in parallel (example: I have some code running and want to use the webapp in the same time).

From what I understand now, when a PoppyHumanoid object is created, it opens the ports to communicate with the Dynamixel and no one else can use them. Is that right ? Shouldn’t we imagine an architecture where one main program has access to the ports and the ‘user programs’ (using PoppyHumanoid objects) send requests to the main program that send them through the ports ?

Or, at least, I would like a PoppyHumanoid object able to release the port and re-take it later.

On my little tests on this, I saw the start_sync and stop_sync functions. What do they exactly do ? The stop_sync function never returned in my tests…

Right indeed.

There is a “close()” method: robot Package — pypot 3.1.3 documentation
but it is not equivalent to a “pause()” method as you would like.

Yes agreed! I guess you could use the remote robot class to do this. But having a better integration would definitely be a plus!

Ante scriptum: URGENT, Innorobo is coming !

Hello,

I’m investigating again the ways to close the ports. robot.close() calls stop_sync(), which never returns…
I tried only the line [c.io.close() for c in poppy._controllers], it gives me lots of Exception and not better.
del poppy does not release the port either…

This is important because I want to use several different iPython notebooks and maybe some external Python scripts so I need to be able to close the connection from one notebook before starting another one.

Normally when you restart a ipython notebook it kills all connections and you can open another without any problems.

I do like this all the time.

You’re right, it works. Maybe I didn’t wait the few seconds needed to close connection last time I tested.

So, no more urgent problem but it still doesn’t explain while stop_sync never returns…