Start of trail End of trail navigation bar

Table of Contents

GPS NMEA

Reads NMEA-0183 sentences from a GPS receiver and outputs position data.

Beta

This block is currently a beta version because it does not work with all GPS NMEA devices. If you are using this block, we would appreciate any feedback at tech@quanser.com.

Library

QUARC Targets Beta/Devices/Third-Party/NMEA/GPS

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library_beta/Devices/Third-Party/NMEA/GPS')

Description

GPS NMEA

The GPS NMEA block reads NMEA-0183 sentences sent by a GPS receiver over the specified communication channel. GPS position, number of visible satellites, dilution of precision, true/magnetic heading, and ground speed are provided as outputs.

A separate thread is used to read and parse the NMEA sentences sent from the GPS receiver. The most recent GPS data values are then copied when the block executes so that the outputs always represent the most recent data. The data is gathered from the following NMEA-0183 messages: GGA, GLL, GSA, and VTG.

A URI is used to specify the communication protocol and parameters so that data can be received from the GPS.

Input Ports

This block has no input ports.

Output Ports

valid

A Boolean flag that indicates whether the current GPS position data is valid (true) or invalid (false).

latitude

The latitude position of the GPS receiver, given as a double precision value in the format DDMM.MMMM (where D is degrees, M is minutes).

north

A Boolean value indicating whether the latitude position is North (true) or South (false).

longitude

The longitude position of the GPS receiver, given as a double precision value in the format DDDMM.MMMM (where D is degrees, M is minutes).

east

A Boolean value indicating whether the longitude position is East (true) or West (false).

sat_count

An integer indicating the number of satellites used to determine the GPS position.

pdop

The position (3-D) dilution of precision. The PDOP represents a measure of accuracy in the given 3-D position, where a value of 1 is the highest possible confidence level and the confidence level decreases as the PDOP value increases.

hdop

The horizontal dilution of precision. The HDOP represents a measure of accuracy in the given horizontal (latitude/longitude) position, where a value of 1 is the highest possible confidence level and the confidence level decreases as the HDOP value increases.

true heading

The tracked heading based on true North measured in degrees.

magnetic heading

The tracked heading based on magnetic North measured in degrees.

ground speed

The tracked ground speed measured in km/h.

Parameters and Dialog Box

GPS NMEA

URI

The Universal Resource Identifier (URI) that specifies the communication protocol and parameters used for the GPS receiver. For example, a GPS receiver connected to serial port 1 with a baud rate of 9600 would be specified with the URI 'serial://gps:1?baud=9600'.

Priority

The priority of the thread. In general, a value of 0 indicates the lowest priority and higher values indicate a higher priority. The number of priority levels available depends on the type of QUARC target for which code is being generated.

Sample Time

The sample time of the block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time from the input. The block inherits the sample time by default.

To set the sample time to the fundamental sampling time of the model, use the qc_get_step_size function, which is a QUARC function that returns the fundamental sampling time of the model. The fundamental sampling time of the model is the sampling time entered in the Fixed step size field of the Solver pane of the Configuration parameters.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

Yes

Yes

QUARC QNX x86 Target

Yes

Yes

Last fully supported in QUARC 2018.

Rapid Simulation (RSIM) Target

Yes

Yes

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

* Compatible means that the block can be compiled for the target.

See Also

 

navigation bar