gazebosim / sdformat

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

parser_urdf: ReduceSDFExtension*FrameReplace functions are broken in libsdformat10+ #746

Open scpeters opened 2 years ago

scpeters commented 2 years ago

Environment

Description

While attempting to merge forward #500 from 9 -> 10 (follow-up to #741), I found that the test added in #500 was failing. The test passes on the sdf6 and sdf9 branches, which use tinyxml, but was failing in my first merge attempt to sdf10, which uses tinyxml2. I manually forward-ported a portion of the test for the ReduceSDFExtensionPluginFrameReplace function in parser_urdf.cc in #745 and noticed a problem in the use of the tinyxml2 API in all the ReduceSDFExtension*FrameReplace functions.

Steps to reproduce

  1. Add relevant SDFormat blocks to a test URDF like fixed_joint_reduction_plugin_frame_extension.urdf such that the name of the child link to be consolidated is listed in a bodyName field (for fixed_joint_reduction_plugin_frame_extension.urdf, this would be link2).
  2. Convert the file to SDFormat using ign sdf -p
  3. Expect the bodyName field to be changed to the name of the parent link (for fixed_joint_reduction_plugin_frame_extension.urdf, this would be base_link).

Output

Functions that need a test and fix:

scpeters commented 2 years ago

I've added tests for ReduceSDFExtensionJointFrameReplace in the following branches:

scpeters commented 1 year ago

I've added tests for ReduceSDFExtensionJointFrameReplace in the following branches:

fix in https://github.com/gazebosim/sdformat/pull/1089

scpeters commented 5 months ago

to complete this issue, the fix from #1089 can be applied to the following three functions: