or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

core-parsing.mddepth-sonar.mdgps-positioning.mdindex.mdnavigation-course.mdproprietary-sentences.mdstream-processing.mdutilities.mdwind-weather.md

proprietary-sentences.mddocs/

0

# Proprietary Sentences

1

2

Proprietary sentences provide manufacturer-specific extensions to the standard NMEA protocol, allowing GPS and marine equipment manufacturers to include specialized data and functionality.

3

4

## Base ProprietarySentence Class

5

6

```python { .api }

7

class ProprietarySentence(NMEASentence):

8

"""Base class for proprietary manufacturer sentences."""

9

10

manufacturer: str # Three-character manufacturer code

11

data: List[str] # List of sentence field data

12

13

def __init__(self, manufacturer: str, data: List[str]):

14

"""Initialize proprietary sentence with manufacturer code and data."""

15

16

def identifier(self) -> str:

17

"""Return sentence identifier (e.g., 'PGRM')."""

18

```

19

20

## Supported Manufacturers

21

22

### Garmin (GRM)

23

24

```python { .api }

25

class GRME(ProprietarySentence):

26

"""Garmin Estimated Position Error."""

27

28

subtype: str # Message subtype

29

hpe: str # Horizontal position error

30

hpe_unit: str # HPE unit (usually 'M')

31

vpe: str # Vertical position error

32

vpe_unit: str # VPE unit (usually 'M')

33

osepe: str # Overall spherical equivalent position error

34

osepe_unit: str # OSEPE unit (usually 'M')

35

```

36

37

```python { .api }

38

class GRMZ(ProprietarySentence):

39

"""Garmin Altitude Information."""

40

41

subtype: str # Message subtype

42

altitude: str # Altitude value

43

altitude_unit: str # Altitude unit ('f' = feet, 'M' = meters)

44

pos_fix_dim: str # Position fix dimension (2 = 2D, 3 = 3D)

45

```

46

47

### Ashtech (ASH)

48

49

```python { .api }

50

class ASHRPOS(ProprietarySentence, LatLonFix):

51

"""Ashtech Position Message."""

52

53

_r: str # 'R' indicator

54

subtype: str # Message subtype

55

mode: str # Positioning mode

56

sat_count: str # Number of satellites

57

timestamp: datetime.time # UTC time

58

lat: str # Latitude

59

lat_dir: str # Latitude direction

60

lon: str # Longitude

61

lon_dir: str # Longitude direction

62

altitude: str # Altitude

63

course: str # Course over ground

64

spd_over_grnd: str # Speed over ground

65

66

@property

67

def latitude(self) -> float:

68

"""Latitude in decimal degrees."""

69

70

@property

71

def longitude(self) -> float:

72

"""Longitude in decimal degrees."""

73

```

74

75

### u-blox (UBX)

76

77

```python { .api }

78

class UBX00(ProprietarySentence, LatLonFix):

79

"""u-blox Lat/Long Position Data."""

80

81

_blank: str # Blank field

82

ubx_type: str # UBX message type

83

timestamp: datetime.time # UTC time

84

lat: str # Latitude

85

lat_dir: str # Latitude direction

86

lon: str # Longitude

87

lon_dir: str # Longitude direction

88

alt_ref: str # Altitude reference

89

nav_stat: str # Navigation status

90

h_acc: str # Horizontal accuracy

91

v_acc: str # Vertical accuracy

92

sog: str # Speed over ground

93

cog: str # Course over ground

94

v_vel: str # Vertical velocity

95

diff_age: str # Differential age

96

hdop: str # Horizontal DOP

97

vdop: str # Vertical DOP

98

tdop: str # Time DOP

99

num_svs: str # Number of satellites

100

reserved: str # Reserved field

101

```

102

103

### Trimble (TNL)

104

105

```python { .api }

106

class TNLAVR(ProprietarySentence):

107

"""Trimble AVR Message (Attitude and Heading)."""

108

109

_: str # Blank field

110

type: str # Message type

111

timestamp: datetime.time # UTC time

112

yaw_angle: str # Yaw angle in degrees

113

yaw: str # Yaw indicator

114

tilt_angle: str # Tilt angle in degrees

115

tilt: str # Tilt indicator

116

roll_angle: str # Roll angle in degrees

117

roll: str # Roll indicator

118

baseline: str # Baseline length

119

gps_quality: str # GPS quality indicator

120

pdop: str # Position DOP

121

num_sats: str # Number of satellites

122

```

123

124

### Nortek DVL (NOR)

125

126

```python { .api }

127

class NORBT0(ProprietarySentence, DatetimeFix):

128

"""Nortek Bottom Track DF350/DF351."""

129

130

timestamp: datetime.time # UTC time

131

datestamp: datetime.date # Date

132

# Additional bottom track fields...

133

134

@property

135

def datetime(self) -> datetime.datetime:

136

"""Combined date and time."""

137

```

138

139

## Usage Examples

140

141

```python

142

import pynmea2

143

144

# Parse Garmin position error

145

msg = pynmea2.parse("$PGRME,15.0,M,45.0,M,25.0,M*22")

146

print(f"Manufacturer: {msg.manufacturer}") # GRM

147

print(f"Horizontal error: {msg.hpe} {msg.hpe_unit}") # 15.0 M

148

print(f"Vertical error: {msg.vpe} {msg.vpe_unit}") # 45.0 M

149

print(f"Overall error: {msg.osepe} {msg.osepe_unit}") # 25.0 M

150

151

# Parse Garmin altitude

152

msg = pynmea2.parse("$PGRMZ,1494,f,3*21")

153

print(f"Altitude: {msg.altitude} {msg.altitude_unit}") # 1494 f

154

print(f"Fix dimension: {msg.pos_fix_dim}D") # 3D

155

156

# Parse Ashtech position

157

msg = pynmea2.parse("$PASHR,POS,0,3,184353.07,1929.045,S,02410.506,E,100.0,309.62,0.13,1.5,1.2,2.1,1.8,12*3F")

158

print(f"Position: {msg.latitude}, {msg.longitude}") # Decimal degrees

159

print(f"Satellites: {msg.sat_count}") # Number of satellites

160

print(f"Mode: {msg.mode}") # Positioning mode

161

162

# Parse u-blox position data

163

msg = pynmea2.parse("$PUBX,00,184353.07,1929.045,S,02410.506,E,100.0,G3,16,9,0.9,309.62,0.13,,,1.2,1.8,1.5,12,0,0*6F")

164

print(f"Navigation status: {msg.nav_stat}") # G3

165

print(f"Horizontal accuracy: {msg.h_acc}") # Accuracy estimate

166

print(f"Satellites used: {msg.num_svs}") # 12

167

168

# Create proprietary sentence

169

grme_data = ['15.0', 'M', '45.0', 'M', '25.0', 'M']

170

msg = pynmea2.GRME('GRM', grme_data)

171

print(str(msg)) # $PGRME,15.0,M,45.0,M,25.0,M*22

172

```

173

174

## Manufacturer Codes

175

176

| Code | Manufacturer | Common Sentences |

177

|------|-------------|------------------|

178

| ASH | Ashtech | RPOS, RATT, RHPR, RVEL |

179

| FEC | Furuno | GPatt, GPhve |

180

| GRM | Garmin | RME, RMZ, RMM, RMW |

181

| KWD | Kenwood | WPL, S (status messages) |

182

| MGN | Magellan | WPL (waypoint location) |

183

| NOR | Nortek | BT (bottom track), WT (water track) |

184

| RDI | RD Instruments | D (heading/pitch/roll) |

185

| SRF | SiRF | 100, 103 (configuration) |

186

| SXN | Seapath | 20-24 (quality, attitude, rates) |

187

| TNL | Trimble | AVR, GGK, VGK, VHD |

188

| UBX | u-blox | 00, 03, 04 (position, satellites) |

189

| VTX | Vectronix | 0000, 0002, 0012, 0020 |

190

191

## Custom Proprietary Sentences

192

193

```python

194

import pynmea2

195

196

# Parse unknown proprietary sentence (falls back to generic ProprietarySentence)

197

msg = pynmea2.parse("$PXYZ,field1,field2,field3*12")

198

print(f"Type: {type(msg)}") # <class 'pynmea2.nmea.ProprietarySentence'>

199

print(f"Manufacturer: {msg.manufacturer}") # XYZ

200

print(f"Data: {msg.data}") # ['field1', 'field2', 'field3']

201

202

# Access raw field data

203

print(f"Field 1: {msg.data[0]}") # field1

204

print(f"Field 2: {msg.data[1]}") # field2

205

```