Skip to content

Commit

Permalink
Merge pull request #8 from JuliaMessaging/feat/pose-strings
Browse files Browse the repository at this point in the history
Update Parser Function and add support for WPS/IMU nmea strings
  • Loading branch information
NickMcSweeney authored Feb 15, 2024
2 parents 7aa8a76 + 1a20fda commit 24681cd
Show file tree
Hide file tree
Showing 9 changed files with 1,161 additions and 653 deletions.
8 changes: 7 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name = "NMEAParser"
uuid = "e33883a1-8aa8-4e6e-a42d-0daf9e203b40"
authors = ["Nicholas Shindler <[email protected]>"]
version = "1.2.1"
version = "2.0.0"

[weakdeps]
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[extensions]
PrecompileExt = "PrecompileTools"

[compat]
julia = "1.6"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here’s a simple example that demonstrates how to parse an NMEA sentence:
```julia
using NMEAParser

example = parse(raw"$GPGGA,134740.000,5540.3248,N,01231.2992,E,1,09,0.9,20.2,M,41.5,M,,0000*61")
example = nmea_parse(raw"$GPGGA,134740.000,5540.3248,N,01231.2992,E,1,09,0.9,20.2,M,41.5,M,,0000*61")
println(example.latitude)
```

Expand Down
30 changes: 30 additions & 0 deletions ext/PrecompileExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module PrecompileExt # Should be same name as the file (just like a normal package)

using PrecompileTools, NMEAParser

@setup_workload begin
@info "running optional precompiler set"
test_msgs = [
raw"$GPGGA,134735.000,5540.3232,N,01231.2946,E,1,10,0.8,23.6,M,41.5,M,,0000*69",
raw"$GPGSA,A,3,03,22,06,19,11,14,32,01,28,18,,,1.8,0.8,1.6*3F",
raw"$GPRMC,134735.000,A,5540.3232,N,01231.2946,E,1.97,88.98,041112,,,A*5C",
raw"$GPVTG,88.98,T,,M,1.97,N,3.6,K,A*36",
raw"$GLGSV,3,3,09,72,07,273,,0*44",
raw"$GNRMC,094810.000,A,5547.94084,N,03730.27293,E,0.25,50.34,260420,,,A,V*31",
raw"$GNVTG,50.34,T,,M,0.25,N,0.46,K,A*14",
raw"$GNZDA,094810.000,26,04,2020,00,00*4C",
raw"$GNGLL,5547.94084,N,03730.27293,E,094810.000,A,A*4B",
raw"$PTWPOS,154922.69,0.7,M,0.7,M,0,M,0.989949,M,0.01,K,F*07",
raw"$PTWVCT,154932.45,0.7,M,0.7,R,0.4,M,0.989949,M*3e",
raw"$PTWPLS,021540.19,12,P,14,P,20,D*54",
raw"$PTWWHE,021539.62,12,0.3,M,F,12,0.3,M,F,0.01*30",
raw"$PTWHPR,161540.45,12.456,78.901,2.34,79.912,0.12*2E",
raw"$PTACC,154156.65,0.777,0.123,0.011*43",
raw"$PTGYR,156921.39,0.777,0.123,0.011*4d",
]
@compile_workload begin
nmea_strings = NMEAParser.nmea_parse.(test_msgs)
end
end

end # PrecompileTools Extension
5 changes: 3 additions & 2 deletions src/NMEAParser.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module NMEAParser

export NMEAData, parse_msg!, is_string_supported, update
export NMEAData, parse_msg!, is_string_supported, update, nmea_parse
export NMEAString
export GGA, GSA, ZDA, GBS, GLL, GSV, RMC, VTG, DTM, PASHR, TWPOS, TWHPR
export GGA, GSA, ZDA, GBS, GLL, GSV, RMC, VTG, DTM
export PASHR, PTWPOS, PTWHPR, PTWVCT, PTWPLS, PTWWHE, PTWHPR, PTACC, PTGYR

import Base.pop!
import Base.parse
Expand Down
Loading

2 comments on commit 24681cd

@NickMcSweeney
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Breaking changes

  • parse changed to nmea_parse
  • proprietary nmea strings removed from NMEAData struct

Changes

  • added PTWPOS: position
  • added PTWVCT: movement vector
  • added PTWPLS: position pulses
  • added PTWWHE: wheel information
  • added PTWHPR: heading, pitch, roll
  • added PTACC: imu acceleration
  • added PTGYR: imu gyroscope

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/100986

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.0.0 -m "<description of version>" 24681cdbf35b10baed9ef48b8411ea3dc9f2d17f
git push origin v2.0.0

Please sign in to comment.