-
Notifications
You must be signed in to change notification settings - Fork 11
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
Migrate to quick-xml #98
Conversation
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Thanks! I have tested this with some URDFs, and I found the following two issues:
I believe the first one can be easily fixed (#98 (comment)), but I'm not sure what the second one is yet.
@OTL and I talked about this a while ago and agreed that what is written in the ROS wiki is not a very strict specification and that it is reasonable to follow what is actually supported in the ROS C++ parser. So I think it is okay to allow for the omission of the |
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Thanks for the feedback! I added a I had a look at the second Urdf you found and found the root cause, it is a very sneaky one... here. If you look very closely there is a |
Wow, well spotted! That is indeed somewhat odd as XML/URDF. That said, neither serde-xml-rs, yaserde, nor roxmltree seem to treat that case as an error, and I would definitely like to support that case since that URDF is the one used in the downstream's gallery. |
I'm a bit lost at the options here, there seems to be a PR in the repo about this issue, claiming that it doesn't work with |
Opening for visibility, it "works for me" but I haven't had time yet to write additional extensive tests yet.
quick-xml
uses#[serde(rename)]
by prepending a@
for attributes so it still allows specifying what should be serialize / deserialized into an attribute and what into a child element.Preexisting unit tests work, I extended the test to cover #95 and #94 as well, with only one minor API breakage as denoted here.
We can remove a whole chunk of code for manual serialization / deserialization since
quick-xml
"just works" and doesn't need any of the workaround that either of the previous libraries needed (reordering elements forserde-xml-rs
and serializing complex structs foryaserde
).I'd be happy to have some feedback on what to do with mandatory vs optional fields as denoted in #95 (comment), I can see arguments both ways so anything works really