-
Notifications
You must be signed in to change notification settings - Fork 19.5k
Add support for Rockblock 9704 satellite modem #31296
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
base: master
Are you sure you want to change the base?
Conversation
-- compute CRC-16/XMODEM checksum of text | ||
---@param text string | ||
---@return integer -- checksum | ||
function crc_xmodem(text) end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting to do some bench-marking vs a native lua implementation. I'm a little reluctant to start a president crc bindings just because there are so many people may want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A crc implementation in lua for example:
ardupilot/libraries/AP_Scripting/examples/TraxxasVelineon.lua
Lines 15 to 40 in da01dac
--- Apply a byte to the crc and return the result | |
---@param crc integer | |
---@param byte integer | |
---@return integer | |
local function applyCRCByte(crc, byte) | |
crc = crc ~ byte | |
for _ = 1, 8 do | |
if (crc & 0x80) ~= 0 then | |
crc = ((crc << 1) ~ 0xE7) & 0xFF | |
else | |
crc = (crc << 1) & 0xFF | |
end | |
end | |
return crc | |
end | |
--- Apply a table of bytes to the crc and return the result | |
---@param crc integer | |
---@param data integer[] | |
---@return integer | |
local function applyCRC(crc, data) | |
for i = 1, #data do | |
crc = applyCRCByte(crc, data[i]) | |
end | |
return crc | |
end |
@IamPete1 Here's one I put together:
Calculating the CRC16 of a 50 byte string has the following execution time on a CubeOrangePlus:
So the Lua bindings are ~50x faster |
This PR adds support for the Rockblock 9704 satellite modem (https://www.groundcontrol.com/product/rockblock-9704/), using the MAVLink High Latency protocol. It sends a
HIGH_LATENCY2
packet once per 30 seconds.The software required at the GCS to process messages is at stephendade/rockblock2mav#5
I also:
Tested in hardware with a CubeOrange+.
(Thanks to GroundControl for supplying the hardware and airtime)