ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.28k stars 9.72k forks source link

Visualize HD map in Dreamview #13916

Closed trieuthachvu closed 2 years ago

trieuthachvu commented 3 years ago

Hi,

As I understand, with IMU sensor and GPS sensor data from LGSVL. When we turn on the localization module on the dreamview the HD map will be visualized with the ego vehicle on it. I want to do the same for another simulator. Below are my IMU and GPS sensor data I have image

IMU image

GPS image

My questions:

  1. With above data, is that enough to get the localization module working and HD map visualization on Dreamview?
  2. Which setup mode can I use? is it possible to use Mkz Standard Debug? is Mkz lgsvl only built for LGSVL simulator? My setup: I feed IMU sensor data and GPS sensor data to Cyber channels like above. Loading the dreamview then selecting my testing HD map. I chose Mkz Standard Debug for setup mode. However, every time I drag the localization module on it automatically switches back to off? Do I have to build my own setup mode? I saw the files of setup mode somewhere before but I do not remember where is it in the apollo directory. Anyone know please help.
daohu527 commented 3 years ago

suggestion

You don't need to modify setup mode, use Mkz lgsvl will work. You only need to modify the gps message

You need three below topic

/apollo/sensor/gnss/corrected_imu
/apollo/sensor/gnss/odometry
/apollo/sensor/gnss/ins_stat
trieuthachvu commented 3 years ago

Thanks for your information. Could you please give me some hint regarding topic ins_stat image

I fail to understand ins_status and pos_type. From Cyber_monitor, I capture data from LGSVL, ins_status = 3 and pos_type = 56. These data do not change when the ego vehicle moves. Where these data come from? image

daohu527 commented 3 years ago

which apollo version do you use, I found above 5.0 the message is below type https://github.com/ApolloAuto/apollo/blob/259756578b4c01ee07b98f72ab9f874818bee200/modules/drivers/gnss/proto/gnss_status.proto#L19-L34

so the type is a enum, for example type = 2 is GOOD

trieuthachvu commented 3 years ago

I use apollo 6.0, I thought messgage InsStat have nothing relating to message InsStatus Anyways, I set it as 2 "GOOD" to perform the test. This is my localization pole image The dreamview is now visible but the HD map is not there image

I am not sure if the problem is because of HD map. I try to figure out where is the problem come from If I turn on the Sim Control. It is able to load HD map. I also set the destination and run the simulation. It works fine. does it mean the HD map working fine? if so then maybe something wrong or missing with IMU and GPS data. image

image

daohu527 commented 3 years ago

Yes, sim_control will automatically find nearby road and load it, I think you need to check the location of the gps

trieuthachvu commented 3 years ago

Yes, it is right. I take the position data from Sim Control and feeding it to localization module. I am able to see the HD map. I try to change my simulator to different coordinates but still not able to get similar position as Sim Control.

I have a question regarding the system coordinates (Inertial/GPS(Geo)/Vehicle coordinates). My simulator supports to output data in different coordinates. In apollo Cyber message apollo::drivers::gnss::Imu, look like it is in vehicle coordinates image

apollo::localization::Gps and apollo::localization::CorrectedImu look like it is in Inertial coordinates.

image

Does it have to be like GPS (must be in Geo Co-ordinates) and IMU (in Inertial)?

I found in Apollo documents, y axis point out the front of vehicle. image

but in my simulator systems, it is x axis pointing out the front of vehicle image

In addition, is there any chance that when I convert standard OpenDrive to Apollo HD map, the coordinates and origin are also changed ?

daohu527 commented 3 years ago

I think the car body coordinate affects the perception module but not localization.

localization is an UTM coordinate, so I think you should check the simulation is output UTM but not gps. Here is a doc

trieuthachvu commented 3 years ago

You are right, it does not impact on GPS location. If x, y & z positions on HD map have the same unit as meter (m) then I found there is a mismatch on the map location between the map on simulator and the HD map

image image

daohu527 commented 3 years ago

mismatch

  1. apollo use UTM coordinate, and it have a map we call apollo-hd-map.
  2. simulation have a model map we call simulation-map. It is usually a relative position map, so the simulator will add rotation and translation and convert it into gps coordinates

So I guess there is no good match between the two. I don't know how the map in your simulator and the map of Apollo are generated. There may be a problem!!!

trieuthachvu commented 3 years ago

Yes, my simulator use cartesian xyz. look like I got to convert cartesian to lat long (geo) then to UTM by using proj4 string. although I do not really understand proj4.

ntutangyun commented 2 years ago

Hi, check out this website.

https://ntutangyun.github.io/apollo-hd-map-viewer/

you may simply upload the base_map.bin to visualize it.