Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@flferretti
Copy link
Collaborator

This PR enable detecting the XML type from the parsed string.

Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @flferretti for this contribution! This PR introduces the automatic detection of either the URDF or SDF type when the model description is a string containing the content. Before this PR, in this case the user had to pass a is_urdf argument.

If the model is a pathlib.Path, we read its extension for the file name, and it cannot be wrong. Having some heuristics on the URDF detection also when the passed description is a string, is definitely useful. However, the proposed solution is very fragile, and I suggested an more robust solution.

Furthermore, I'd not change the APIs by removing entirely the is_urdf argument. With this PR, this argument will be useless in most cases, now extended to models passed as strings. Though, there might be edge cases where forcing either SDF or URDF is still necessary, and I'd suggest to leave this is_urdf argument there to address them. We can update the docstring to something like: Force the SDF resource to be treated as URDF if the automatic detection fails.

@flferretti flferretti force-pushed the feature/auto_sdf_detection branch from e6cf506 to 804b95c Compare September 20, 2024 10:26
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @flferretti for your contribution.

@diegoferigo diegoferigo merged commit 0cc5039 into ami-iit:main Sep 23, 2024
16 checks passed
@flferretti flferretti deleted the feature/auto_sdf_detection branch September 23, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants