Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Cerulean Sonar ROV Locator #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions pynmea2/types/talker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
22 changes: 22 additions & 0 deletions test/test_cerulean.py
Original file line number Diff line number Diff line change
@@ -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