Description: I create a pcd file by lidar slam, and create a lanelet2 hd map by Autoware online map tool(i double checked my MGRS cooridinate, and i do followed the instruction in lanelet2 provider located in AutowareAuto in map edit part), Then i can run simulation planning and mpc control only rely lanelet2 map and simulation node, seems the map is working and everything working fine now . Then i want to geo-align pcd map and lanelet2 map in rviz just like AVP demo, then i picked a cooridinate(WGS84) in some online map (i double checked the coordinate about latitude/longitude/altitude ), then provide this cooridinate 'param yaml ' for lanelet2 provider and Map publisher node, THEN i launch rviz2, BUT !! THE lanelet2 Marker is not located in MAP origin LIKE AVP DEMO, AND the PCD(viz_ndt_map which published by map publisher) located in map origin.
THE Lanelet2 Marker is 90000m(y), -3000(x)m FAR AWAY from pointcloud map(located in map's frame origin) , anybody can give some clue ?
************** Solution ***************
The lanelet2 is base on an Rough approximation MGRS coordinate, what you should do:
1: transform your MGRS (you uesed to create lanelet2 map) to wgs84 (mgrs_latitude, mgrs_longitude)
2: get real WGS84 coordinate for your map origin (wgs84_latitude, wgs84_longitude)
3: calcuated offset value: offset_latitude = mgrs_latitude - wgs84_latitude, offset_longitude = mgrs_longitude - wgs84_longitude;
4: fill param file for lanelet2_map_provider
pcd map and lanelet2 map are in same coordinate in map frame !
Node: the reason about this is when we createing lanlet2 map, we use Rough approximation MGRS coordinate, but it not real coordinate, since it already wiried in xxx.osm file, we can't modified it, then when we use an real wgs84 coordinate as it's UTM origin, there will generate a huge gap between lanelet2 map and it origin(wgs84 coorinate), but when you add an offset , we change the wgs84 origin to it's creating origin( BUT IT'S STILL NOT TRUE ORIGIN), there is no gap between this two cooridinate.
Originally posted by utopia_david on ROS Answers with karma: 11 on 2021-12-03
Post score: 1
Original comments
Comment by Mike Scheutzow on 2021-12-04:
Please copy/paste your solution into the answer field, and click the checkmark if you want to.
Comment by utopia_david on 2022-01-30:
OK~~~~~~~~~