semantic_world.collision_checking.trimesh_collision_detector#

Classes#

TrimeshCollisionDetector

Abstract class for collision detectors.

Module Contents#

class semantic_world.collision_checking.trimesh_collision_detector.TrimeshCollisionDetector#

Bases: semantic_world.collision_checking.collision_detector.CollisionDetector

Abstract class for collision detectors.

collision_manager: trimesh.collision.CollisionManager#

The collision manager from trimesh to handle collision detection

sync_world_model() None#

Synchronize the collision checker with the current world model

sync_world_state() None#

Synchronize the collision checker with the current world state

check_collisions(collision_matrix: Set[semantic_world.collision_checking.collision_detector.CollisionCheck] | None = None) List[semantic_world.collision_checking.collision_detector.Collision]#

Checks for collisions in the current world state. The collision manager from trimesh returns all collisions, which are then filtered based on the provided collision matrix. If there are multiple contacts between two bodies, only the first contact is returned.

Parameters:

collision_matrix – An optional set of CollisionCheck objects to filter the collisions. If None is provided, all collisions are checked.

Returns:

A list of Collision objects representing the detected collisions.

check_collision_between_bodies(body_a: semantic_world.world_entity.Body, body_b: semantic_world.world_entity.Body) semantic_world.collision_checking.collision_detector.Collision | None#
reset_cache()#

Reset any caches the collision checker may have.