Closed superfashi closed 1 year ago
The mechanics of ReadRobotJSON
and ReadKinBodyJSON
are not consistent with the other Read functions. For some reason, your implementation requires the parts to be already added to the environment.
The mechanics of
ReadRobotJSON
andReadKinBodyJSON
are not consistent with the other Read functions. For some reason, your implementation requires the parts to be already added to the environment.
Particularly, why is the following code necessary if the body is not in the environment:
+ FOREACH(itviewer, _listViewers) {
+ (*itviewer)->RemoveKinBody(robot);
+ }
The mechanics of
ReadRobotJSON
andReadKinBodyJSON
are not consistent with the other Read functions. For some reason, your implementation requires the parts to be already added to the environment.Particularly, why is the following code necessary if the body is not in the environment:
+ FOREACH(itviewer, _listViewers) { + (*itviewer)->RemoveKinBody(robot); + }
This part of code I just simply copied from other Read[Type]
functions. https://github.com/rdiankov/openrave/blame/production/src/libopenrave-core/environment-core.h#L1747-L1757
About the implementation requires the parts to be already added to the environment, that should not be true. I tested and it can parse with empty environment.
@superfashi if uri
is empty, did you test that the loaded objec'ts GetURI returns just "#XXX"?
thanks~
This PR adds optional
uri
argument forLoadJSON
.It also adds
ReadRobotJSON
andReadKinBodyJSON
for completion.