gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
169 stars 97 forks source link

parser_urdf should not ignore origin of floating and planar joints #1282

Open scpeters opened 1 year ago

scpeters commented 1 year ago

Desired behavior

While investigating a question related to the reference frame used for floating URDF joints, I noticed that parser_urdf.cc currently takes no action when encountering floating and planar joints (see the switch logic where no value for jtype is set and the subsequent if block). This causes the //joint/origin tag to be ignored for these joint types, when it should be passed along to the SDFormat file in the link pose.

Alternatives considered

Implementation suggestion

Additional context

scpeters commented 1 year ago

A first step towards fixing this would be to add a URDF file with a floating joint that has a non-zero origin to the test/integration folder.

A second step would be to write a test that parses this file and expects the child link of the floating joint to have a pose that matches the value from the floating joint origin.

A third step would be to update parser_urdf.cc to translate the floating joint origin to the child link, perhaps by adding a frame for the floating joint and defining the child link pose relative to that frame.