gazebosim / gazebosim/sdformat
parser_urdf: ReduceSDFExtension*FrameReplace functions are broken in libsdformat10+
- Dominant language
- C++
- Stars
- 216
- Forks
- 125
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 14
Description
## Environment
* OS Version: tested on macOS 10.15 but I expect it's a problem on Ubuntu as well
* Source or binary build? both source and binary for any version newer than 10.0.0
## 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.
* Expected behavior: `ReduceSDFExtension*FrameReplace` functions should take effect on blocks of SDFormat contained in links that are consolidated via fixed-joint reduction.
* Actual behavior: These functions are not taking effect since the tinyxml2 migration occurred in #264
## Steps to reproduce
1. Add relevant SDFormat blocks to a test URDF like [fixed_joint_reduction_plugin_frame_extension.urdf](https://github.com/ignitionrobotics/sdformat/blob/c02e63d212e1b7b72dcd87de76dd9ba3fe73dcf6/test/integration/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:
* [ ] ReduceSDFExtensionContactSensorFrameReplace
* [ ] ReduceSDFExtensionGripperFrameReplace
* [x] ReduceSDFExtensionJointFrameReplace https://github.com/gazebosim/sdformat/pull/1089
* [x] ReduceSDFExtensionPluginFrameReplace #745
* [ ] ReduceSDFExtensionProjectorFrameReplace
Contributor guide
Research direction
Start in parser_urdf.cc and inspect the remaining ReduceSDFExtensionContactSensorFrameReplace, ReduceSDFExtensionGripperFrameReplace, and ReduceSDFExtensionProjectorFrameReplace functions, comparing them with the fixed-joint reduction behavior described in fixed_joint_reduction_plugin_frame_extension.urdf. Run the URDF conversion with ign sdf -p and add or update tests so each relevant bodyName is changed from the consolidated child link to the parent link.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100