rdiankov / openrave

Open Robotics Automation Virtual Environment: An environment for testing, developing, and deploying robotics motion planning algorithms.
http://www.openrave.org
Other
687 stars 340 forks source link

WIP: initialize __mapReadableInterfaces on InitFromKinBodyInfo #1315

Closed eisoku9618 closed 9 months ago

eisoku9618 commented 9 months ago

InitFromKinBodyInfo() updates readable interfaces (i.e. keeps existing readable interfaces unless specified), but I think it should initialize them because the function name contains Init instead of Update.

body = RaveCreateKinBody(env, '')
kbi = KinBodyInfo()
kbi.DeserializeJSON({'readableInterfaces': {'new': 'hoge'}})
body.SetReadableInterface('old', stringreaders.CreateStringReadable('old', 'fuga'))
body.InitFromKinBodyInfo(kbi)
body.GetReadableInterfaces()

For example, body should have new readable interface only in this case.

We should initialize readable interfaces not only for InitFromKinBodyInfo() but also for the other InitXXX such as InitFromBoxes().

rdiankov commented 9 months ago

Thanks