Skip to content
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

Fix bug in GetUrdfService move_group capability #2669

Merged
merged 6 commits into from
Feb 7, 2024

Conversation

sjahr
Copy link
Contributor

@sjahr sjahr commented Jan 30, 2024

Description

The capability did not take into account that it is possible to have link elements that close with "/>". This PR fixes that

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

@henningkayser henningkayser self-requested a review January 30, 2024 15:35
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (d962501) 50.74% compared to head (0d934f7) 41.08%.
Report is 2 commits behind head on main.

❗ Current head 0d934f7 differs from pull request most recent head 4431877. Consider uploading reports for the commit 4431877 to get more accurate results

Files Patch % Lines
...default_capabilities/get_group_urdf_capability.cpp 0.00% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2669      +/-   ##
==========================================
- Coverage   50.74%   41.08%   -9.66%     
==========================================
  Files         392      690     +298     
  Lines       32553    56233   +23680     
  Branches        0     7288    +7288     
==========================================
+ Hits        16517    23099    +6582     
- Misses      16036    32971   +16935     
- Partials        0      163     +163     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EzraBrooks
Copy link
Member

Reading and writing an XML document with substringing and string concatenation seems very fragile. Using something like TinyXML2 would avoid parsing mistakes like this in the future.

@sjahr
Copy link
Contributor Author

sjahr commented Jan 31, 2024

Reading and writing an XML document with substringing and string concatenation seems very fragile. Using something like TinyXML2 would avoid parsing mistakes like this in the future.

I tried tinyxml2 first but I had a really hard time using it (very little documentation and bad error messaging) and it did not succeed in the end. If we allocate more time for this, I could give it another try but for now I think we should fix this.

@henningkayser
Copy link
Member

Isn't there a way to implement the same thing just using urdfdom? It seems very odd to me that we have to run manual xml string parsing and editing.

@sjahr
Copy link
Contributor Author

sjahr commented Feb 1, 2024

#2669 (comment)

Looks like it is possible to export the parsed model to a TiXmlDoment type (tinyxml, not tinyxml2!) but not to a string :/ I guess creating a submodel from a given URDF is not a common usecase 🤷

@marioprats
Copy link
Contributor

This PR LGTM since it's fixing a bug in code that is already there.
Maybe merge this in but open an issue to improve it using urdfdom or existing xml parsing libraries, for when we get to it?

@sjahr sjahr enabled auto-merge (squash) February 7, 2024 15:14
@sjahr sjahr merged commit 4b628b0 into moveit:main Feb 7, 2024
10 of 11 checks passed
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.

5 participants