Skip to content
Merged
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
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
./docker/ci.sh
- name: Artefacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: fpsdk_common_versions_trixie
path: build/trixie-ci_build_toplevel_release_noros/*/*_versions.txt
Expand All @@ -39,13 +39,13 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
./docker/ci.sh
- name: Artefacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: fpsdk_common_versions_noetic
path: build/noetic-ci_build_toplevel_release_ros1/*/*_versions.txt
Expand All @@ -59,13 +59,13 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: CI
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
./docker/ci.sh
- name: Artefacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: fpsdk_common_versions_humble
path: build/humble-ci_build_toplevel_release_ros2/*/*_versions.txt
Expand All @@ -79,13 +79,13 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: CI
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
./docker/ci.sh
- name: Artefacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: fpsdk_common_versions_jazzy
path: build/jazzy-ci_build_toplevel_release_ros2/*/*_versions.txt
Expand All @@ -99,7 +99,7 @@ jobs:
- ci-fpsdk-jazzy
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Login
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -142,12 +142,12 @@ jobs:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

##### Get artefacts from build jobs

- name: Get build artefacts
uses: actions/download-artifact@v5
uses: actions/download-artifact@v8
with:
path: build-artefacts # See Doxyfile and Makefile
# We'll get:
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
# https://github.com/actions/upload-pages-artifact (This, not actions/upload-artifact, which doesn't work
# for pages deployment. Both actions make the artefact show up as a job artefact.
- name: Upload pages artefact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: github-pages

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Login
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -45,9 +45,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Login
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -79,9 +79,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Login
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -113,9 +113,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Login
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions fpsdk_common/src/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ static int IsSbfMessage(const uint8_t* buf, const std::size_t size)
return WAIT;
}

