-
Notifications
You must be signed in to change notification settings - Fork 89
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
Support for combined_robot_hw::CombinedRobotHW #42
Conversation
Hey, sorry for the late reply. Thanks for the PR, i should really get better at following up on issues i opened... I don't really like the amount of code duplication here. When i created #34, my plan had a different architecture: We could create a new class (something like
I once threw something like this together and it seemed to work (this is why i created the issue), but i didn't yet create a polished version of this. The advantages i'd see:
I understand you currently have a custom gripper implemented as a subclass of |
I agree with you on the code duplication issue. An adapter is an elegant solution which maximizes the code reuse. I am however unsure if templating is the most idiomatic thing to do here. Alternatively, the adapter could have a
In theory, I think that this can work for me. I am looking forward to your implementation! |
Hey, i created a POC on the 9fb6a76 exports roslaunch ros_control_boilerplate rrbot_combined_simulation.launch As for the design: I decided to stick to a template-based solution. The main reason for this is that this allows you to use the exported interface without any interface-specific code in your Things i don't like right now:
Happy to hear your feedback, if this works for you i'd beautify this some more and create a PR for noetic (which should just get cherry-picked to melodic, this should not require any code change) and merge it after review. |
Seeing your code, I got what you mean with interface-specific code. The export is elegant and definitely works for me! I will still have to test it with my hardware but it compiles and loads the controllers when running it without the hardware. A few thoughts on the things you don't like:
Due to COVID it could take a few days until I'm in my office again where the robot hardware is. |
I have tested it with the hardware today and at the moment I have the weird issue, that the start_controller list is empty when using the gripper in combined mode. It works fine when using it as the good old |
One thing I noticed in the |
Hey, i will work on this more this saturday but to your points:
|
Thanks for your help and suggestions, here is what I found:
You can find my changes here. |
I created a PR with the other implementation approach in #49. I think it's better to discuss that approach over there, so i'll close this PR for now. |
First of all thanks for this library, it really helped setting up my custom gripper.
After a while I figured out that I need to use the
combined_robot_hw::CombinedRobotHW
if I want to pair my gripper with my robot arm.However, the current implementation of the
ros_control_boilerplate::GenericHWInterface
is not compatible with it:init
on the other does not have the required NodeHandle parameters ofhardware_interface::RobotHW
read
andwrite
are fine since the originalhardware_interface::RobotHW
signature calls the simplified versionsModifying the original
ros_control_boilerplate::GenericHWInterface
will certainly break the old API.Thus, I have written a separate
CombinableGenericHWInterface
(isGenericCombinableHWInterface
better?) and opened this pull request.A few things bother me which I would like to discuss:
robot_description
parameter. Of course, a subclass could inject a custom URDF in its constructor andCombinableGenericHWInterface::init
could check if it is available. However, this behaviour is a hidden side effect. An alternative is to create a newloadURDF
method.init
. We could either use theCombinableGenericHWInterface
as base and subclass theGenericHWInterface
from it in an adapter pattern fashion. Alternatively, we could move the functions into some utility header in a more functional fashion. This would require a lot of work, since the methods currently modify a lot of member variables.root_nh
and therobot_hw_nh
are required in theRobotHW
. But, loading the joint names from the parameter server via the namespaced NodeHandle and a hardcoded string feels hacky. In my code I have tried to improve the TODO of @davetcoleman a bit but it still does not feel right since it depends onname_
which has to be loaded in the constructor of the subclass. This is pretty much the same problem as loading the URDF in 1.I'm looking forward to your feedback!