-
Notifications
You must be signed in to change notification settings - Fork 18
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
Yarp RPC simulink block #163
Comments
How do you imagine this block to work? RPC and dataflow blocks are fundamentally different paradigm, but indeed there are some convenient ways of combining the two. |
@traversaro The block functionality should be such that at the start of the simulation it connects to rpc port of linkattacher plugin and sends commands to connect then hands of both the agents involved in physical interaction. |
As the logic of this seems quite hardcoded, perhaps a good strategy is to write your own block in your project containing this logic following the example in https://robotology.github.io/wb-toolbox/mkdocs/create_new_library/ and https://github.com/robotology/wb-toolbox/tree/master/example . |
@traversaro thank you |
@Yeshasvitvs @traversaro Yes as discussed f2f before opening the issue, this RPC functionality can be developed in 2 steps:
We should discuss how to implement a timeout in order to avoid that the simulation get stuck if the remote does not return (since RPC usually is a blocking call). A first idea would be spawning a thread for executing the call and wait that it joins or kill it after the timeout, but this would be the only case we use this approach in the entire toolbox. I'm not sure it is the only one. Any idea @traversaro? |
If we just need this at startup (option 1), for the time being I would play it safe and I would just not return from the first loop of simulation until the RPC has returned, or fail the simulation if the RPC did not returned after a timeout. If option 2 is instead chosen, indeed blocking in the middle of the simulation may not be an option, especially when there is no explicit time synchronization. The idea of spawning a specific thread seems good. |
I think we could take inspiration from Simulink's ROS Call Service block https://www.mathworks.com/help/robotics/ref/callservice.html regarding the timing aspects. |
In my opinion this is a simple task for someone that wants to learn how to add a new block (we also have a new tutorial which should cover the entire process). Since it has low priority, I would mark it also as good first issue. |
I will get to this task soon after HDEv2 and before starting the work with the controller |
Great! You'll be the first tester of the new tutorial 😍 |
Summary
A simulink block that provided yarp rpc functionality.
Motivation
Currently, for the pHRI standup experiment in simulation I need to set the robot and the human models to be in an initial configuration and then connect their hands through linkattached plugin. It is currently done through rpc from terminal commands. It will be an asset to have this functionality done through simulink directly.
The text was updated successfully, but these errors were encountered: