完美解析Opendrive地图格式数据
1.前言
高精度電子地圖也稱為高分辨率地圖(HD Map,High Definition Map),是一種專門為無人駕駛服務(wù)的地圖。與傳統(tǒng)導(dǎo)航地圖不同的是,高精度地圖除了能提供的道路(Road)級(jí)別的導(dǎo)航信息外,還能夠提供車道(Lane)級(jí)別的導(dǎo)航信息。無論是在信息的豐富度還是信息的精度方面,都是遠(yuǎn)遠(yuǎn)高于傳統(tǒng)導(dǎo)航地圖的。 目前市面上提供高精度地圖的廠商有:tomtom、here、百度、高德等。 高精度地圖流行的格式有很多種,有的廠商直接基于rndf地圖增加屬性來制作高精度地圖,也有廠商使用osm格式增加屬性來制作高精度地圖。 對(duì)于ADAS系統(tǒng),則有ADASIS定義了地圖的數(shù)據(jù)模型及傳輸方式,以CAN作為傳輸通道。 OpenDRIVE是一種開放的文件格式, 用于路網(wǎng)的邏輯描述,常用于高精度地圖的制作,百度Apollo則使用基于OpenDRIVE格式改進(jìn)過的高精度地圖。
本文主要對(duì)OpenDRIVE文件格式進(jìn)行簡述,詳情可參考:http://www.opendrive.org/docs/OpenDRIVEFormatSpecDelta_1.5M_vs_1.4H.pdf。
2.正文
OpenDRIVE文件格式為XML,該XML文件種包含了很多地圖信息,如Road、Junction、station等。
主要結(jié)構(gòu)如下:
OpenDRIVE |-header | |-geoReference | |-offset |-road | |-link | | |-predecessor | | |-successor | | |-neighbor | |-type | | |-speed | |-planView | | |-geometry | | | |-line | | | |-spiral | | | |-arc | | | |-poly3 | | | |-paramPoly3 | |-elevationProfile | | |-elevation | |-lateralProfile | | |-superelevation | | |-crossfall | | |-shape | |-lanes | | |-laneOffset | | |-laneSection | | | |-left | | | | |-lane | | | | | |-link | | | | | | |-predecessor | | | | | | |-successor | | | | | |-width | | | | | |-border | | | | | |-roadMark | | | | | | | -sway | | | | | | | -type | | | | | | | | -line | | | | | | | -explicit | | | | | | | | -line | | | | | |-material | | | | | |-visibility | | | | | |-speed | | | | | |-access | | | | | |-height | | | | | |-rule | | | |-center | | | | |-lane | | | | | |-link | | | | | | |-predecessor | | | | | | |-successor | | | | | | |-predecessor | | | | | | |-successor | | | | | |-roadMark | | | | | | | -sway | | | | | | | -type | | | | | | | | -line | | | | | | | -explicit | | | | | | | | -line | | | |-right | | | | |-lane | | | | | |-link | | | | | | |-predecessor | | | | | | |-successor | | | | | |-width | | | | | |-border | | | | | |-roadMark | | | | | | | -sway | | | | | | | -type | | | | | | | | -line | | | | | | | -explicit | | | | | | | | -line | | | | | |-material | | | | | |-visibility | | | | | |-speed | | | | | |-access | | | | | |-height | | | | | |-rule | |-objects | | |-object | | | |-repeat | | | |-outlines | | | | |-outline | | | | | |-cornerRoad | | | | | |-cornerLocal | | | |-material | | | |-validity | | | |-parkingSpace | | | |-markings | | | | |-marking | | | | | |-cornerReference | | | |-borders | | | | |-border | | | | | |-cornerReference | | |-objectReference | | | |-validity | | |-tunnel | | | |-validity | | |-bridge | | | |-validity | |-signals | | |-signal | | | |-validity | | | |-dependency | | | |-reference | | | |-positionRoad | | | |-positionInertial | | |-signalReference | | | |-validity | |-surface | | |-CRG | |-railroad | | |-switch | | | |-mainTrack | | | |-sideTrack | | | |-partner |-controller | |-control |-junction | |-connection | | |-predecessor | | |-successor | | |-laneLink | |-priority | |-controller | |-surface | | |-CRG |-junctionGroup | |-junctionReference |-station | |-platform | | |-segmentA.坐標(biāo)系
最先考慮的應(yīng)該時(shí)坐標(biāo)系的表達(dá)方式,在GIS中一般使用兩種常用的坐標(biāo)系類型:
- 全局坐標(biāo)系或球坐標(biāo)系,例如經(jīng)緯度。這些坐標(biāo)系通常稱為地理坐標(biāo)系。(GCS)
- 基于橫軸墨卡托、亞爾勃斯等積或羅賓森等地圖投影的投影坐標(biāo)系,這些地圖投影(以及其他多種地圖投影模型)提供了各種機(jī)制將地球球面的地圖投影到二維笛卡爾坐標(biāo)平面上。(PCS)
在OpenDRIVE中可表示為:
<geoReference><![CDATA[+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units= m+no_defs]]> </geoReference>從OpenDRIVE 1.4 開始, 可以使用格式化為 “proj4”-字符串的投影定義對(duì)路網(wǎng)進(jìn)行地理參照轉(zhuǎn)化. PROJ 是一種通用坐標(biāo)變換軟件, 它將地理空間坐標(biāo)從一個(gè)坐標(biāo)參考系統(tǒng) (CRS) 轉(zhuǎn)換為另一個(gè)坐標(biāo)參考系統(tǒng)。這包括制圖投影和大地測(cè)量轉(zhuǎn)換。 geoReference元素定義了該文件使用的投影坐標(biāo)系,其中地理坐標(biāo)系為WGS-84。
在OpenDRIVE數(shù)據(jù)中大量使用的位置信息都是投影后的xy坐標(biāo),而除了該投影坐標(biāo)系,還定義了一種軌跡坐標(biāo)系,如下所示,s坐標(biāo)是沿著reference line的,關(guān)于reference line后面介紹,長度是在xy坐標(biāo)下計(jì)算的。 t坐標(biāo),是相對(duì)于reference line的側(cè)向位置,左正,右負(fù)。
B.Road Layout
OpenDRIVE中路網(wǎng)結(jié)構(gòu)中的一個(gè)road,該road有三部分組成,藍(lán)色的reference line,車道lane,車道lane的其他feature(限速等)。
所有道路都由一條參照線組成, 用于定義基本幾何 (弧線、直線等)。沿著參考線, 可以定義道路的各種屬性。這些是, 例如海拔概況、車道、交通標(biāo)志等。道路可以直接連接 (當(dāng)兩個(gè)給定的道路之間只有一個(gè)連接時(shí)), 也可以通過路口 (當(dāng)從某一道路到其他道路有一個(gè)以上的連接時(shí))。
所有屬性都可以根據(jù)本規(guī)范中規(guī)定的標(biāo)準(zhǔn)進(jìn)行參數(shù)化, 也可以通過用戶定義的數(shù)據(jù)進(jìn)行參數(shù)化。
C.Reference Line
整個(gè)地圖路網(wǎng)由很多的road構(gòu)成,而每個(gè)road中都會(huì)包含reference line,就是一條線,它沒有寬度。 reference line,線條有好幾種類型,直線,螺旋線等, The geometry of the reference line is described as a sequence of primitives of various types. The available primitives are:
straight line (constant zero curvature) spiral (linear change of curvature) curve (constant non-zero curvature along run-length) cubic polynom parametric cubic curves
下圖為幾種常見的reference line,注意圖中的兩個(gè)坐標(biāo)系,xy和st
D.Lane
車道是由數(shù)字識(shí)別的, 這些數(shù)字是唯一的 (每個(gè)車道部分, 見下文) - 順序 (即沒有縫隙), - 從參考線上的0開始 - 向左上升 (正 t 方向) - 向右下降 (負(fù) t 方向)
車道總數(shù)不受限制。參考線本身被定義為車道零, 不能有寬度條目 (即其寬度必須始終為 0.0)。
E.Road Linkage
road之間的連接定義了兩種(每個(gè)road有唯一的ID),一種是有明確的連接關(guān)系,例如前后只有一條road,那么通過 successor/predecessor進(jìn)行連接(例如下圖中的road 1和road 2)。
3.總結(jié)
總之,對(duì)于一個(gè)road來說,先確定reference line,有了reference line的幾何形狀和位置,然后再確定reference line左右的車道lane,車道lane又有實(shí)線和虛線等屬性;road 和road之間通過普通連接和Junction進(jìn)行連接,同時(shí)還要將road中的相關(guān)車道進(jìn)行連接
參考文獻(xiàn):
https://ryanadex.github.io/
總結(jié)
以上是生活随笔為你收集整理的完美解析Opendrive地图格式数据的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 博客园 添加 Live 2D 模型
- 下一篇: CTF必备密码编码大全