Skip to content

Add RPyC server/client API#529

Merged
fredroy merged 2 commits intosofa-framework:masterfrom
bakpaul:25_08_add_rpyc_server
Sep 3, 2025
Merged

Add RPyC server/client API#529
fredroy merged 2 commits intosofa-framework:masterfrom
bakpaul:25_08_add_rpyc_server

Conversation

@bakpaul
Copy link
Contributor

@bakpaul bakpaul commented Aug 19, 2025

this PR adds Client and Server classes offering a SOFA oriented API using RPyC (https://github.com/tomerfiliba-org/rpyc) to launch scenes in subprocess or remotely in another server while still being able to control it (step the simulaiton, get access to any data, modify any data).

For local use (on same computer), a mechanism of shared memory is provided. It is very simple and allow for very fast launch of scene.

Two examples are provided. One launching a scene that is defined in a file that should be accessible by the server (so somewhere on the server side), and one using a local method.
Some limitations of RPyC make it not 100% transparent, e.g. serialization of list of String doesn't work well with SP3 somehow, adding some constraint on how you can interact with the simulation remotely. But the main point of this: getting arrays of positions and whatsoever is working just fine.

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
@fredroy fredroy merged commit 2a6f73e into sofa-framework:master Sep 3, 2025
4 checks passed
RafaelPalomar pushed a commit to Slicer/SofaPython3 that referenced this pull request Jan 28, 2026
* Add RPyC server/client and examples

* Apply suggestions from code review

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>

---------

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants