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

BINEX #274

Merged
merged 48 commits into from
Oct 13, 2024
Merged

BINEX #274

merged 48 commits into from
Oct 13, 2024

Conversation

gwbres
Copy link
Collaborator

@gwbres gwbres commented Oct 10, 2024

* introducing BINEX parser

    * introducing BINEX parser

Signed-off-by: Guillaume W. Bres <[email protected]>
@gwbres gwbres added enhancement New feature provided feature Request new feature labels Oct 10, 2024
@gwbres gwbres requested review from lnicola and larsnaesbye October 10, 2024 06:55
@gwbres gwbres self-assigned this Oct 10, 2024
@gwbres
Copy link
Collaborator Author

gwbres commented Oct 10, 2024

The only BINEX specs I know https://www.unavco.org/data/gps-gnss/data-formats/binex/binex.html

The first objective is to achieve one first test method that decodes one message correctly.

The ultimate objective is to be able to provide seamless interface between RINEX and BINEX (ideally both ways)

gwbres added 13 commits October 10, 2024 18:58
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
binex/src/decoder.rs Outdated Show resolved Hide resolved
binex/src/decoder.rs Outdated Show resolved Hide resolved
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
@gwbres
Copy link
Collaborator Author

gwbres commented Oct 13, 2024

@lnicola,

I would like to make this no-std compatible, maybe not right now, but in the long term I think it definitely should:

  • this is just a simple parser and forger
  • forging is data production oriented and you want to use this nearby the gnss firmware or on the same plateform

do you have recommendations on how to replace Vec in this scenario ? maybe a small external library so we don't have too much code to write. It is most convenient to use Vec in the decoder Buffer currently, but it will then have to change

gwbres added 14 commits October 13, 2024 09:26
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
Signed-off-by: Guillaume W. Bres <[email protected]>
@gwbres gwbres marked this pull request as ready for review October 13, 2024 17:00
Signed-off-by: Guillaume W. Bres <[email protected]>
@gwbres gwbres merged commit c317d8a into main Oct 13, 2024
26 checks passed
@gwbres gwbres deleted the binex branch October 13, 2024 18:40
@lnicola
Copy link
Member

lnicola commented Oct 19, 2024

Sorry, I saw the notification after you merged the PR, then I forgot to answer. If the format has some built-in limits (say, for the number of frames in a record, the maximum size of a record etc.) then something like arrayvec should work work. If the records can be arbitrarily large, then I don't think that's going to be compatible with #[no_std] without using the alloc crate.

@gwbres
Copy link
Collaborator Author

gwbres commented Oct 19, 2024

Sorry, I saw the notification after you merged the PR, then I forgot to answer

No worries, your input is always much appreciated. The no-std support can be a long term thing, it does not have to be accomplished right away, I personnaly have very limited experience with that. I think it's an important topic, because open-source GNSS firmware (embedded) could then easily use the BINEX encoder/decoder

If the format has some built-in limits (say, for the number of frames in a record, the maximum size of a record etc.) then something like arrayvec should work

unfortunately not, you cannot say at the beginning of the parsing process, how many bytes you will encounter for the Geodetic and Signal frames. For the first one (comment/description) you can have as many comments as needed: I currently use a Vec<> (convenient but then incompatible). For the latter, it depends on the GNSS receiver capabilities, and it may be able to sample many carriers so you then have to describe all your observations (not supported yet).

If the records can be arbitrarily large, then I don't think that's going to be compatible with #[no_std] without using the alloc crate

Yep I saw a couple of times the possibility to implement no-std with an allocator, but I need to study how that works

@lnicola
Copy link
Member

lnicola commented Oct 19, 2024

unfortunately not, you cannot say at the beginning of the parsing process, how many bytes you will encounter for the Geodetic and Signal frames

No 64 KB record limit? No 16-bit length field? :-)

Yep I saw a couple of times the possibility to implement no-std with an allocator, but I need to study how that works

I think you can use alloc::Vec<T> and let the user figure out where to get an allocator from.

@gwbres
Copy link
Collaborator Author

gwbres commented Oct 19, 2024

No 64 KB record limit? No 16-bit length field? :-)

Hum, at first I thought that was correct (have not read the specs since last week 😄), but unfortunately that does not stand in the case of the BINEX protocol.

In BINEX, a few sensitive bytes are encoded using the so called 1-4 BNXI algorithm, which can describe an integer value (usually U32) using only the required amount of bytes to describe the actual value. That applies to the message length (MLEN) and gives up to 2^32 hypothetical record length

@gwbres
Copy link
Collaborator Author

gwbres commented Nov 1, 2024

@lnicola

No 64 KB record limit? No 16-bit length field? :-)
I think you can use alloc::Vec<T> and let the user figure out where to get an allocator from.

In BINEX, a few sensitive bytes are encoded using the so called
1-4 BNXI algorithm,
which can describe an integer value (usually U32) using only the required amount of bytes
to describe the actual value. That applies to the message
length (MLEN)
and gives up to 2^32 hypothetical record length

correcting this statement which is wong or at least inacurate. Although t is true that this protocol may describe 2^27 byte long frames, that does not mean we cannot operate using a static buffer with reasonnable size. All we need is some way to describe partial / incomplete frames. Side note, BINEX only has about 10 different frames and apparently all with reasonnable sizes. So this may only apply to closed source prototypes, that this protocol permits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature provided feature Request new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants