class NavilockMd6¶
The driver object is used when a navilock MD6 sensor is required
Constructor¶
-
class
navilock_md6.
NavilockMd6
('serial port')¶ The driver requires a preconfigured serial port from which it shall obtain the sensor data. Make sure the serial port settings are correct!
Methods¶
-
.
detect_parameters
() → ’True’ of ‘ False’¶ This function is used to detect the parameters provided by the driver. If not all messages are obtained within the timeout seconds the funciton returns a warning. As soon as all sentences are received ‘True’ is returned.
-
.
read_values
() → ’True’ of ‘ False’¶ The read_values() function only returns a single nmea sentence. in order to obtain all the sentences from the driver this function must be executed frequently
Constants¶
Obtained from GGA¶
UTC time Latitude in decimal degrees notation with positive/negative hemisphere indication Longitude in decimal degrees notation with positive/negative hemisphere indication Quality Sattelites Horizontal dilution of precision Altitude Geodial separation Age Station identification
Obtained from VTG¶
Course over ground, true Course over ground, magnetic Speed, knots Speed, km/h Mode
Obtained from RMC¶
Note
The RMC messages contain matching fields with GGA and VTG Only the date is unique to this sentence and therefore only this field is parsed! UTC time Date
Generic¶
-
.parameters -> parameter list
All parametes obtained via detect_parameters() are returned as a tuple
- exp_params = [(‘Latitude’, ‘deg’, ‘LAT’),
(‘Longitude’, ‘deg’, ‘LON’), (‘Quality’, ‘’, ‘GPSQ’), (‘Satellites’, ‘’, ‘SAT’), (‘Hdop’, ‘m’, ‘HDOP’), (‘Altitude’, ‘m’, ‘ALT’), (‘Geoid sep’, ‘’, ‘GEO’), (‘Age’, ‘min’, ‘AGE’), (‘Station’, ‘’, ‘STAT’),
(‘Course true’, ‘deg’, ‘CRST’), (‘Course magnetic’, ‘deg’, ‘CRSM’), (‘Speed knots’, ‘knots’, ‘SPDK’), (‘Speed kmh’, ‘km/h’, ‘SPDM’), (‘Mode’, ‘’, ‘MOD’)]
-
.data -> data list
the data list returned contains the nmea GGA and VTG data, matching the parameter list.
exp_data [51.874956833333336, 4.6191811666666664, ‘1’, ‘04’, ‘2.60’, ‘3.7’, ‘46.0’, None, None, None, None,’0.393’,’0.728’,’A’]
-
.datetime -> (year, month, day, weekday, hours, minutes, seconds, subseconds)
The datetime tuple is identical to the RTC datetime tuple, and can therefore be used to synchronise the logger time to the GPS UTC time.
Example usage¶
The following code shows an example of using the driver.
import omc048
from nmea_decoder import NmeaDecode, VALUE, PARAM
from navilock_md6 import NavilockMd6
gps_power = omc048.power_supply(1)
gps_power.on()
gps_port = omc048.serial(1)
gps_port.init(4800, gps_port.RS232, rxbuf=1024)
gps_driver = NavilockMd6(gps_port)
gps_driver.detect_parameters()
print(gps_driver.parameters)
gps_driver.read_values()
print(gps_driver.data)