Fix pybullet block tipping freeze; add GUI entry points to blocks and cover#31
Merged
Merged
Conversation
Boxes created via `create_pybullet_block` were applying the same friction coefficient to lateral, spinning, and rolling channels. With `_obj_friction = 1.2`, a cube that landed on an edge or corner stayed frozen there: spinning/rolling friction supplied a contact torque equal and opposite to gravity's tipping torque, so the cube never settled onto a flat face. `create_pybullet_block` and `create_pybullet_sphere` now apply `friction` only to `lateralFriction`. Spinning and rolling friction are new optional kwargs, defaulting to 0.0 (PyBullet's own defaults). The fan ball and the domino ball — which actually want resistance to spinning around the contact normal — now pass `spinning_friction` explicitly to preserve their prior behavior. Other dynamic bodies benefit from the fix; static bodies are unaffected because PyBullet ignores friction torques on zero-mass bodies. Also add `if __name__ == "__main__":` GUI entry points to `pybullet_blocks.py` and `pybullet_cover.py` (the only concrete pybullet envs that lacked one) so they can be launched as scripts the same way as `pybullet_fan.py`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_pybullet_blockfroze on an edge or corner instead of settling onto a flat face. The helper was applying the env'sfrictionvalue tolateralFriction,spinningFriction, androllingFriction. With_obj_friction = 1.2, the spinning/rolling channels supplied a contact torque equal and opposite to gravity's tipping torque, so cubes never tipped over. The helper now appliesfrictiononly to lateral; new optionalspinning_frictionandrolling_frictionkwargs default to0.0(PyBullet's own defaults).pybullet_fanball andpybullet_dominoball do want spinning resistance, so they now passspinning_friction=...explicitly to preserve prior behavior. Static bodies (mass=0) are unaffected because PyBullet ignores friction torques on zero-mass bodies.if __name__ == "__main__":GUI entry points topybullet_blocks.pyandpybullet_cover.py, the only concrete pybullet envs that didn't already have one. Pattern matchespybullet_fan.py/pybullet_balance.py.