Closed eisoku9618 closed 8 months ago
I converted this PR to a draft unless review is done.
@ziyan Could you review this change? Currently ReadKinBodyJSON()
has an unspoken restriction that ignores transform info found in non first body even when the first body does not have transform info, but I think that it is not intentional.
body = env.ReadKinBodyJSON({'unitInfo': {u'lengthUnit': u'm'},
'bodies': [{'name': 'eisoku', 'referenceUri': '#ziyan'},
{'id': 'ziyan', 'transform': [1, 0, 0, 0, 2, 2, 2], 'links': [{'mass': 100}]}
]},
{'openravescheme': 'mujin'})
body.GetTransformPose()[4:]
-> should return [2, 2, 2] but returns [0, 0, 0]
body = env.ReadKinBodyJSON({'unitInfo': {u'lengthUnit': u'm'},
'bodies': [{'name': 'eisoku', 'referenceUri': '#ziyan', 'transform': [1, 0, 0, 0, 1, 1, 1]},
{'id': 'ziyan', 'transform': [1, 0, 0, 0, 2, 2, 2], 'links': [{'mass': 100}]}
]},
{'openravescheme': 'mujin'})
body.GetTransformPose()[4:]
-> returns [1, 1, 1] as expected.
Actually in your first example, body
is pointing to eisoku
, so translation of [0,0,0]
is expected
@rdiankov I see, so the behavior that not specifying transform (and name as well) in the first body is equal to specifying [1, 0, 0, 0, 0, 0]
(empty string for name) is intentional. Thank you.
Is it "expected"? Seems odd to me.
I would expect it inherits the transform.
Remove unnecessary code from
JSONReader::_Extract()
pipelineid=435316