Balance issue - jBox2d on Android

Hey everyone,

I am a new user to Box2ds forums and have been working quite hard to work on this physics system. I have managed to do quite a bit. I'm currently having a small problem with balancing objects. Currently I have a configuration as such: A balance. The beam and two boxes are dynamic whilst the circle "pivot" is static. The two objects are identically sized and are placed symettrically about the y axis (aka at -20 & at +20). If I'm not mistaken, given no other forces the system should be in a complete balance. I've tried the system with just the beam and pivot point (that is without the two identical boxes). Without the boxes the system doesn't move at all (as it should be). Once I add the two identical objects the system "balance" starts to degrade overtime. Once the boxes are added at the opposite sides of the middle of the beam for the first few seconds of the simulation (< 10s) the system remains in balance. Eventually one side seems to become slightly "heavier" and slowly causes the system to tilt and eventually fall over. I've tried moving the boxes around but no matter what I do this issue creeps up. Is this a common error? What am I missing?
I would guess that it's due to tiny differences in the collision response impulses calculated to push the rod and the boxes apart. The manifold between the rod and the circle has only one contact point so there is nothing for it to be 'compared' against, unlike the box/rod manifold which will have two points and involves some more calculation, so more likelihood for floating point precision issues.
It's quite realistic though isn't it? 🙂
which version of the engine are you using?
Quote:
floating point precision issues

I thought that this was a possible reason. @toucansam I am currently running the 2.1.2.1 test-bed build because a) the 2.1.2.1 normal jar had some logging issue I can't recall and I saw you suggested to another user to rather use the testbed version of the file and b) I tried to use the newest build (2.1.2.2) snapshot with the different jars (library and testbed) and with the newest version the app crashes immediately. I didn't really feel like fixing a totally unrelated issue so I went back to the previous build. Everything works well except for the balance issue. Would the newest build help alleviate this problem?

Original thread: https://box2d.org/forum/viewtopic.php?t=8090