General Description VectorMapper - AD-EYE/AD-EYE_Core GitHub Wiki

VectorMapper

Welcome to the VectorMapper wiki! You'll find here plenty of useful (hopefully) information about the vector mapping code as well as the Vector Map format itself. Note: At the time of writing, there is not a lot of public documentation available on the vector map format You'll have access here to every bit of knowledge the AD-Eye team discovered on its own (in a grueling process, most of the time). But there are still some parts of the Vector Map format that are unknown. If you happen to have knowledge about the VM format that is not in this wiki, feel free to complete it!

The Format

The VectorMap format defines the road network by breaking down lanes and road edges with Points, which are basically x,y,z coordinate. In our case, those points are never more than 1 meter apart. The VectorMap format links a Node to each point. Those Nodes are then used to define what a Lane is: A Lane in the VectorMap format, is mainly defined by two Nodes, the starting Node of the Lane and the ending Node of the Lane. You'll also find the ID of the Lane located before and after the Lane being defined, as well as the a Junction variable, an integer give you information on the Junction (Normal = 0, Left Branching = 1, Right Branching = 2, Left Merging = 3, Right Merging = 4, Composition = 5) and a Span variable, which tells you the length of the Lane. Every Lanes in the Vmap format is also linked to a DTLane, that gives out even more information on the Lane: The Direction, and total distance travel by the car up until this Lane.

But you can define much more than Lanes using the VMap format: Roadedges for instances, are define using Lines. Lines are basically two points, the starting point of the Line and the ending point of the Lines, and just like Lanes, you'll also find out more information in its definition such as the lines before and after the Line of study.

Lines are also used to define Stop lines, which are linked to a Lane (via a variable called LinkID, which is the ID of the Lane that is linked to the Stopline, and can be linked to a Traffic Light with the variable called TLID. If linked to a Traffic Light, TLID will be equal to one of the three ID representing a traffic light (cf below), and in the case of a standalone stop line, TLID would be equal to 0.

Finally, the Traffic Light is described using something called a Vector : 3 points defining the 3 lights (red, orange and green) coordinates. And just like the stop line, a Traffic light need to be linked to a lane (which will always be the same as its own stop line)

To better understand the VectorMap format, you'll find here an example showcasing our previous explanation more visually.

Images/ExampleVMFormat.PNG

The Code

Images/VMapperGeneralView.PNG

To generate the CSV file refer to https://gits-15.sys.kth.se/AD-EYE/AD-EYE_Core/wiki/Create-a-vector-map

The first module of the Vector Mapper is the Parse module. The Parse module's job is to go and get the relevant information in the PEX File that defines the Road Network (and the entire Simulated World) created in Prescan. Using the Road and the Static Object Modules, that define each road types/static objects that you can find in Prescan using the geometry and some mathematical functions defined in the Path and the Utils Modules, the Parse module will output a Road list containing every Road defined with the relevant geometrical parameters that make the Road Network of our simulated world.

That List is then given to the PreProc Module, which will break the roads into lanes, edges and so on. Then those are fed to the last module, the Vmap Module, that actually "translate" those lanes and edges and center lines in the VectorMap format and export all of those informations in the CSV files.

Reliance on Prescan

The vector mapper heavily relies on the way Prescan structures its pex file. Prescan updates are likely to modify the way elements of a Prescan world are defined in the pex file. As a result, the vector mapper can stop functionning properly due to a Prescan update so it is something to keep in mind while debugging the vector mapper.

If that happens, the modifications to fix the vector mapper are to be done in parse.py since it is the module reading the pex file.