Skip to content

Commit 7d2718a

Browse files
committed
Fix link pose not exported in sdf dfki-ric#338 (1) dfki-ric#339
Exporting pose relative to root link because gazebo 9 ignores relative_to attribute
1 parent f302b38 commit 7d2718a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

phobos/blender/io/blender2phobos.py

+7
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,18 @@ def deriveLink(obj, objectlist=None, logging=True, errors=None):
430430
annotations[k1] = {}
431431
annotations[k1][k2] = v
432432

433+
root = obj
434+
while sUtils.getEffectiveParent(root) is not None:
435+
root = sUtils.getEffectiveParent(root)
436+
437+
# Exporting pose relative to root link because gazebo 9 ignores relative_to attribute
438+
433439
return representation.Link(
434440
name=obj.get("link/name", obj.name), # this is for backwards compatibility normally the linkname should be the object name
435441
visuals=visuals,
436442
collisions=collisions,
437443
inertial=inertial,
444+
origin=deriveObjectPose(obj, effectiveparent=root),
438445
# [TODO v2.1.0] Add KCCD support
439446
kccd_hull=None,
440447
**annotations

0 commit comments

Comments
 (0)