AnishShr / autoware_mini_practice

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

Practice 4 - lanelet2_global_planner - local path has duplicate points #8

Closed geopimik closed 5 months ago

geopimik commented 5 months ago

When I run your code, I get these warning messages in the console:

/home/edgar/.local/lib/python3.8/site-packages/shapely/linear.py:88: RuntimeWarning: invalid value encountered in line_locate_point
/home/edgar/.local/lib/python3.8/site-packages/shapely/linear.py:88: RuntimeWarning: invalid value encountered in line_locate_point

This comes from shapely when you use the project function (synonym to line_locate_point). I think the reason is there:

https://github.com/AnishShr/autoware_mini_practice/blob/5c8d1539daaad6caef1ba55738b713cf215e0ac0/practice_4/nodes/planning/global/lanelet2_global_planner.py#L74-L81

This check at the end does not remove duplicate points because every waypoint is a new instance, and even if the coordinates match, they are still separate instances of the Waypoint() object.

AnishShr commented 5 months ago
  1. For the warnings, I changed the way how the waypoints array is formed to remoe duplciation of the position of waypoints https://github.com/AnishShr/autoware_mini_practice/blob/21d92c582d289c5f9fc24b477ca34f7889b10b66/practice_4/nodes/planning/global/lanelet2_global_planner.py#L80-L84

  2. Changed the class variable type self.goal_pos, so it takes in Point type variable directly. Later in the function lanelet_sequence_to_waypoints, this entire Point variable is modified https://github.com/AnishShr/autoware_mini_practice/blob/c71a69bcfbfb7071c0ed2c2e93e8f80dd1b3e670/practice_4/nodes/planning/global/lanelet2_global_planner.py#L155 https://github.com/AnishShr/autoware_mini_practice/blob/c71a69bcfbfb7071c0ed2c2e93e8f80dd1b3e670/practice_4/nodes/planning/global/lanelet2_global_planner.py#L108-L127

geopimik commented 5 months ago

OK