From 58e06a19ffd555f421f1d4a40b1422c95619a5f6 Mon Sep 17 00:00:00 2001 From: Sebastian Castro <4603398+sea-bass@users.noreply.github.com> Date: Wed, 6 Nov 2024 18:13:19 -0500 Subject: [PATCH] Allow collisions between walls in rooms and hallways (#294) --- 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: