CollisionDetection Module

class gpdmink.CollisionDetection.CollisionDetection(s_1, s_2)

Bases: object

get_distance()

Get the calculated distance between the two shapes.

Returns:

Distance value (positive if separated, negative if colliding)

Return type:

float

get_necessary_condition()

Get the necessary condition verification value.

Returns:

Verification value for collinearity condition

Return type:

float

get_witness_points()

Get witness points on both shapes and the Minkowski sum.

Returns:

Tuple containing witness points (x_s_1, x_s_2, x_mink)

Return type:

tuple(numpy.ndarray, numpy.ndarray, numpy.ndarray)

is_collide()

Check if the two shapes are colliding.

Returns:

True if colliding, False otherwise

Return type:

bool

opt_callback(x)

Callback function for optimization process.

Parameters:

x (numpy.ndarray) – Current optimization variable

set_transform(linear_1=None, linear_2=None, nonlinear_1=None, nonlinear_2=None, tc_1=None, tc_2=None)

Set transformation parameters for both shapes.

Parameters:
  • linear_1 (numpy.ndarray, optional) – Linear transformation matrix for the first shape

  • linear_2 (numpy.ndarray, optional) – Linear transformation matrix for the second shape

  • nonlinear_1 (dict, optional) – Nonlinear transformation parameters for the first shape

  • nonlinear_2 (dict, optional) – Nonlinear transformation parameters for the second shape

  • tc_1 (numpy.ndarray, optional) – Translation vector for the first shape

  • tc_2 (numpy.ndarray, optional) – Translation vector for the second shape

solve()

Solve the collision detection problem.

Performs the complete optimization process to determine collision status, distance, and witness points between the two shapes.