-
Notifications
You must be signed in to change notification settings - Fork 48
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 gazebo_yarp_robotinterface plugin #532
Conversation
f00a5b4
to
b6a5ebc
Compare
I have the following question: what is the purpose of this piece of code, extracted from gazebo-yarp-plugins/plugins/lasersensor/src/LaserSensor.cc Lines 101 to 112 in 6936859
I was able to attach the robotinterface wrapper by using the name specified by this |
Additionally, in file GazeboYarpPlugins::Handler::getHandler()->setDevice(scopedDeviceName, newPoly.poly); The variable
So it seems that in the controlboard plugin, the device name is not taken from an external parameter, but it is generated internally. |
This was implemented in #419, I guess to support a similar user case of device created in one gazebo plugin and attached to a network server wrapper created in another gazebo plugin. |
However, I thought a bit about the naming aspect and I think a good solution could be:
the The last point probably prevents some corner case uses (such as the use of robotinterface plugin in the parent model that contains two iCub models, for example) but until we have a concrete use case I would focus on implementing our main use case (i.e. a single iCub that runs custom devices in its "yarprobotinterface") easily and in a clean way. |
cc @PeterBowman I do not know if you may be interested in this (as you recently started using the |
Thank you, @traversaro! That is one interesting tool we once decided to set aside due to lack of documentation among others (empty doxy, roboticslab-uc3m/yarp-devices#237), but it's still on our radar now that we are exploring further integration with your codebase. |
This point was fixed by c30b6ab . @randaz81 I also incorporated your other commits, and I prepare a yarp 3.5-compatible version of the branch in https://github.com/robotology/gazebo-yarp-plugins/tree/add-robotinterface-yarp-3.5 . |
The PR is now ready for review, the tests were failing due to fact that the device usage needs to be manually tracked as the plugins in Gazebo are not destructed/unloaded in reverse order, and that was fixed in 2a4bdf1 . |
As you can see by the linked issues, this plugin is an important piece of software that could be used to enable several convenient workflows. For this reason, I will tag a few people that may be affected by this or one of the related issues, and even if I do not list them as a reviewer, feel free to review the PR if you like: @drdanz @randaz81 @gabrielenava @Giulero @lrapetti @HosameldinMohamed @S-Dafarra @GiulioRomualdi @prashanthr05 @Nicogene @elandini84 @diegoferigo @nunoguedelha @Yeshasvitvs . |
Great, now that I fixed the newly added test, the already existing |
The test failures seems flaky and unrelated (see #536). Suppressing the test for now. |
661f7e9
to
c9cf020
Compare
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.
Minor comments mainly regarding debug prints and documentation plus,
- Should we address the commented stray lines in DoubleLaser and LaserSensor source files?
plugins/CMakeLists.txt
Outdated
|
||
if(GAZEBO_YARP_PLUGINS_HAS_YARP_ROBOTINTERFACE) | ||
add_subdirectory(robotinterface) | ||
endif() |
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.
new line ;D
Co-authored-by: Prashanth Ramadoss <prashanthramadoss@gmail.com>
Co-authored-by: Prashanth Ramadoss <prashanthramadoss@gmail.com>
Co-authored-by: Prashanth Ramadoss <prashanthramadoss@gmail.com>
Co-authored-by: Prashanth Ramadoss <prashanthramadoss@gmail.com>
I should have addressed all the comments @prashanthr05 . |
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.
Thank you @traversaro. I have not personally tested the plugin, but overall it looks good to me.
This PR implements a
gazebo_yarp_robotinterface
plugin as it was originally described in #391 . You can find an explanation of the capability of this plugin in the documentation added in https://github.com/robotology/gazebo-yarp-plugins/blob/2a4bdf123d1c87b84a9f79cf2978f61bc100503c/plugins/robotinterface/README.md .This plugin can be helpful in the following use cases:
wholebodydynamics
orcartesiancontrollerserver
that on the real robot are normally spawned with the yarprobotinterface that also creates the devices that communicate with the internal fieldbus of the robot directly in the Gazebo simulation, without the need of running external yarprobotinterface instances as done in https://github.com/robotology/icub-gazebo-grasping-sandbox/blob/89ec286ced316b5a5bc63dc4eb702bd2fbe7e613/scripts/icub-grasp.xml#L18 or documented in https://github.com/robotology/whole-body-controllers/blame/v2.5/doc/How-to-run-controllers-with-gazebo-simulator.md#L21 (Provide simulated iCub models that also spawn wholebodydynamics and cartesiancontrollerserver devices icub-models#84)While the implementation of the plugin is complete and contained in this PR, for fully exploit this plugin it may be necessary to do further modification to other plugins as described in #534 and #535 . However, this improvements can be done in future PRs, as they are independent from the implementation of the
gazebo_yarp_robotinterface
.If you want to test this branch with yarp-3.5, you can check the branch https://github.com/robotology/gazebo-yarp-plugins/tree/add-robotinterface-yarp-3.5 .