// // Limit message size
// Limit message size, check constraints
const std::size_t message_size = ((uint16_t)buf[6] | ((uint16_t)buf[7] << 8));
if (message_size > MAX_SBF_SIZE) {
if ((message_size > MAX_SBF_SIZE) || (message_size < SBF_HEAD_SIZE) || ((message_size % 4) != 0)) {
return NADA;
}

Expand Down
Binary file added fpsdk_common/test/data/test_data_sbf.bin
Binary file not shown.
10 changes: 10 additions & 0 deletions fpsdk_common/test/data/test_data_sbf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// clang-format off
static const std::vector<uint8_t> TEST_DATA_SBF_BIN = {
0x24, 0x40, 0x89, 0x0a, 0xa7, 0x4f, 0x60, 0x00, 0x08, 0xce, 0xa8, 0x0d, 0x58, 0x09, 0x01, 0x00, 0xfa, 0x95, 0x70, 0xa4, 0x2b, 0x79, 0xea, 0x3f, 0xdd, 0x71, 0x61, 0x0d, 0xd9, 0xe0, 0xc2, 0x3f,
0xce, 0x8c, 0xd1, 0x80, 0x61, 0xb5, 0x7c, 0x40, 0x4a, 0xf5, 0x3f, 0x42, 0x58, 0x73, 0xa2, 0x39, 0xfb, 0xd2, 0xe1, 0x39, 0xb8, 0x9f, 0x85, 0x39, 0xf9, 0x02, 0x95, 0xd0, 0xbe, 0xe3, 0x61, 0xe6,
0xf8, 0x8f, 0xc4, 0xbf, 0x40, 0xd7, 0x25, 0x3e, 0x00, 0x00, 0x29, 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x49, 0x22, 0x50, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0xc5, 0x00, 0x2e, 0x01, 0x50, 0x00,
0x24, 0x40, 0x06, 0x37, 0x12, 0x17, 0x38, 0x00, 0x08, 0xce, 0xa8, 0x0d, 0x58, 0x09, 0x01, 0x00, 0x46, 0xce, 0x12, 0x3f, 0x20, 0x8a, 0xcc, 0x3e, 0xbd, 0x2a, 0x12, 0x40, 0xfe, 0x75, 0x73, 0x3f,
0x5c, 0x76, 0x8c, 0xbb, 0xca, 0x48, 0xc6, 0x3d, 0x5f, 0x98, 0x87, 0x3d, 0x06, 0x8a, 0x89, 0x3e, 0xbc, 0x12, 0x35, 0x3e, 0x7c, 0x84, 0xa8, 0x3f, 0x24, 0x40, 0x44, 0x85, 0x14, 0x17, 0x38, 0x00,
0x08, 0xce, 0xa8, 0x0d, 0x58, 0x09, 0x01, 0x00, 0x77, 0x08, 0xdd, 0x37, 0x85, 0xd7, 0x98, 0x37, 0xac, 0xbb, 0x49, 0x38, 0xcf, 0x28, 0x1c, 0x38, 0xd2, 0x00, 0x39, 0xb5, 0x5e, 0x0e, 0x04, 0xb5,
0xce, 0xd5, 0x7e, 0x35, 0xcd, 0x1d, 0xc6, 0x35, 0xe0, 0x2f, 0xcd, 0x35, 0xd3, 0x46, 0x01, 0x38
};
41 changes: 41 additions & 0 deletions fpsdk_common/test/parser_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ using namespace fpsdk::common::parser;
#include "data/test_data_nmea.cpp"
#include "data/test_data_novb.cpp"
#include "data/test_data_rtcm3.cpp"
#include "data/test_data_sbf.cpp"
#include "data/test_data_spartn.cpp"
#include "data/test_data_ubx.cpp"

Expand Down Expand Up @@ -368,6 +369,46 @@ TEST_F(ParserTest, SPARTN)

// ---------------------------------------------------------------------------------------------------------------------

TEST_F(ParserTest, SBF)
{
Parser parser;
EXPECT_TRUE( // clang-format off
TestLog(parser, TEST_DATA_SBF_BIN, {
{ "SBF-PVTGEODETIC", {
0x24, 0x40, 0x89, 0x0a, 0xa7, 0x4f, 0x60, 0x00, 0x08, 0xce, 0xa8, 0x0d, 0x58, 0x09, 0x01, 0x00,
0xfa, 0x95, 0x70, 0xa4, 0x2b, 0x79, 0xea, 0x3f, 0xdd, 0x71, 0x61, 0x0d, 0xd9, 0xe0, 0xc2, 0x3f,
0xce, 0x8c, 0xd1, 0x80, 0x61, 0xb5, 0x7c, 0x40, 0x4a, 0xf5, 0x3f, 0x42, 0x58, 0x73, 0xa2, 0x39,
0xfb, 0xd2, 0xe1, 0x39, 0xb8, 0x9f, 0x85, 0x39, 0xf9, 0x02, 0x95, 0xd0, 0xbe, 0xe3, 0x61, 0xe6,
0xf8, 0x8f, 0xc4, 0xbf, 0x40, 0xd7, 0x25, 0x3e, 0x00, 0x00, 0x29, 0x00, 0xff, 0xff, 0xff, 0xff,
0x05, 0x49, 0x22, 0x50, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0xc5, 0x00, 0x2e, 0x01, 0x50, 0x00 } },
{ "SBF-POSCOVGEODETIC", {
0x24, 0x40, 0x06, 0x37, 0x12, 0x17, 0x38, 0x00, 0x08, 0xce, 0xa8, 0x0d, 0x58, 0x09, 0x01, 0x00,
0x46, 0xce, 0x12, 0x3f, 0x20, 0x8a, 0xcc, 0x3e, 0xbd, 0x2a, 0x12, 0x40, 0xfe, 0x75, 0x73, 0x3f,
0x5c, 0x76, 0x8c, 0xbb, 0xca, 0x48, 0xc6, 0x3d, 0x5f, 0x98, 0x87, 0x3d, 0x06, 0x8a, 0x89, 0x3e,
0xbc, 0x12, 0x35, 0x3e, 0x7c, 0x84, 0xa8, 0x3f } },
{ "SBF-VELCOVGEODETIC", {
0x24, 0x40, 0x44, 0x85, 0x14, 0x17, 0x38, 0x00, 0x08, 0xce, 0xa8, 0x0d, 0x58, 0x09, 0x01, 0x00,
0x77, 0x08, 0xdd, 0x37, 0x85, 0xd7, 0x98, 0x37, 0xac, 0xbb, 0x49, 0x38, 0xcf, 0x28, 0x1c, 0x38,
0xd2, 0x00, 0x39, 0xb5, 0x5e, 0x0e, 0x04, 0xb5, 0xce, 0xd5, 0x7e, 0x35, 0xcd, 0x1d, 0xc6, 0x35,
0xe0, 0x2f, 0xcd, 0x35, 0xd3, 0x46, 0x01, 0x38 } }
}, {
})); // clang-format on

TestDetector({ 0x24, 0x40, 0xff, 0xd1, 0xa1, 0x0f, 0x20, 0x00, 0xc0, 0xf8, 0xa7, 0x0d, 0x58, 0x09, 0x29, 0x00, 0x49,
0x00, 0x22, 0x00, 0x26, 0x00, 0x3e, 0x00, 0xbf, 0xfa, 0xbc, 0x40, 0x1b, 0x6d, 0x22, 0x41 });

TestBadMessage({ 0x24, 0x40, 0xfe, 0xd1, 0xa1, 0x0f, 0x20, 0x00, 0xc0, 0xf8, 0xa7, 0x0d, 0x58, 0x09, 0x29, 0x00,
0x49, 0x00, 0x22, 0x00, 0x26, 0x00, 0x3e, 0x00, 0xbf, 0xfa, 0xbc, 0x40, 0x1b, 0x6d, 0x22, 0x41 }); // bad crc
TestBadMessage({ 0x24, 0x40, 0xff, 0xd1, 0xa1, 0x0f, 0x00, 0x00, 0xc0, 0xf8, 0xa7, 0x0d, 0x58, 0x09, 0x29, 0x00,
0x49, 0x00, 0x22, 0x00, 0x26, 0x00, 0x3e, 0x00, 0xbf, 0xfa, 0xbc, 0x40, 0x1b, 0x6d, 0x22,
0x41 }); // length < head size
TestBadMessage(
{ 0x24, 0x40, 0xff, 0xd1, 0xa1, 0x0f, 0x1f, 0x00, 0xc0, 0xf8, 0xa7, 0x0d, 0x58, 0x09, 0x29, 0x00, 0x49, 0x00,
0x22, 0x00, 0x26, 0x00, 0x3e, 0x00, 0xbf, 0xfa, 0xbc, 0x40, 0x1b, 0x6d, 0x22, 0x41 }); // length % 4 != 0
}

// ---------------------------------------------------------------------------------------------------------------------

TEST_F(ParserTest, FP_A)
{
Parser parser;
Expand Down
Loading