Export Grasp Poses only for parts with Grasp Poses

This commit is contained in:
Igor Brylyov 2022-03-10 17:00:29 +03:00
parent 20900e4eba
commit b2543c3672

View file

@ -256,10 +256,11 @@ def exportGazeboModels():
config_file.write(GazeboExport.config(obj.Label,
'model.sdf', 'Author', 'Email', 'Comment', 'Version'))
with open(os.path.join(model_dir, 'frames.json'), 'w') as frames_file:
# frames_file.write(json.dumps(parts[obj.Label]["graspposes"]))
json.dump({"features": { "grasp-poses" : parts[obj.Label]["graspposes"]}},
frames_file, indent=1, separators=(',', ': '))
if len(parts[obj.Label]["graspposes"]) > 0:
with open(os.path.join(model_dir, 'frames.json'), 'w') as frames_file:
# frames_file.write(json.dumps(parts[obj.Label]["graspposes"]))
json.dump({"features": { "grasp-poses" : parts[obj.Label]["graspposes"]}},
frames_file, indent=1, separators=(',', ': '))
return True