Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ array([ 0. , 10. , 57.866196, 50.686398, 1. ],
## Version History

* v0: Original version
* v0.1.6: Added compatibility with pymunk 7.x

## Compatibility Notes

* Compatible with pymunk versions 6.6.0 and higher, including pymunk 7.x
* If you encounter any issues with pymunk 7.x, please report them on our GitHub issue tracker


## References
Expand Down
5 changes: 2 additions & 3 deletions gym_pusht/envs/pusht.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,8 @@ def _setup(self):
if self.block_cog is not None:
self.block.center_of_gravity = self.block_cog

# Add collision handling
self.collision_handeler = self.space.add_collision_handler(0, 0)
self.collision_handeler.post_solve = self._handle_collision
# Add collision handling (compatible with pymunk 7+)
self.space.on_collision(0, 0, post_solve=self._handle_collision)
self.n_contact_points = 0

def _set_state(self, state):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gym-pusht"
version = "0.1.5"
version = "0.1.6"
description = "A gymnasium environment for PushT."
authors = [
"Rémi Cadène <[email protected]>",
Expand All @@ -25,7 +25,7 @@ python = "^3.10"
gymnasium = ">=0.29.1"
opencv-python = ">=4.9.0"
pygame = ">=2.5.2"
pymunk = ">=6.6.0"
pymunk = ">=6.6.0" # Compatible with pymunk 7.x
shapely = ">=2.0.3"
scikit-image = ">=0.22.0"
pre-commit = {version = ">=3.7.0", optional = true}
Expand Down