Calc_dist_to_closest_obstacle function

Hi all,
I was a bit confused by how the calc_dist_to_closest_obstacle function is doing in the base_class.py. It seems to only check for circular objects. Normally there are no circular obstacles in the commonroad search and I get a inf.

Right now I have removed the check on line 744: if isinstance(shape_obs, Circle), and the function seems to work better.

2 Likes

Hi,
thanks for pointing that out. I believe this function is not correctly implemented.
If you refer to self.get_obstacles() within calc_dist_to_closest_obstacle(), it shows how to handle obstacles of other classes as well. Either you complete the handling of other classes, or remove the type check for Circle. I belive the former approach will be more robust.