-
Notifications
You must be signed in to change notification settings - Fork 2
Global Planner
We use the XODR-files for getting all information to plan and enhance our route. A XODR-File is a XML-Like file with inforamtion of all roads, lanes, sings and other usefull things.
Instead of just using the middle line geometries from xodr-file, we save an geometry for each lanesection as it can be seen in the picture. Then we connect the geometry by setting weights between them and save it in a Matrix (example Road1_Lane1_Geo1 -> Road1_Lane1_Geo2).
After filling the Matrix we calculate with help of the dijkstra-algorithem the shortest path from start to the end position. Beforehead we calculate in witch point the start and end point is to be located. With this path we then calcualte the resulting waypoints and metadata. Afterwards we combine this two inforamtion and send it to the local planner.
With our implementation you have more oppertunites and slitly more information in comparison to lanelet2. But a lot of black magic is happening in the global planner and we recommend to use a different global planner or the one from the other group.
Details
The XODR file parser uses Python dataclasses for type checking. As a side effect, the data structure is more tangible than before.
Moreover, the route planning was re-written and backed up with test cases to ensure everything works as expected (see following section).
- Issue:
- the function for computing the orthogonal offset was not rotating the vector by 90 deg
- this leads to weirdly shaped polygons that behave differently than expected
- Solution:
- implement the 2D formula for rotating a vector
- add some unit tests to back the logic up
- Issue:
- for route planning, the start and end point need to be assigned to road sections to run the planning algorithm
- but: the bounding boxes were detecting more roads than expected (such as lanes of the oncoming traffic)
- Solution:
- call the bounding box computation with correct parameters
- construct some test cases from a XODR map example
- Issue:
- the map graph wasn't constructed correctly
- for instance, there were incoming edges to the start position and outgoing edges from the target position
- moreover, the edge weights were buggy as well, leading to weird route planning
- Solution:
- re-think the logic and implement it properly
- test the behavior by planning some route examples
- Issue:
- edge weights were computed by adding up distances of road geometries
- but: this accuracy might not be needed and bloats the code unnecessarily
- Solution:
- just use the distance between the start / end point of the road
- Issue:
- the logic for putting the route together was really messy (several hundred lines)
- Solution:
- re-write the logic in a way that actually makes sense
- test the outcome by planning some routes
- Issue:
- the interpolated route might contain waypoints pointing backwards (which confused the vehicle controller)
- Solution:
- forbid overshooting the interpolation interval between 2 points by rounding with floor() instead of ceil()
- the route planner can create routes keeping the lane (don't drive into oncoming traffic)
- the logic is a lot more robust and backed up by some tests
- it's possible to make changes to the Global Planner in ongoing sprints by extending the logic
- there might be more accurate graph edge weights reflecting the actual time to drive a road
- the XODR meta-data (e.g. location of traffic lights / signs) can be parsed and sent to the local planner
- the route planning might be implemented as ROS service
- for further detail, see #41, #42
Details
The global planner consists of the path Provider, Map Manager and a reinforcement learning part.
Plans the route from the Start position to the destination with the given weighed edges from the Map Manager. After calculation the shortest path it sends the Route Info to the local planner.
Saves and calculate weighed Edges and Route info and provide the map for Path Provider.
Planned for later sprints
In every step the weight of a lanelet will be updated. Depending on the actual traffic situation and traffic light situation.
- Opendrive Map
- Landmarks
- Start/ Destination Position
- Route Info: List[Waypoint, actual-lane, possible-lanes, legal-speed, dist_next_Traffic_Light, end_of_Road_section, stop_sign_m]