-
Notifications
You must be signed in to change notification settings - Fork 41
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
Proposal: SDFormat URDF Parser Plugin #34
Comments
FYI |
Sounds great! Just to check, is there a minimum set of people that you'd like to hear back on (as a response / upvote in this issue) to consider the proposal accepted? And regarding breakdown, I totally agree with your point in gazebosim/sdformat#265 (an issue which would fall under this proposal)! Do you have an idea of how you'd like to track this as an "epic"? Could we add the relevant subtasks as checkboxes to this issue? (or is too early to consider that?) |
Overall, I like the idea a lot. It adds a new type to the ecosystem while providing backwards compatibility. I think in the future we will probably have to expand "URDF the API" to support more of the features of SDFormat, but we can cross that bridge as we need to. One technical point below.
I have to say that I don't love this practice. It means that there has to be custom logic inside model.cpp for every format we have. But here's the thing; we already have plugins here. We can add a new method to the plugin API like |
that sounds reasonable to me |
Slightly more complex: let each plugin return a confidence value and use the one with the highest value to parse the file. Not sure whether that should include a fall-back strategy (ie: highest confidence fails, try next in line). |
@clalancette, it's not much more work to add a " This proposed distributed decision making does mean we're ceding control for URDF parsing to each of the ecosystem plugins. If any one of them is greedy and snatches up URDF files (intentionally or not), the URDF parser will be starved under the current logic.
This is a really interesting idea, @gavanderhoorn. However, I think I'll leave it for future work. It's worth an issue ticket. |
Yeah, its definitely a risk. But given that we've only had 2 (and now 3) parsers in 10+ years, I think the likelihood of these proliferating and causing that problem is low. |
Does this mean that a developer must choose between Collada, URDF or SRDF? Would it support including multiple different formats within the same file; for example when using the include tag? |
In some sense, there is nothing preventing the parsers from doing that, before or after this change. The "detection" logic really just looks at some header/initial XML tag information to see if it is of the right type. If it is, then it claims it. Whether that parser then supports "including" other file formats is completely up to the parser. That being said, I don't believe that any of the COLLADA, URDF, or SDF parsers currently support this. |
Package name suggestions:
Just want to avoid the generic name, like |
I'm going to lose all naming privileges for this, but since it's like parsing in reverse, we could call it a |
Although I think it is great to add additional support for other formats, but I am not sure what adding SDF parser gets us if the underlining format does not support the much needed features. If the plan is to stick with URDF which I am not against, it may be more beneficial to establish an official specification for the URDF format before adding support for other formats. |
@Levi-Armstrong I think the problem here is one of naming. The name "URDF" is overloaded in the ROS ecosystem. It pertains to two different things:
Currently, the ecosystem supports parsing both URDF and COLLADA for the first item, presenting the results of either of them via the URDF API. What is being proposed here is to also add a SDF parser to that group, and then exposing the data via the URDF API. One thing to be totally clear about is that the URDF API, as it stands, cannot represent all of SDF (or COLLADA, for that matter). But I think we can expand that URDF API over time to accommodate more of SDF as needed. |
This is was the main point I was trying to make. I think it would be best to expand the API and XML format first then incorporate new parsers. I think we have the opportunity to make breaking changes and if we do not take this chance then it most likely will never evolve given past history. I believe the ROS approach is to only make breaking changes between distros, but not sure if that is still the case for ROS2. If this is still the case then that most likely means that it will be at least year before it makes it into the release version. If we wait to expand the API and XML format it will most likely be a few years before it every makes into a release version. |
I guess I don't understand, then. What is being proposed here is a completely new (to ROS) XML format for specifying statics and dynamics. I think that would fall under your "expanding the XML format" category above. Once that is in, the next step may be to deprecate URDF-the-XML format, and officially freeze that. (Whether and how we take that step is up in the air) Orthogonal to this is expanding URDF-the-API so that it can expose/express more of the relationships in any of the formats that we support. Both are valuable, in my opinion, but neither blocks the other. |
I think this can be mitigated by only installing the plugins needed, though I wouldn't rule out also using heuristic here.
This sounds like a good idea for ROS 2 G-turtle and beyond, though there is some motivation to get this into Melodic and Noetic. I'm guessing the current heuristic is to avoid console spam. For existing distros the only solution I see is to keep using a heuristic to guess the parsr. Say How about we prove the concept in existing distros with the heuristic above, then implement it using a new virtual function in the future ones? I think that order is good because the heuristic might still have a place with the new virtual function by avoiding the loading of unused plugins. |
This isn't exactly how I was thinking of That being said, I'm not at all tied to that idea, I just want to make sure we are talking about the same thing.
I understand the desire (particularly about not loading unused plugins), but I was also trying to see if we could get URDF out of the heuristic game. In particular, if someone wanted to come along and add support for another format, it would be nice if they could do so without changing the
I do think this is kind of backwards from our usual development process. In general I like to see if we can do this the right way (for some definition of "right"), regardless of API/ABI problems. We can land that for new distributions. Then I think it becomes clearer how to do it in older distributions (even if we have to have some hacks to preserve API/ABI). |
I think we're talking about the same thing. Given some string, loop over all the plugins to see if they can handle it. If we got rid of the heuristic with only the current API it would mean the loop would have to call
Having a heuristic in |
Somewhat off-topic perhaps, but if we're going to add the discussed loop, please don't use |
Yeah, you are totally right. I threw that out mostly as a joke (that's why I put a question mark in it). I expect whoever writes this for real will make up a better name 😄 |
This issue has been mentioned on ROS Discourse. There might be relevant details there: |
My 2 cents: assuming @IanTheEngineer is willing to do this with his own resources, I don't see any problem with it. I agree with @Levi-Armstrong here are larger issues with URDF and its limitations. But I don't see how that affects this feature addition, beyond the argument that there will just be "more code to port" later. Currently if you want to use SDF with other ROS tools, you have to use SDF's standalone converter to convert it to a URDF, then load it into the rest of the ROS pipeline. This new feature will streamline that greatly. |
This issue has been mentioned on ROS Discourse. There might be relevant details there: |
This issue has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2020-07-16/15468/1 |
Seeking feedback: ros2#13 adds an API |
@IanTheEngineer mind if I close this ticket? This proposal has been implemented and released to ROS Rolling. The code is available here: To try it out, enable the ROS 2 testing repo on Ubuntu Focal, install There's an example of using it here: https://github.com/sloretz/drake_ros2_demos/ |
I think we can close this ticket, well done! The SDFormat model limitations seem reasonable as a first-pass. I think we would need to extend |
As a user of the ROS ecosystem (
robot_state_publisher
,rviz
, etc.), I can currently choose between two file formats to load into aurdf::Model
data structure: URDF or Collada.I propose we add a third valid file format: SDFormat. SDFormat is used by large robotics software projects like Gazebo and Drake. The source code for SDFormat: https://github.com/osrf/sdformat
To be completely clear, this request is not to require
urdf::Model
to support all of the possible permutations of SDFormat tags and topologies, but whatever subset makes sense to fufill the Model API's.The plugin structure is already present and available via
urdf_parser_plugin
. I suggest we add an additional package (very similar tocollada_parser
) :sdformat_parser
At first glance, it seems this would require a
sdformat_parser
package to perform the SDFormat file ->urdf::Model
validation and API population. This new package would supply a Class Plugin:urdf/SDFormatURDFParser
.Then we would just need to add a small amount of extra logic inside
model.cpp
'surdf::Model::initString()
function to detect the presence of anSDFormat
file and invoke the correct plugin class:urdf/urdf/src/model.cpp
Lines 164 to 214 in 4707296
The intent is not to replace URDF or Collada file formats, but to add a third viable file format option for use with
urdf::Model
. With all that said, it seems we can support SDFormat without being disruptive to the rest of the ROS ecosystem.The text was updated successfully, but these errors were encountered: