openrr / urdf-rs

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

urdf parser not robust #105

Closed Jackiezhou233 closed 1 week ago

Jackiezhou233 commented 1 month ago

I fail to load one urdf file "let urdf_robot = urdf_rs::read_file(path).ok()?;" and get Error: Urdf(UrdfError(Other("invalid float literal"))) The reason is simply because there is one extra space before a float: image maybe add a .trim() before transfer string into float I think this case should be fixed

taiki-e commented 1 month ago

This is actually handled on the XML parser side, so I think it is a problem on their end.

https://github.com/openrr/urdf-rs/blob/5c591db753840a22f5c63cad9684c4fab5e7e745/src/deserialize.rs#L442-L447

However, the XML parser we are currently using has a number of other bugs (https://github.com/openrr/urdf-rs/issues/96) and we are considering switching to another parser.

Using https://github.com/openrr/urdf-rs/pull/98 switching to another parser or the old version of urdf-rs (e.g., 0.6) that used a different parser may handles this as you expect.

taiki-e commented 1 week ago

Fixed in 0.9.0 (#109).