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 - limiting target velocity #13

Closed geopimik closed 4 months ago

geopimik commented 4 months ago

I would not do it here: https://github.com/AnishShr/autoware_mini_practice/blob/d925e1e517a6656f8355264a1323ff155cd0e166/practice_6/nodes/planning/local/simple_local_planner.py#L212

I would select min target velocity with np.argmin and then check it.

With the current solution, you may have two cars in front of you. One has just passed you, but both drive faster than lane_target_velocity. You would set their target velocities to be equal, and then np.argmin would return the random one (the one with smaller index), and it might not be the closest car, causing a smaller target velocity.

AnishShr commented 4 months ago

Modified the code to take the index of the min trget velocities and set the target velocity https://github.com/AnishShr/autoware_mini_practice/blob/ee48ca45ee8627b7ee1e289695781ef9c0606b4b/practice_6/nodes/planning/local/simple_local_planner.py#L212-L214

git commit: https://github.com/AnishShr/autoware_mini_practice/commit/ee48ca45ee8627b7ee1e289695781ef9c0606b4b

geopimik commented 4 months ago

ok