The localization sample demonstrates how to use the HD map based localization module. The sample shows how to:
By default, the sample application runs on recorded, example data in the Driveworks library. It will localize using the fusion of localizations from a front facing camera and radar data.
Users can also run the sample on their own data by specifying a Driveworks-formatted HD map file and a Driveworks rig file;
the rig file can specify live GPS, IMU, CAN, and video sensors for in-field usage, or recorded files containing the equivalent data.
This sample can run on both RAW and H264 video streams/files.
The shell command for the sample is:
./sample_localization --threshold=(0,1) --rigFile=[path/to/rig/file] --map=[path/to/map/directory or path/to/map/xmlfile] --outputDir=[path/to/output/directory] --processRate=[int] --printLatency --camera --lidar --radar --gps=[name] --imu=[name]
where
--threshold=(0,1) Threshold for detections; a larger threshold allows less confident detections to be used Default value: 0.3 --rigFile=[path/to/rig/file] Rig file containing all information about vehicle sensors and calibration. Default value: path/to/data/samples/samples/localization/rig.json --map=[path/to/map/directory or path/to/map/xmlfile] Map on which to localize. Camera localization can use either path/to/map/xmlfile or path/to/map/directory. Radar/lidar/fusion localizations must use path/to/map/directory. When using path/to/map/directory, the directory must contain core.xml and radar/lidar map layers, when needed. Default value: path/to/sdk/data/hdmaps/nvmap --outputDir=[/path/to/output/directory] When specified, dumps localization output into a /path/to/output/directory/trajectory_[localization_type].txt file and localization covariance output into a /path/to/output/directory/trajectory_uncertainty_[localization_type].txt for each localization type enabled. Default value: "" --processRate=[int] Frames per second that sample runs at (as computational capacity allows) Default value: 30 --printLatency If passed, prints latency statistics to standard output after sample completion --camera If passed, enables camera localization. Requires a specified .xml map or a directory containing a core.xml file and loads all camera sensors specified in the rig. If multiple localizations passed, run fusion of all sensors specified. --radar If passed, enables radar localization. Requires radar map image layer in map directory and loads all radar sensors specified in the rig. If multiple localizations passed, run fusion of all sensors specified. --lidar If passed, enables lidar localization. Requires lidar map image layers in map directory and loads all lidar sensors specified in the rig. If multiple localizations passed, run fusion of all sensors specified. --gps Load all gps sensors who's name attribute in the rig file match this parameter. Default value: "" --imu Load all imu sensors who's name attribute in the rig file match this parameter. Default value: ""
The sample app has keyboard commands:
For more details see Localization .