add segmask_linkindex.py example using p.getCameraImage(320,200,flags=p.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX)
to extract object unique id and link index from segmentation mask in getCameraImage
This commit is contained in:
@@ -9,21 +9,22 @@ for i in range (10):
|
||||
p.setGravity(0,0,-10)
|
||||
|
||||
|
||||
for i in range (500):
|
||||
p.stepSimulation()
|
||||
#for i in range (500):
|
||||
# p.stepSimulation()
|
||||
|
||||
|
||||
|
||||
saveState = 1
|
||||
|
||||
if saveState:
|
||||
for i in range (500):
|
||||
p.stepSimulation()
|
||||
p.saveBullet("state.bullet")
|
||||
else:
|
||||
p.restoreState(fileName="state.bullet")
|
||||
|
||||
for i in range (10):
|
||||
print("pos[",i,"]=",p.getBasePositionAndOrientation(i))
|
||||
|
||||
#saveState = 0
|
||||
|
||||
#if saveState:
|
||||
# for i in range (500):
|
||||
# p.stepSimulation()
|
||||
# p.saveBullet("state.bullet")
|
||||
#else:
|
||||
# p.restoreState(fileName="state.bullet")
|
||||
|
||||
|
||||
|
||||
while (p.getConnectionInfo()["isConnected"]):
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user