AnishShr / autoware_mini_practice

Practice Sessions and Labs for the Autonomous Vehicles Project (Autoware mini)
MIT License
0 stars 0 forks source link

Practice 6 - simple_local_planner - simplifying code when adding objects and intersection problem #12

Closed geopimik closed 4 months ago

geopimik commented 4 months ago

In the following part: https://github.com/AnishShr/autoware_mini_practice/blob/d925e1e517a6656f8355264a1323ff155cd0e166/practice_6/nodes/planning/local/simple_local_planner.py#L144-L170

  1. 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.
  2. 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
  3. 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.
AnishShr commented 4 months ago
  1. Removed additional variables like min_dist and assigning floats
  2. Modified the code to ge tthe min distance from closest obstacle exterior coordinates https://github.com/AnishShr/autoware_mini_practice/blob/84b0545f202deb38fdabf1e09150737125080dc0/practice_6/nodes/planning/local/simple_local_planner.py#L158-L170

Git commit: https://github.com/AnishShr/autoware_mini_practice/commit/84b0545f202deb38fdabf1e09150737125080dc0

geopimik commented 4 months ago

ok