Tencent / TAD_Sim

腾讯自动驾驶仿真系统 TAD Sim (Tencent Autonomous Driving Simulation) 单机版是腾讯自动驾驶以建立更加安全和高效的自动驾驶测试工具为目标, 为自动驾驶系统研发和验证而量身定做的跨平台分布式系统.
Other
256 stars 70 forks source link

系统反算的经纬度存在问题? #67

Open plumewind opened 5 days ago

plumewind commented 5 days ago

你好,

我在导入一个xodr文件(由实际真实环境制作得出),该文件的投影方式是:

<geoReference><![CDATA[+proj=tmerc +lat_0=22.5114810444912479 +lon_0=114.03711701865901 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs ]]></geoReference>

在实际仿真时发现,ego的经纬度信息和实际环境的经纬度信息不相符,经查阅源码,发现经纬度反算好像有问题? 在common/map_sdk/map_import/src/OpenDriveParse.cpp中的170行的get_lane_scale_toEnu函数中:

transform_pts(points);
transform_pts(refs);
for (auto& itPt : points) {
  coord_trans_api::lonlat2enu(itPt.x, itPt.y, itPt.z, refs.at(0).x, refs.at(0).y, refs.at(0).z);
}

这里的计算方式是分别计算points、refs的WGS8经纬度信息,再叠加求解points实际对应的坐标信息。 在opendrive规范中: https://www.asam.net/index.php?eID=dumpFile&t=f&f=3768&token=66f6524fbfcdb16cfb89aae7b6ad6c82cfc2c7f2 比如7.1小节,点坐标是Start position (x inertial)使用惯性系,而惯性系是相对与origin坐标的,需要先计算该offset后,再计算经纬度,不知道上述points的坐标是否考虑这个细节,麻烦您检查一下? 或者指引一下,相关offset计算的代码? 非常感谢~

plumewind commented 4 days ago

界面显示的x,y坐标好像也不太对,同一个xodr文件,分别用两个opendrive文件查看器查看,显示是一致的,但是和TADSIM里不同: http://opendrive.bimant.com/ https://odrviewer.io/

你们可以对比看看~

dongfeng2134 commented 3 days ago

界面显示的x,y坐标好像也不太对,同一个xodr文件,分别用两个opendrive文件查看器查看,显示是一致的,但是和TADSIM里不同: http://opendrive.bimant.com/ https://odrviewer.io/

你们可以对比看看~

每个可视化都有自己的逻辑,tadsim 界面显示时 是 加了偏移,选了地图中心点经纬度映射到屏幕的 0.0

songkeke commented 1 day ago

你的odr文件里,header里是否有东西南北值,tadsim会把他作为整个地图的xy偏移