You can get rid of min_dist and you don't need to assign flaot(inf) to d if you just calculate all the distances from points to d (list) and later use min(d) where necessary.
This does not seem relevant: if d <= self.local_path_length: we already checked that they intersect with local_path_buffer so the min(d) must be within local_path
The original idea was to check if intersects then do intersection with convex hull (not just points like you are doing) and use the resulting polygon points from intersection. Currenlty the problem can be if object is big and original convex hull points are outside the local_path_buffer - then there will be no intersection! But there would be intersection between 2 polygons.
In the following part: https://github.com/AnishShr/autoware_mini_practice/blob/d925e1e517a6656f8355264a1323ff155cd0e166/practice_6/nodes/planning/local/simple_local_planner.py#L144-L170
min_dist
and you don't need to assignflaot(inf)
tod
if you just calculate all the distances from points tod
(list) and later usemin(d)
where necessary.if d <= self.local_path_length:
we already checked that they intersect withlocal_path_buffer
so themin(d)
must be withinlocal_path
if intersects
then dointersection
with convex hull (not just points like you are doing) and use the resulting polygon points fromintersection
. Currenlty the problem can be if object is big and original convex hull points are outside thelocal_path_buffer
- then there will be no intersection! But there would be intersection between 2 polygons.