-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Python bindings for ControllerClient #384
Conversation
|
||
cdef class ControllerClient(object): | ||
def __cinit__(self, sub_conn_uri, push_conn_uri, timeout = 0.0): | ||
self.impl = new c_mc_control.ControllerClient(sub_conn_uri, push_conn_uri, timeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same encode
trick can be used here for sub_conn_uri
and push_conn_uri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in b44c05a
Thanks @mmurooka I think that except for the usability issue with passing bytes instead of strings, which can be worked around using the |
Co-authored-by: Pierre Gergondet <pierre.gergondet+github@gmail.com>
657fe7c
to
b44c05a
Compare
Thanks @gergondet I updated it to allow strings |
Added --- - [bindings] Add bindings for ControllerClient (#384) - [mc_rtc] Allow to override existing log entries (#383) - [mc_rtc] Allow "chunky" XY plot updates (#386) - [mc_solver] ConstraintSet now has an update mechanism (#381) - [Samples: CoM] Support the Pepper robot Changes --- - [StabilizerTask] Improve force distribution and CoP horizon reference (#375) - [mc_rbdyn] Convex objects are now automatically updated (#385) - [mc_solver] Collision constraint automatically display distance arrows when the distance falls below the interaction distance (#381) Fixes --- - [bindings] Fix build for Cython >= 3.0.0 - [cmake] Fix issue with yaml-cpp >= 0.8.0 - [mc_control] Fix logging of plugin performances (#383) - [mc_observers] KinematicInertial uses function from state-observation (#388) - [mc_rbdyn] Fix loading of devices with canonical robots (#379) - [mc_rbdyn] Fix compilation with geos >= 3.12.0 - [Replay] Fix output replay on fixed-based robots - [Replay] Avoid precision issue when comparing controller timestep with replay timestep
This is just an introduction to a new feature I am experimenting with right now. I thought it was interesting and will submit a PR, but it may not necessarily need to be merged.
I thought it would be useful If we could send commands (walking, reaching, etc.) of mc_rtc controller from a Python script or interpreter, and I realized this by using Python bindings in ControllerClient. This PR adds that bindings.
This allows the Python interpreter to send walking and gripper opening/closing commands, as shown in the video below, using BaselineWalkingController as an example. (BaselineWalkingController does not require any changes for this purpose.) In addition to calling it from the interpreter, it will be easy to determine the destination of a walk based on the results of a deep learning model and send walking commands in a Python script.
BWC-PythonClient-20230815.mp4
Here is the ControllerClient wrapper for Python.