diff --git a/README.md b/README.md index 74eadd9..f6845a0 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/gym_pusht/envs/pusht.py b/gym_pusht/envs/pusht.py index 73c9a35..b83f250 100644 --- a/gym_pusht/envs/pusht.py +++ b/gym_pusht/envs/pusht.py @@ -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): diff --git a/pyproject.toml b/pyproject.toml index d087a63..5237f5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ", @@ -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}