openrr / urdf-rs

URDF parser for Rust
Apache License 2.0
30 stars 11 forks source link

Make optional/required fields match URDF spec #3

Closed neachdainn closed 4 years ago

neachdainn commented 4 years ago

Closes #2

This strictly follow the specification even when there are sensible default values (e.g., [1.0; 3] for mesh scale). There is, however, one exception: joint limits. Serde's derivation macro can't express that the joint limits are required if the joint is prismatic or revolute but is otherwise optional.

neachdainn commented 4 years ago

Considering the limitations of Serde and its derive macros, I will probably be doing a complete rewrite of this crate without the use of Serde. This will allow for the correct enforcement of the joint limits and also avoid the deserialize-serialize-deserialize chain which is used to work around serde-xml-rs#5. This will also allow users to have foreign/custom tags (e.g., Gazebo tags) in the URDF without accidentally stumbling upon the Serde issues.

I'll do a pull request with my rewritten version eventually as I would rather there not be multiple URDF crates in the Rust ecosystem but I'll understand if you don't want that dramatic of a change.

OTL commented 4 years ago

Merged! Thank a lot for contribution!! I completely understand what you say. I don't care if you create a new urdf crate (If you want). I guess that you can take 'urdf' crate yet.