Collision

class Motion_Planning.Manipulation.Collision.Collision(robot)[source]

A class for handling collision detection.

__init__(robot)[source]

Initializes the Collision class.

Parameters:

robot (Robot) – The robot object.

set_obstacles()[source]

Add obstacles to the scene.

add_obstacle(obstacle)[source]

Add obstacle to the list of obstacles. This is useful for adding a specific obstacle to the list.

Parameters:

obstacle_id – id of the obstacle to add.

remove_obstacle(obstacle)[source]

Remove obstacle from the list of obstacles. This is useful for removing a specific obstacle from the list.

Parameters:

obstacle_id – id of the obstacle to remove.

get_obstacles_info()[source]

Check obstacles in the scene and print them to the console.

setup_collision_detection(self_collisions=True, allow_collision_links=[])[source]

Sets up collision detection.

Parameters:
  • self_collisions (bool, optional) – Whether to check for self-collisions. Defaults to True.

  • allow_collision_links (list, optional) – Links that are allowed to collide. Defaults to [].

is_state_valid(state)[source]

Checks if a given state is valid (i.e., collision-free).

Parameters:

state (list) – The state to check.

Returns:

True if the state is valid, False otherwise.

Return type:

bool