-
Notifications
You must be signed in to change notification settings - Fork 7.6k
GNSS RTK: Add basic integration #90890
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
Open
ubieda
wants to merge
8
commits into
zephyrproject-rtos:main
Choose a base branch
from
CogniPilot:gnss/rtk-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f1eb14f
crc: Add CRC24Q for RTCM3 checksum calculations
ubieda 4ba7eb7
tests: crc: Add test-case to validate CRC24Q RTCM3
ubieda 373dbb6
gnss: rtk: Add basic integration
ubieda 373437a
maintainers: Add GNSS Subsystem entries
ubieda c967460
tests: gnss: rtk: Add testsuite to validate RTCM3 protocol
ubieda d3e84f7
modem: ubx: Change request buffer to be void
ubieda e7e985b
gnss: u-blox f9p: Add RTK integration to driver
ubieda f62d3db
samples: gnss: Add ability to enable RTK
ubieda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 2025 Croxel Inc. | ||
* Copyright (c) 2025 CogniPilot Foundation | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_GNSS_RTK_DECODER_H_ | ||
#define ZEPHYR_INCLUDE_GNSS_RTK_DECODER_H_ | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
|
||
/** | ||
* @brief Get an RTK frame from buffer | ||
* | ||
* Used by RTK clients to extract frames from a data-buffer. | ||
* | ||
* @param[in] buf Buffer holding encoded data. | ||
* @param[in] buf_len Buffer length. | ||
* @param[out] data Pointer to the decoded frame. | ||
* @param[out] data_len Length of the decoded frame | ||
* | ||
* @return Zero if successful. | ||
* @return -ENOENT if no frames have been decoded successfully. | ||
* @return -EAGAIN if there's an incomplete frame starting at the data pointer. | ||
* @return Other negative error code if decoding failed. | ||
*/ | ||
int gnss_rtk_decoder_frame_get(uint8_t *buf, size_t buf_len, | ||
uint8_t **data, size_t *data_len); | ||
|
||
#endif /* ZEPHYR_INCLUDE_GNSS_RTK_DECODER_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2023 Trackunit Corporation | ||
* Copyright (c) 2025 Croxel Inc. | ||
* Copyright (c) 2025 CogniPilot Foundation | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_GNSS_RTK_RTK_H_ | ||
#define ZEPHYR_INCLUDE_GNSS_RTK_RTK_H_ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
|
||
struct gnss_rtk_data { | ||
const uint8_t *data; | ||
size_t len; | ||
}; | ||
|
||
typedef void (*gnss_rtk_data_callback_t)(const struct device *dev, | ||
const struct gnss_rtk_data *data); | ||
|
||
struct gnss_rtk_data_callback { | ||
const struct device *dev; | ||
gnss_rtk_data_callback_t callback; | ||
}; | ||
|
||
#if CONFIG_GNSS_RTK | ||
#define GNSS_RTK_DATA_CALLBACK_DEFINE(_dev, _callback) \ | ||
static const STRUCT_SECTION_ITERABLE(gnss_rtk_data_callback, \ | ||
_gnss_rtk_data_callback__##_callback) = { \ | ||
.dev = _dev, \ | ||
.callback = _callback, \ | ||
} | ||
#else | ||
#define GNSS_RTK_DATA_CALLBACK_DEFINE(_dev, _callback) | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* ZEPHYR_INCLUDE_GNSS_RTK_RTK_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) 2025 Croxel Inc. | ||
* Copyright (c) 2025 CogniPilot Foundation | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_GNSS_RTK_PUBLISH_H_ | ||
#define ZEPHYR_INCLUDE_GNSS_RTK_PUBLISH_H_ | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <zephyr/gnss/rtk/rtk.h> | ||
|
||
/* Internal function used by RTK clients to publish data-correction. */ | ||
void gnss_rtk_publish_data(const struct gnss_rtk_data *data); | ||
|
||
#endif /* ZEPHYR_INCLUDE_GNSS_RTK_PUBLISH_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The cast to
const void *
may conflict with the expectedconst struct ubx_frame *
parameter ofubx_f9p_msg_send
. Use(const struct ubx_frame *)data->data
to avoid pointer-type mismatch warnings.Copilot uses AI. Check for mistakes.
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.
I don't think we should cast this to an UBX frame, as it's an RTCM3 msg. See commit:
modem: ubx: Change request buffer to be void