From 5d9547ed266b650e1679b5d3219693883208f272 Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Wed, 6 Nov 2024 18:02:23 -0500 Subject: [PATCH] Allow collisions between walls in rooms and hallways --- pyrobosim/pyrobosim/core/world.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyrobosim/pyrobosim/core/world.py b/pyrobosim/pyrobosim/core/world.py index 7890198f..b985f018 100644 --- a/pyrobosim/pyrobosim/core/world.py +++ b/pyrobosim/pyrobosim/core/world.py @@ -165,9 +165,7 @@ def add_room(self, **room_config): # Check if the room collides with any other rooms or hallways is_valid_pose = True for other_loc in self.rooms + self.hallways: - if room.external_collision_polygon.intersects( - other_loc.external_collision_polygon - ): + if room.polygon.intersects(other_loc.external_collision_polygon): is_valid_pose = False break if not is_valid_pose: @@ -272,9 +270,7 @@ def add_hallway(self, **hallway_config): for other_loc in self.rooms + self.hallways: if (other_loc == hallway.room_start) or (other_loc == hallway.room_end): continue - if hallway.external_collision_polygon.intersects( - other_loc.external_collision_polygon - ): + if hallway.polygon.intersects(other_loc.external_collision_polygon): is_valid_pose = False break if not is_valid_pose: