DriveWorks SDK Reference
3.5.78 Release
For Test and Development only

/dvs/git/dirty/gitlab-master_av/dw/sdk/samples/sensors/gps/README.md
Go to the documentation of this file.
1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2 
3 @page dwx_gps_loc_sample GPS Location Logger Sample
4 @tableofcontents
5 
6 @note SW Release Applicability: This sample is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
7 
8 @section dwx_gps_loc_sample_description Description
9 
10 The GPS Location Logger sample works with any serial port (UART) based
11 GPS sensor or with the Xsens GPS device connected over USB. The logger
12 requires the GPS sensor connected over serial port to deliver messages
13 in NMEA format, while the Xsens device can run in proprietary mode.
14 
15 @subsection dwx_gps_loc_sample_description_interface Interfacing with sensors
16 
17 #### Serial
18 
19 Consumer grade off-the-shelf GPS sensors, also known as GPS mice (e.g.,
20 Garmin GPS), are usually connected over USB and implement a serial-to-USB
21 connection with the help of FTDI devices. The Xsens GPS device can be
22 connected through a serial-to-USB connection.
23 
24 On Linux, these sensors can then be reached over the `/dev/ttyUSB` or
25 `/dev/ttyACM` devices. Before trying out the sample, ensure the user has
26 access to the serial device. You can do so by trying to read from the device
27 e.g. with `cat /dev/ttyACMx`, and if permission is denied, add the current user
28 to the `dialout` group and then log out/in again:
29 
30  sudo usermod -a -G dialout $USER
31 
32 On QNX, prior to accessing the device, launch the `dev-serusb` driver as
33 follows:
34 
35  devc-serusb -b <baudrate> -F -S -d path=/dev/usb/io-usb-otg
36 
37 The serial devices can the be reached over the `/dev/serusb` devices.
38 
39 #### Xsens USB
40 
41 The Xsens GPS device can also be connected directly over USB, but is only
42 supported on Linux.
43 
44 @section dwx_gps_loc_sample_running Running the sample
45 
46 The GPS Location Logger sample, sample_gps_logger, accepts the following parameters:
47 
48  ./sample_gps_logger --driver=[gps.virtual|gps.uart|gps.xsens|gps.novatel|gps.dataspeed|gps.custom|gps.ublox]
49  --params=[comma/separated/key/value/pairs]
50 
51 Where:
52 
53  --driver=[gps.virtual|gps.uart|gps.xsens|gps.novatel|gps.dataspeed|gps.custom|gps.ublox]
54  Allows to specify which GPS driver to use.
55  Default value: gps.virtual
56 
57  --params=[comma/separated/key/value/pairs]
58  Different parameters are available for each GPS driver.
59  Default value: file=path/to/data/samples/sensors/gps/1.gps
60 
61 @note For a full list of key/value pairs that can be passed to --params see @ref dwx_sensor_enum_sample .
62 
63 @subsection dwx_gps_loc_sample_examples Examples
64 
65 #### NMEA format
66 
67 For serial devices transmitting messages in NMEA format, use the `gps.uart`
68 driver. For example:
69 
70  ./sample_gps_logger --driver=gps.uart --params=device=/dev/ttyACM0
71 
72 Per default, if no `baud` parameter has been provided the `gps.uart`
73 driver assumes a baudrate of 9600. In order to change the baudrate provide
74 `baud` argument as:
75 
76  ./sample_gps_logger --driver=gps.uart --params=device=/dev/ttyACM0,baud=115200
77 
78 On QNX, the baudrate is set when starting `devc-serusb`. The `baud`
79 parameter will be ignored.
80 
81 #### Xsens proprietary format
82 
83 The sample supports reading GPS packets from a Xsens device through the
84 `gps.xsens` driver. To run the sample using Xsens over USB device use:
85 
86  ./sample_gps_logger --driver=gps.xsens --params=device=0,frequency=100
87 
88 Where `device=0` parameter sets the index of the Xsens device (usually 0
89 if only one device is installed) and `frequency=100` sets the frequency
90 in `[Hz]` this device should operate with.
91 
92 To run the sample using Xsens over serial use:
93 
94  ./sample_gps_logger --driver=gps.xsens --params=device=/dev/ttyUSB0,frequency=100
95 
96 Please note that even if the Xsens device is a shared device, like Xsens
97 MTi-G-700, capable of delivering GPS and IMU packets, only the GPS packets
98 will be parsed by the `gps.xsens` driver.
99 
100 @note If the device is connected to Xavier UART you need also specify --stop-bits=1
101 
102 #### Sensor sharing
103 
104 The sample also demonstrates how sensor sharing can be implemented.
105 Two NVIDIA<sup>&reg;</sup> DriveWorks GPS sensors are created from the same
106 hardware device. Both sensor can be then treated independently. Both sensors
107 would deliver exactly the same set of packets. Each sensor is using, however,
108 their own FIFO hence they can be drained at different rates. The output of
109 both sensors is printed to the console:
110 
111  GPS[0] - 2712443194 lat: 37.38652333 lon: -122.164585 alt: 46.9 course: 233.9 speed: 0 hdop: 0.8 vdop: 0.8
112  GPS[1] - 2712443194 lat: 37.38652333 lon: -122.164585 alt: 46.9 course: 233.9 speed: 0 hdop: 0.8 vdop: 0.8
113 
114 The index `[0]`, `[1]` indicates what sensor produced the output. As expected the data
115 packets and their timestamps are equal.
116 
117 @section dwx_gps_loc_sample_output Output
118 
119 Any valid GPS message that is received results in an output on the
120 console similar to:
121 
122  GPS[0] - 2712443194 lat: 37.38652333 lon: -122.164585 alt: 46.9 course: 233.9 speed: 0 hdop: 0.8 vdop: 0.8
123 
124 Where the first number indicates the timestamp of the received GPS message in
125 microseconds and the rest of the line indicates the geographical location of the
126 sensor.
127 
128 If no parameters are provided, the sample starts a virtual GPS sensor and
129 interprets the content from the file located at `data/samples/sensors/gps/1.gps`
130 as GPS input.
131 
132 @section dwx_gps_loc_sample_more Additional Information
133 
134 For more details see @ref gps_mainsection .