-
Notifications
You must be signed in to change notification settings - Fork 99
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
Adapt RTDE output recipe based on robot response #221
Adapt RTDE output recipe based on robot response #221
Conversation
This popped into my mind immediately. I think this should not be the default behavior, but some opt-in feature.
This reminds me of our discussion in #213 (comment).
I agree with both. |
That's fair. I'll add a parameter to the
Yes it's definitely related. I feel that auto-negotiating based on the robot response is a bit more flexible than having a fixed list. |
I'd like to avoid adding more parameters to the constructor. In the past this has proven to a) blow up the constructor argument list quite significantly and b) easily introduce troubles in API compatibility which is why we have so many constructors at the moment. With #218 we could create the driver with a minimal recipe and then reset the RTDEClient with the full recipe. In the reset method we could also add a flag for automatically drop incompatible fields. What would you think about that option? |
I agree that adding a parameter to the constructor is not ideal. It's probably a good idea to separate the construction from the configuration of the RTDE communication. I would argue that in this case the constructor should not contain anything related to RTDE anymore. It should be replaced with a distinct The main problem is how do we handle the dependencies between these MRs. I see 3 options:
What's your take on this @urfeex? |
|
I've finished #218. I just need a review from one of my colleagues to get that merged then we can modify this to build upon that. I would suggest adding a flag to the |
Thanks for the follow-up! I am still trying to understand how we can use this |
I was not necessarily having the ROS 2 driver in mind, since you didn't mention that so far. Changing the recipe with the ROS 2 driver will only be useful if the driver is modified, as well, right? I think the recipe we have in there should be rather backwards-compatible. But yes, adding the reset call after the UrDriver object has been created should work. That's also what I implemented #218 for initially. |
That's my bad but yes the ROS 2 driver is the main use case I had in mind for this change.
Given that the recipe used in the ROS2 driver is configurable via the hardware parameters (https://github.com/UniversalRobots/Universal_Robots_ROS2_Driver/blob/main/ur_robot_driver/src/hardware_interface.cpp#L380) any output recipe is actually possible. |
43d652c
to
7d36c20
Compare
Implemented the changes we discussed. Let me know what you think. |
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.
This is looking good, thank you! However, I would prefer making the change in an API compatible manor if possible.
As you've noticed in the tests you had to update the client constructor usages.
If you merge in / rebase onto current master the example runs should also succeed which should give a succeeding pipeline.
7d36c20
to
b9f8484
Compare
Thanks for the comments! Addressed everything in b9f8484. |
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.
This is looking good now, thank you very much!
Not all RTDE outputs are available in all SW versions. When working with a fleet of robots with heterogeneous SW versions it's not practical to have multiple RTDE output recipes to account for this.
This PR aims at solving this problem by adapting the RTDE output recipe on-the-fly based on the robot response to the RTDE request. Outputs which are not available for this particular SW version are simply removed from the output recipe and a trimmed down output recipe is sent to the robot.
Potential issues / improvements:
data_package.cpp
and validate the output recipe beforehand. This seems less flexible though.