1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page dwx_gps_loc_sample GPS Location Logger Sample
6 @note SW Release Applicability: This sample is available in both **NVIDIA DriveWorks** and **NVIDIA DRIVE Software** releases.
8 @section dwx_gps_loc_sample_description Description
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.
15 @subsection dwx_gps_loc_sample_description_interface Interfacing with sensors
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.
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:
30 sudo usermod -a -G dialout $USER
32 On QNX, prior to accessing the device, launch the `dev-serusb` driver as
35 devc-serusb -b <baudrate> -F -S -d path=/dev/usb/io-usb-otg
37 The serial devices can the be reached over the `/dev/serusb` devices.
41 The Xsens GPS device can also be connected directly over USB, but is only
44 @section dwx_gps_loc_sample_running Running the sample
46 The GPS Location Logger sample, sample_gps_logger, accepts the following parameters:
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]
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
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
61 @note For a full list of key/value pairs that can be passed to --params see @ref dwx_sensor_enum_sample .
63 @subsection dwx_gps_loc_sample_examples Examples
67 For serial devices transmitting messages in NMEA format, use the `gps.uart`
70 ./sample_gps_logger --driver=gps.uart --params=device=/dev/ttyACM0
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
76 ./sample_gps_logger --driver=gps.uart --params=device=/dev/ttyACM0,baud=115200
78 On QNX, the baudrate is set when starting `devc-serusb`. The `baud`
79 parameter will be ignored.
81 #### Xsens proprietary format
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:
86 ./sample_gps_logger --driver=gps.xsens --params=device=0,frequency=100
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.
92 To run the sample using Xsens over serial use:
94 ./sample_gps_logger --driver=gps.xsens --params=device=/dev/ttyUSB0,frequency=100
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.
100 @note If the device is connected to Xavier UART you need also specify --stop-bits=1
104 The sample also demonstrates how sensor sharing can be implemented.
105 Two NVIDIA<sup>®</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:
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
114 The index `[0]`, `[1]` indicates what sensor produced the output. As expected the data
115 packets and their timestamps are equal.
117 @section dwx_gps_loc_sample_output Output
119 Any valid GPS message that is received results in an output on the
122 GPS[0] - 2712443194 lat: 37.38652333 lon: -122.164585 alt: 46.9 course: 233.9 speed: 0 hdop: 0.8 vdop: 0.8
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
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`
132 @section dwx_gps_loc_sample_more Additional Information
134 For more details see @ref gps_mainsection .