DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

/dvs/git/dirty/gitlab-master_av/dw/sdk/samples/localization/README.md
Go to the documentation of this file.
1 # Copyright (c) 2018-2020 NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_maps_localization_sample HD Maps Localization Sample
4 @tableofcontents
5 
6 @note SW Release Applicability: This sample is available in **NVIDIA DRIVE Software** releases.
7 
8 @section dwx_maps_localization_description Description
9 
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.
17 
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.
19 
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.
23 
24 @section dwx_maps_localization_running Running the Sample
25 
26 The shell command for the sample is:
27 
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]
32  --processRate=[int]
33  --printLatency
34  --camera
35  --lidar
36  --radar
37  --gps=[name]
38  --imu=[name]
39 
40 where
41 
42  --threshold=(0,1)
43  Threshold for detections; a larger threshold allows less confident detections to be used
44  Default value: 0.3
45 
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
49 
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
53 
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.
56  Default value: ""
57 
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.
60  Default value: ""
61 
62  --processRate=[int]
63  Frames per second that sample runs at (as computational capacity allows)
64  Default value: 30
65 
66  --printLatency
67  If passed, prints latency statistics to standard output after sample completion
68 
69  --camera
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.
71 
72  --radar
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.
74 
75  --lidar
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.
77 
78  --gps
79  Load all gps sensors who's name attribute in the rig file match this parameter.
80  Default value: ""
81 
82  --imu
83  Load all imu sensors who's name attribute in the rig file match this parameter.
84  Default value: ""
85 
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.
89 
90 @section dwx_maps_localization_output Output
91 
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.
95 
96 @section dwx_maps_localization_colors Color legends
97 
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.
103 
104 ![Localization Sample](sample_localization.png)
105 
106 @section dwx_maps_localization_more Additional information
107 
108 For more details see @ref localization_mainsection .