Fix remaining ReduceSDFExtension*FrameReplace tinyxml2 bugs - #1691
Fix remaining ReduceSDFExtension*FrameReplace tinyxml2 bugs#1691trippyogi wants to merge 2 commits into
Conversation
Follow-up: use-after-free fixAddressed the projector Ready for another look / ASan if convenient. |
|
@trippyogi Thanks for the contribution. Could you fill out the PR template properly? Though we haven't incorporated it in our contribution guidelines yet, the Gazebo PMC has agreed to adopt these guidelines for AI-assisted contributions, so please review that as well. |
Repeat the gazebosim#745/gazebosim#1089 FirstChildElement pattern for ContactSensor, Gripper, and Projector so fixed-joint reduction updates nested SDF extension frame references. Also capture the XMLDocument from the parent blob before DeleteChild (TinyXML2 frees the node). Adds integration URDFs/tests that fail without the FirstChildElement fix. Fixes gazebosim#746 Assisted-by: Cursor (Composer) Signed-off-by: Jeremy <peace@trippyogi.com>
6abc64d to
4ace0b5
Compare
|
@azeey Thanks — done. I refilled the Gazebo bug-fix PR template (summary, backport, checklist) and read the AI-assisted contribution guidelines plus the OSRA generative-tools policy. GenAI use is disclosed with I have not run the full test suite locally; CI will need to cover that. |
🦟 Bug fix
Fixes #746
Summary
ReduceSDFExtensionContactSensorFrameReplace,ReduceSDFExtensionGripperFrameReplace, andReduceSDFExtensionProjectorFrameReplacestill walked the tinyxml2 document instead of the blob root element after the #745 / #1089 fixes for joint/plugin. Nested tags (contact/collision,gripper_link/palm_link, pluginprojector) were never found, so fixed-joint reduction left stale frame names in those extensions.Before: load a URDF that lumps a fixed joint and has one of those nested gazebo extensions referencing the child link — the reduced SDF keeps the child frame name.
After: the helpers take
tinyxml2::XMLElement *, call sites pass(*blobIt)->FirstChildElement(), and the nested tags are rewritten to the parent link. Also grab_blob->GetDocument()beforeDeleteChildin the projector/plugin paths (TinyXML2 frees the node).New integration URDFs + cases in
INTEGRATION_fixed_joint_reductioncover the three leftover helpers. Bazel already globsfixed_joint_reduction*.urdf, so no BUILD change.Backport Policy
Internal URDF-parser helpers only; no public API/ABI change intended. Same class of fix as #745 / #1089.
Checklist
codecheckpassed (See contributing)Assisted-by: Cursor (Composer)
I used Cursor to help draft the patch and tests; I reviewed the diff against the #745/#1089 pattern and TinyXML2’s
DeleteChildbehavior. I have not run the full sdformat C++ suite locally (no Linux build env here) — relying on CI forINTEGRATION_fixed_joint_reduction/ codecheck.Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandAssisted-by/Generated-bymessages.