From 81526eb6e27095701736dfb6e74842fe07a59f4f Mon Sep 17 00:00:00 2001 From: Peter van der Perk Date: Tue, 22 Dec 2020 16:53:08 +0100 Subject: [PATCH] Port of UAVCAN v0 legacy messages to test GNSS functionality --- legacy/README.md | 9 ++ legacy/equipment/gnss/Auxiliary.1.0.uavcan | 17 +++ legacy/equipment/gnss/Fix2.1.0.uavcan | 113 ++++++++++++++++++++ legacy/equipment/gnss/RTCMStream.1.0.uavcan | 13 +++ 4 files changed, 152 insertions(+) create mode 100644 legacy/README.md create mode 100644 legacy/equipment/gnss/Auxiliary.1.0.uavcan create mode 100644 legacy/equipment/gnss/Fix2.1.0.uavcan create mode 100644 legacy/equipment/gnss/RTCMStream.1.0.uavcan diff --git a/legacy/README.md b/legacy/README.md new file mode 100644 index 00000000..10e67bd8 --- /dev/null +++ b/legacy/README.md @@ -0,0 +1,9 @@ +UAVCAN Legacy +================ + +Port of legacy UAVCAN v0 messages from +https://github.com/UAVCAN/public_regulated_data_types/tree/legacy-v0 + +Disclaimer + +DO NOT USE IN PRODUCTION, this is for testing only and is unmaintained diff --git a/legacy/equipment/gnss/Auxiliary.1.0.uavcan b/legacy/equipment/gnss/Auxiliary.1.0.uavcan new file mode 100644 index 00000000..97dd71b2 --- /dev/null +++ b/legacy/equipment/gnss/Auxiliary.1.0.uavcan @@ -0,0 +1,17 @@ +# +# GNSS low priority auxiliary info. +# Unknown DOP parameters should be set to NAN. +# + +float16 gdop +float16 pdop +float16 hdop +float16 vdop +float16 tdop +float16 ndop +float16 edop + +uint7 sats_visible # All visible sats of all available GNSS (e.g. GPS, GLONASS, etc) +uint6 sats_used # All used sats of all available GNSS + +@extent 64 * 8 diff --git a/legacy/equipment/gnss/Fix2.1.0.uavcan b/legacy/equipment/gnss/Fix2.1.0.uavcan new file mode 100644 index 00000000..c8cabfa3 --- /dev/null +++ b/legacy/equipment/gnss/Fix2.1.0.uavcan @@ -0,0 +1,113 @@ +# +# GNSS ECEF and LLA navigation solution with uncertainty. +# + +# +# Global network-synchronized time, if available, otherwise zero. +# +uavcan.time.SynchronizedTimestamp.1.0 timestamp + +# +# Time solution. +# The method and number of leap seconds which were in use for deriving the timestamp are +# defined in the fields below. +# +uavcan.time.SynchronizedTimestamp.1.0 gnss_timestamp + +# +# Method used for deriving the GNSS timestamp field. +# This data type relies on the following definitions: +# +# Leap seconds - Accumulated one-second adjustments applied to UTC since 1972. +# For reference, on May 2017, the number of leap seconds was equal 27. +# The number of leap seconds is taken from the field num_leap_seconds. +# Refer to https://en.wikipedia.org/wiki/Leap_second for a general overview. +# +# TAI timestamp - The number of microseconds between the current TAI time and +# the TAI time at UTC 1970-01-01T00:00:00. +# +# UTC timestamp - The number of microseconds between the current UTC time and +# UTC 1970-01-01T00:00:00. +# UTC can be expressed via TAI as follows (in seconds): +# UTC = TAI - num_leap_seconds - 10 +# And via GPS (in seconds): +# UTC = GPS - num_leap_seconds + 9 +# +# GPS timestamp - The number of microseconds between the current GPS time and +# the GPS time at UTC 1970-01-01T00:00:00. +# GPS time can be expressed via TAI as follows (in seconds): +# GPS = TAI - 19 +# +uint3 GNSS_TIME_STANDARD_NONE = 0 # Time is unknown +uint3 GNSS_TIME_STANDARD_TAI = 1 +uint3 GNSS_TIME_STANDARD_UTC = 2 +uint3 GNSS_TIME_STANDARD_GPS = 3 +uint3 gnss_time_standard + +void13 # Reserved space + +# +# Accumulated one-second adjustments applied to UTC since 1972. +# The number must agree with the currently correct number of UTC leap seconds. If this cannot +# be garanteed, the field must be set to NUM_LEAP_SECONDS_UNKNOWN. +# +uint8 NUM_LEAP_SECONDS_UNKNOWN = 0 +uint8 num_leap_seconds + +# +# Position and velocity solution +# +int37 longitude_deg_1e8 # Longitude degrees multiplied by 1e8 (approx. 1 mm per LSB) +int37 latitude_deg_1e8 # Latitude degrees multiplied by 1e8 (approx. 1 mm per LSB on equator) +int27 height_ellipsoid_mm # Height above ellipsoid in millimeters +int27 height_msl_mm # Height above mean sea level in millimeters + +float32[3] ned_velocity # NED frame (north-east-down) in meters per second + +# +# Fix status +# +uint6 sats_used + +uint2 STATUS_NO_FIX = 0 +uint2 STATUS_TIME_ONLY = 1 +uint2 STATUS_2D_FIX = 2 +uint2 STATUS_3D_FIX = 3 +uint2 status + +# +# GNSS Mode +# +uint4 MODE_SINGLE = 0 +uint4 MODE_DGPS = 1 +uint4 MODE_RTK = 2 +uint4 MODE_PPP = 3 +uint4 mode + +# +# GNSS Sub mode +# +uint6 SUB_MODE_DGPS_OTHER = 0 +uint6 SUB_MODE_DGPS_SBAS = 1 + +uint6 SUB_MODE_RTK_FLOAT = 0 +uint6 SUB_MODE_RTK_FIXED = 1 + +uint6 sub_mode + +# +# Precision +# +float16[<=36] covariance # Position and velocity covariance. Units are + # m^2 for position, (m/s)^2 for velocity and + # m^2/s for position/velocity. + +float16 pdop + +# +# Position and velocity solution in ECEF, if available +# +# ECEFPositionVelocity.1.0[<=1] ecef_position_velocity +# Temporary disable due that nunavut generates incorrect include with an underscore + +@extent 246 * 8 diff --git a/legacy/equipment/gnss/RTCMStream.1.0.uavcan b/legacy/equipment/gnss/RTCMStream.1.0.uavcan new file mode 100644 index 00000000..2df05744 --- /dev/null +++ b/legacy/equipment/gnss/RTCMStream.1.0.uavcan @@ -0,0 +1,13 @@ +# +# GNSS RTCM SC-104 protocol raw stream container. +# RTCM messages that are longer than max data size can be split over multiple consecutive messages. +# + +uint8 PROTOCOL_ID_UNKNOWN = 0 +uint8 PROTOCOL_ID_RTCM2 = 2 +uint8 PROTOCOL_ID_RTCM3 = 3 +uint8 protocol_id + +uint8[<=128] data + +@sealed