I've recently discovered your simulator, and was thoroughly impressed with Baidu's Apollo support.
Since then, I've been using the simulator to do some experiments with Apollo 3.0.
However, I'm currently stuck with getting the simulator to work with Apollo 3.0 running MSF localization.
The following are the steps I took in an attempt to get MSF working with the simulator.
local_map using apollo/scripts/msf_local_map_creator.sh with the data I collected from the simulator and configured modules/localization/conf/localization.conf file to make use of the resulting local map.Even with the steps I took above, MSF localization won't work with the simulator.
So my main question is, will this simulator support Apollo's MSF localization?
If the developers had any luck with getting msf to work, can you share your experiences?
Thanks.
Hi @jonghl9
We did try running MSF localization with Apollo and did get it working, but it's not very stable, and it's hard to debug since core algorithm is close-source in Apollo and supplied as pre-compiled binary.
Here are some tips you might find useful:
For creating localization map it's better to use this approach: collect rosbag with gnss odometry, compensated Lidar and ins_stat, then use scripts/msf_simple_map_creator.sh script with the rosbag to create localization map (don't forget to rename / copy resulting lossy_map to local_map). The script needs a folder with rosbag, extrinsics between novatel and Lidar (you can use https://github.com/lgsvl/apollo-vehicle/blob/master/XE_Rigged/velodyne_params/velodyne64_novatel_extrinsics_example.yaml) and UTM zone id, that should be 10 for San Francisco.
You can even try to run Apollo in autonomous mode around the block while collecting rosbag, so you don't have to drive car manually.
You can use MSF visualization tool to check all 3 components (Lidar localization, GPS and INS): enable flags --lidar_debug_log_flag=true --integ_debug_log_flag=true --gnss_debug_log_flag=true in localization.conf
Run ./scripts/localization_online_visualizer.sh - this will open a new window with visualization tool, it will be visible only when it's getting lidar data, so make sure you have bridge and simulator running, it should look like this:

You can try to play with --lidar_map_coverage_theshold=0.8 in localization.conf - this is Lidar localization threshold (how good is Lidar match) and some other parameters, e.g. take a look at this commit: https://github.com/lgsvl/apollo/commit/2c8588668f7cb5763045eb0848adb7a6c196764a
where we disabled a few checks in Apollo code.
Let us know if you have any questions / issues.
And if you find a way to make MSF work reliably with the simulator - pull requests are always welcome :)
Thank you very much for the detailed explanation :) MSF was hard to debug indeed because of the binaries. I'll make sure to make a pull request if I can get MSF to work reliably.
@jonghl9 make sure you have this fix for IMU publishing rate: https://github.com/lgsvl/simulator/issues/138
@andytolst You could try to enable Apollo.Drivers.Gnss.Heading to have a test.
Most helpful comment
Hi @jonghl9
We did try running MSF localization with Apollo and did get it working, but it's not very stable, and it's hard to debug since core algorithm is close-source in Apollo and supplied as pre-compiled binary.
Here are some tips you might find useful:
For creating localization map it's better to use this approach: collect rosbag with gnss odometry, compensated Lidar and ins_stat, then use
scripts/msf_simple_map_creator.shscript with the rosbag to create localization map (don't forget to rename / copy resulting lossy_map to local_map). The script needs a folder with rosbag, extrinsics between novatel and Lidar (you can usehttps://github.com/lgsvl/apollo-vehicle/blob/master/XE_Rigged/velodyne_params/velodyne64_novatel_extrinsics_example.yaml) and UTM zone id, that should be 10 for San Francisco.You can even try to run Apollo in autonomous mode around the block while collecting rosbag, so you don't have to drive car manually.
You can use MSF visualization tool to check all 3 components (Lidar localization, GPS and INS): enable flags

--lidar_debug_log_flag=true--integ_debug_log_flag=true--gnss_debug_log_flag=truein localization.confRun
./scripts/localization_online_visualizer.sh- this will open a new window with visualization tool, it will be visible only when it's getting lidar data, so make sure you have bridge and simulator running, it should look like this:You can try to play with
--lidar_map_coverage_theshold=0.8inlocalization.conf- this is Lidar localization threshold (how good is Lidar match) and some other parameters, e.g. take a look at this commit: https://github.com/lgsvl/apollo/commit/2c8588668f7cb5763045eb0848adb7a6c196764awhere we disabled a few checks in Apollo code.
Let us know if you have any questions / issues.
And if you find a way to make MSF work reliably with the simulator - pull requests are always welcome :)