Hello! i'm mechatronics and robotics engineer also i'm python expert with +5 years of experience , i have done something like this before to make the robot find the shortest way on the map , it's called RRT algorithm check my profile there's a sample .
best regards,
thank you .