1 # Copyright (c) 2018-2020 NVIDIA CORPORATION. All rights reserved.
3 @page dwx_maps_localization_sample HD Maps Localization Sample
6 @note SW Release Applicability: This sample is available in **NVIDIA DRIVE Software** releases.
8 @section dwx_maps_localization_description Description
10 The localization sample demonstrates how to use the HD map based localization module.
11 The sample shows how to:
12 1. Appropriately obtain and input synchronized GPS, IMU, CAN front facing camera detections, radar/lidar detections and a dwMap into the localization module.
13 2. Fuse multiple localization modules for different sensors together
14 3. Update the best-estimate of the vehicle position and orientation within an HD map.
15 4. Access the best-estimate of the current vehicle position and orientation.
16 5. Visualize the car's position in an HD map as well as the HD map projected into the front facing camera.
18 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.
20 Users can also run the sample on their own data by specifying a Driveworks-formatted HD map file and a Driveworks rig file;<br>
21 the rig file can specify live GPS, IMU, CAN, and video sensors for in-field usage, or recorded files containing the equivalent data.<br>
22 This sample can run on both RAW and H264 video streams/files.
24 @section dwx_maps_localization_running Running the Sample
26 The shell command for the sample is:
28 ./sample_localization --threshold=(0,1)
29 --rigFile=[path/to/rig/file]
30 --map=[path/to/map/directory or path/to/map/xmlfile]
31 --outputFile=[path/to/output/file]
43 Threshold for detections; a larger threshold allows less confident detections to be used
46 --rigFile=[path/to/rig/file]
47 Rig file containing all information about vehicle sensors and calibration.
48 Default value: path/to/data/samples/samples/localization/rig.json
50 --map=[path/to/map/directory or path/to/map/xmlfile]
51 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.
52 Default value: path/to/sdk/data/hdmaps/nvmap
54 --outputDir=[/path/to/output/directory]
55 When specified, dumps localization output into a /path/to/output/directory/trajectory_[sensor].txt file for each sensor enabled.
58 --outputCovDir=[/path/to/output/directory]
59 When specified, dumps localization covariance output into a /path/to/output/directory/covariance_[sensor].txt file for each sensor enabled.
63 Frames per second that sample runs at (as computational capacity allows)
67 If passed, prints latency statistics to standard output after sample completion
70 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.
73 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.
76 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.
79 Load all gps sensors who's name attribute in the rig file match this parameter.
83 Load all imu sensors who's name attribute in the rig file match this parameter.
86 The sample app has keyboard commands:
87 - Press the space key to start or pause the application.
88 - Press the ESC key to close the application.
90 @section dwx_maps_localization_output Output
92 - Left: the HD map elements projected into the current view from the front facing camera
93 - Right: a bird's eye view of the vehicle's localized position in the HD map. The red axis points forward,
94 the green axis points left, and the blue axis points up.
96 @section dwx_maps_localization_colors Color legends
98 - Blue lines: road boundaries.
99 - Light green lines: non-traversable lane dividers.
100 - Dark green lines: traversable lane divider lines.
101 - Grey lines: local invisible lane divider lines.
102 - Yellow lines: poles, road signs, and traffic lights.
104 
106 @section dwx_maps_localization_more Additional information
108 For more details see @ref localization_mainsection .