Depth Calculation issue in DIRECT mode; Increasing simulation speed for RL #3613
Replies: 3 comments
-
i find that the engine is not so good at supporting the GEOM_PLANE in DIRECT mode. so the initial state you get is not right. you can try to replace the plane with the box like below. Good luck! |
Beta Was this translation helpful? Give feedback.
-
For fastest reset speed, avoid loading/creating new bodies, but reposition them (pre-create many bodies if different sizes). Keep the unused somewhere far away. It could be a tiny renderer issue, not supporting programmatic creation. I'll look into your file when I find some time. |
Beta Was this translation helpful? Give feedback.
-
@erwincoumans, thank you for your response. Regarding the depth issue in DIRECT mode, when I raised the camera height to 100 units from the base (from the earlier 5), it apparently gave the correct values. Not sure why it fixed that. Does it have to do with the 'near' and 'far' values we set? And thanks for the comment on the speed-up issue. Will give it a shot :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
binpacking.tar.gz
Hi!
I am working on a simulation wherein I have to add various sizes of boxes in a container, one-by-one (please see the attached snapshot). Some points:
First Problem: Depth Issue in DIRECT mode
If I run the 'BinPacking-GUI.py' file, the simulation runs in the GUI mode and it gives me the correct depth map.
Note: I am printing the maximum height from the base i.e. (cameraHeight - depthMap)
For the testing purpose, I was adding boxes of larger height of the container and the code gives correct value.
However, when I run the same in DIRECT mode using 'BinPacking-DIRECT.py' file, it only takes into account the container (which was imported using the SDF file) and completely ignores the boxes being added.
Second Issue: Speeding up simulation
My project involves running a Deep-RL algorithm on this simulation. I only want to add the next box when my current system is stable (there can be cases when one box topples over the other). Thus in line 184, I am running stepSimulation() function for few loops (arbitarily decided). I have also set p.setPhysicsEngineParameter(fixedTimeStep=1/60, numSolverIterations=10), to increase the simulation speed.
However, still it takes approx. 1 sec to add each box in the DIRECT mode. Thus running this simulation for millions of episodes and also adding the time required to train the network, will be huge.
Please let me know, if I am missing something obvious.
Thanks,
Aditya
Beta Was this translation helpful? Give feedback.
All reactions