BerndCirotzki / raymarine_autopilot_pi

Raymarine Autopilot Plugin for OpenCPN
GNU General Public License v3.0
7 stars 7 forks source link

$STALK datagram 84 sentences #5

Closed Rasbats closed 1 year ago

Rasbats commented 2 years ago

You use this in GetAutopilotCompasCourse()to produce the course received from the autopilot in $STALK 84,: CompassValue = (int)((parameter[0] & 0x0c) >> 2) * 90 + parameter[1] / 2)

Using Thomas Knauf as the reference I am using this in an attempt at making a Raymarine Autopilot simulator: CompassValue = (int)((parameter[0] & 0x3) * 90) + (parameter[1] & 0x3F) * 2) + (parameter[1] & 0xC ? (parameter[1] & 0xC == 0xC ? 2 : 1): 0)

The result: You: 9 Me : 126

Could you explain the logic of your formula? This is new territory for me. Are you missing + (parameter[1] & 0x3F) * 2)?

rgleason commented 2 years ago

Mike, I assume you know this uses seatalk? https://github.com/BerndCirotzki/Autopilot-Plugin/issues/2#issuecomment-490895924 Thomas Knauf is the best reference I think. Frank made the tiny Seatalk Converter with his documentation.. http://www.gadgetpool.de/ It would be great if you can make a Raymarine Autopilot Simulator!!!

rgleason commented 1 year ago

@Rasbats Mike can this be closed now? Thanks.