Skip to content

Commit cf3a416

Browse files
author
Megane Millan
committed
[mjcf] Use the frame of the parent body of the sites
1 parent 34424ab commit cf3a416

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/parsers/mjcf/mjcf-graph.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,12 +1070,13 @@ namespace pinocchio
10701070
rangeCompo.armature;
10711071
}
10721072

1073-
FrameIndex previousFrameId = urdfVisitor.model.frames.size();
1073+
FrameIndex bodyId = urdfVisitor.model.getFrameId(nameOfBody, BODY);
1074+
frame = urdfVisitor.model.frames[bodyId];
10741075
for (const auto & site : currentBody.siteChildren)
10751076
{
10761077
SE3 placement = bodyInJoint * site.sitePlacement;
1077-
previousFrameId = urdfVisitor.model.addFrame(
1078-
Frame(site.siteName, frame.parentJoint, previousFrameId, placement, OP_FRAME));
1078+
FrameIndex previousFrameId = urdfVisitor.model.addFrame(
1079+
Frame(site.siteName, frame.parentJoint, bodyId, placement, OP_FRAME));
10791080
}
10801081
}
10811082

0 commit comments

Comments
 (0)