diff --git a/pynmea2/types/talker.py b/pynmea2/types/talker.py index 547d003..16ba7fa 100644 --- a/pynmea2/types/talker.py +++ b/pynmea2/types/talker.py @@ -1035,4 +1035,26 @@ class ALK(TalkerSentence,SeaTalk): ("Data Byte 7", "data_byte7"), ("Data Byte 8", "data_byte8"), ("Data Byte 9", "data_byte9") + ) + + +# RTH +# Used by Cerulean Sonar ROV Locator +class RTH(TalkerSentence): + """ + RTH + """ + fields = ( + ("Apparent Bearing to Target in Degrees", "ab", float), + ("Apparent Bearing to Target in Compass Degrees", "ac", float), + ("Apparent Elevation to Target in Degrees", "ae", float), + ("Slant Range in Meters", "sr", float), + ("True Bearing to Target in Degrees", "tb", float), + ("True Bearing to Target in Compass Degrees", "cb", float), + ("True Elevation to Target in Degrees", "te", float), + ("Euler Roll", "er", float), + ("Euler Pitch", "ep", float), + ("Euler Yaw", "ey", float), + ("Compass Heading", "ch", float), + ("AGC Gain in db", "db", float) ) \ No newline at end of file diff --git a/test/test_cerulean.py b/test/test_cerulean.py new file mode 100644 index 0000000..a57367d --- /dev/null +++ b/test/test_cerulean.py @@ -0,0 +1,22 @@ +import pynmea2 + + +def test_cerulean(): + data = '$USRTH,358.5,1.5,2.8,142.8,52.8,37.2,2.8,-0.6,1.9,178.1,271.9,16*49' + msg = pynmea2.parse(data) + + assert type(msg) == pynmea2.types.talker.RTH + assert msg.sentence_type == 'RTH' + assert msg.talker == 'US' + assert msg.ab == 358.5 + assert msg.ac == 1.5 + assert msg.ae == 2.8 + assert msg.sr == 142.8 + assert msg.tb == 52.8 + assert msg.cb == 37.2 + assert msg.te == 2.8 + assert msg.er == -0.6 + assert msg.ep == 1.9 + assert msg.ey == 178.1 + assert msg.ch == 271.9 + assert msg.db == 16.0