From ff833129526614343e6375a42cc8734bc701d9e3 Mon Sep 17 00:00:00 2001 From: aleokdev Date: Wed, 12 Jul 2023 16:37:35 +0200 Subject: [PATCH 1/5] Meeting changes Co-authored-by: marcasmar1 --- courageous.schema.json | 2 +- src/lib.rs | 49 +++++++++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/courageous.schema.json b/courageous.schema.json index ae287b1..e3ccc93 100644 --- a/courageous.schema.json +++ b/courageous.schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft-07/schema#","title":"Document","type":"object","required":["detection","static_cuas_location","system_name","tracks","vendor_name"],"properties":{"detection":{"description":"A list containing the detection sets present in the document.","type":"array","items":{"$ref":"#/definitions/Detection"}},"static_cuas_location":{"description":"The 3D GPS location of the CUAS. Can be overriden per Record, but even if overriden this value must exist and be a valid position.","allOf":[{"$ref":"#/definitions/Position3d"}]},"system_name":{"type":"string"},"tracks":{"description":"A list containing the tracks present in the document.","type":"array","items":{"$ref":"#/definitions/Track"}},"vendor_name":{"type":"string"}},"definitions":{"Arc":{"description":"Describes a circular arc between two clockwise angles from true north.","type":"object","required":["from","to"],"properties":{"from":{"description":"Minimum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"},"to":{"description":"Maximum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"}}},"Classification":{"type":"string","enum":["Unknown","UAV","GCS","Other"]},"Detection":{"type":"object","required":["records"],"properties":{"name":{"description":"Free-form text describing the detection set. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this detection.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"An unique ID used to associate this detection with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.\n\nIf null, means the system was not able to identify the records present along with this object with any specific UAS.","type":["integer","null"],"format":"uint64","minimum":0.0}}},"Location":{"description":"Location of an UAS, which may be relative to the CUAS.","oneOf":[{"description":"Circular arc relative to the CUAS within which the UAS resides.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Arc"},"t":{"type":"string","enum":["Arc"]}}},{"description":"Compass quadrant where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Quad"},"t":{"type":"string","enum":["Quad"]}}},{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"type":"number","format":"double"},"t":{"type":"string","enum":["Bearing"]}}},{"description":"Flat 2D position given in latitude and longitude.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position2d"},"t":{"type":"string","enum":["Position2d"]}}},{"description":"3D position given in latitude, longitude and height.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position3d"},"t":{"type":"string","enum":["Position3d"]}}},{"description":"Ray where the UAS has been observed given in bearing and elevation.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevation"]}}},{"description":"3D position of the UAS given in bearing, elevation angle and distance.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","distance","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"distance":{"description":"Distance from the UAS to the CUAS given in meters.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevationDistance"]}}}]},"Position2d":{"description":"2D WGS84 position given in latitude and longitude.","type":"object","required":["lat","lon"],"properties":{"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Position3d":{"description":"3D WGS84 position given in latitude, longitude and height.","type":"object","required":["height","lat","lon"],"properties":{"height":{"description":"Height measured in meters from sea level.","type":"number","format":"double"},"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Quad":{"description":"Describes a compass quadrant.","type":"string","enum":["North","East","South","West"]},"Record":{"type":"object","required":["alarm","alarm_certainty","classification","location","record_number","time"],"properties":{"alarm":{"description":"Whether the alarm function of the CUAS system is active or not. An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and the generation of associated data in the UAS Activity Log, as a result of Declared UAS activity.","type":"boolean"},"alarm_certainty":{"description":"How certainly should the alarm be on, as a value from 0 (Least likely) to 1 (Most likely).","type":"number","format":"double","maximum":1.0,"minimum":0.0},"classification":{"description":"Classification of the record.","allOf":[{"$ref":"#/definitions/Classification"}]},"cuas_location":{"description":"The 3D GPS location of the CUAS recorded on this instant. Overrides the document's static_cuas_location.","anyOf":[{"$ref":"#/definitions/Position3d"},{"type":"null"}]},"identification":{"description":"Free form text, possibly describing the model or configuration of the UAS identified.","type":["string","null"]},"location":{"description":"The UAS location, which may be given in one of several declaration types.","allOf":[{"$ref":"#/definitions/Location"}]},"record_number":{"description":"A unique number that identifies this record between all other ones present in the document.","type":"integer","format":"uint64","minimum":0.0},"time":{"description":"UTC time as an Unix millisecond timestamp.","type":"integer","format":"uint64","minimum":0.0}}},"Track":{"type":"object","required":["records","uas_id"],"properties":{"name":{"description":"Free-form text describing the track. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this track.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"An unique ID used to associate this track with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.","type":"integer","format":"uint64","minimum":0.0}}}}} \ No newline at end of file +{"$schema":"http://json-schema.org/draft-07/schema#","title":"Document","type":"object","required":["detection","static_cuas_location","system_name","tracks","vendor_name"],"properties":{"detection":{"description":"A list containing the detection sets present in the document.","type":"array","items":{"$ref":"#/definitions/Detection"}},"static_cuas_location":{"description":"The 3D GPS location of the CUAS. Can be overriden per Record, but even if overriden this value must exist and be a valid position.","allOf":[{"$ref":"#/definitions/Position3d"}]},"system_name":{"type":"string"},"tracks":{"description":"A list containing the tracks present in the document.","type":"array","items":{"$ref":"#/definitions/Track"}},"vendor_name":{"type":"string"}},"definitions":{"Alarm":{"type":"object","required":["active","alarm_certainty"],"properties":{"active":{"description":"Whether the alarm function of the CUAS system is active or not.","type":"boolean"},"alarm_certainty":{"description":"How certain is the system of an active alarm, as a value from 0 (Least likely) to 1 (Most likely).","type":"number","format":"double","maximum":1.0,"minimum":0.0}}},"Arc":{"description":"Describes a circular arc between two clockwise angles from true north.","type":"object","required":["from","to"],"properties":{"from":{"description":"Minimum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"},"to":{"description":"Maximum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"}}},"Classification":{"type":"string","enum":["Unknown","UAV","GCS","Other"]},"Detection":{"type":"object","required":["records"],"properties":{"name":{"description":"(Optional) Free-form text describing the detection set. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this detection.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"(Optional) A unique ID used to associate this detection with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.\n\nIf null, means the system was not able to identify the records present along with this object with any specific UAS.","type":["integer","null"],"format":"uint64","minimum":0.0}}},"Location":{"description":"Location of an UAS, which may be relative to the CUAS.","oneOf":[{"description":"Circular arc relative to the CUAS within which the UAS resides.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Arc"},"t":{"type":"string","enum":["Arc"]}}},{"description":"Compass quadrant where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Quad"},"t":{"type":"string","enum":["Quad"]}}},{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"type":"number","format":"double"},"t":{"type":"string","enum":["Bearing"]}}},{"description":"Flat 2D position given in latitude and longitude.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position2d"},"t":{"type":"string","enum":["Position2d"]}}},{"description":"3D position given in latitude, longitude and height.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position3d"},"t":{"type":"string","enum":["Position3d"]}}},{"description":"Ray where the UAS has been observed given in bearing and elevation.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevation"]}}},{"description":"3D position of the UAS given in bearing, elevation angle and distance.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","distance","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"distance":{"description":"Distance from the UAS to the CUAS given in meters.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevationDistance"]}}}]},"Position2d":{"description":"2D WGS84 position given in latitude and longitude.","type":"object","required":["lat","lon"],"properties":{"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Position3d":{"description":"3D WGS84 position given in latitude, longitude and height.","type":"object","required":["height_amsl","lat","lon"],"properties":{"height_amsl":{"description":"Height measured in meters from sea level.","type":"number","format":"double"},"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Quad":{"description":"Describes a compass quadrant.","type":"string","enum":["North","East","South","West"]},"Record":{"type":"object","required":["classification","location","record_number","time"],"properties":{"alarm":{"description":"(Optional) An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and the generation of associated data in the UAS Activity Log, as a result of Declared UAS activity.","anyOf":[{"$ref":"#/definitions/Alarm"},{"type":"null"}]},"classification":{"description":"Classification of the record.","allOf":[{"$ref":"#/definitions/Classification"}]},"cuas_location":{"description":"(Optional) The 3D GPS location of the CUAS recorded on this instant. Overrides the document's static_cuas_location.","anyOf":[{"$ref":"#/definitions/Position3d"},{"type":"null"}]},"identification":{"description":"(Optional) Free form text, possibly describing the model or configuration of the UAS identified.","type":["string","null"]},"location":{"description":"The UAS location, which may be given in one of several declaration types. Location types are composed of a tag 't' and a contents element 'c'.","allOf":[{"$ref":"#/definitions/Location"}]},"record_number":{"description":"A unique number that identifies this record between all other ones present in the document.","type":"integer","format":"uint64","minimum":0.0},"time":{"description":"UTC time as an Unix millisecond timestamp.","type":"integer","format":"uint64","minimum":0.0}}},"Track":{"type":"object","required":["records","uas_id"],"properties":{"name":{"description":"(Optional) Free-form text describing the track. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this track.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this track with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.","type":"integer","format":"uint64","minimum":0.0}}}}} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 488403e..395b6cc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,15 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "schemars")] use schemars::JsonSchema; +// for the company: schema + documentation +// TODO better docs +// TODO fix required * +// TODO change detection & tracking to arrays +// TODO solve classification enum variants not showing up in visualizer +// TODO add location variant names above structure in visualizer (Rather than "(?)") +// TODO solve static_cuas_location description not showing up +// TODO solve location variants descriptions issue + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Document { @@ -21,7 +30,8 @@ pub struct Document { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Detection { - /// An unique ID used to associate this detection with a specific UAS. + /// (Optional) + /// A unique ID used to associate this detection with a specific UAS. /// The number itself is not relevant, it just needs to be unique per UAS. /// /// If null, means the system was not able to identify the records present along with this @@ -29,27 +39,22 @@ pub struct Detection { pub uas_id: Option, /// A list of records associated with this detection. pub records: Vec, - /// Free-form text describing the detection set. Can be, for instance, the name present on the HMI. + /// (Optional) Free-form text describing the detection set. Can be, for instance, the name present on the HMI. pub name: Option, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Track { - /// An unique ID used to associate this track with a specific UAS. + /// A unique ID used to associate this track with a specific UAS. /// The number itself is not relevant, it just needs to be unique per UAS. pub uas_id: u64, /// A list of records associated with this track. pub records: Vec, - /// Free-form text describing the track. Can be, for instance, the name present on the HMI. + /// (Optional) Free-form text describing the track. Can be, for instance, the name present on the HMI. pub name: Option, } -// for the company: schema + documentation -// TODO better docs -// TODO fix required * -// TODO change detection & tracking to arrays - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Record { @@ -59,23 +64,31 @@ pub struct Record { pub record_number: u64, /// Classification of the record. pub classification: Classification, - /// Whether the alarm function of the CUAS system is active or not. + /// (Optional) /// An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and /// the generation of associated data in the UAS Activity Log, as a result of Declared UAS /// activity. - pub alarm: bool, - /// How certainly should the alarm be on, as a value from 0 (Least likely) to 1 (Most likely). - #[cfg_attr(feature = "schemars", validate(range(min = 0., max = 1.)))] - pub alarm_certainty: f64, + pub alarm: Option, /// The UAS location, which may be given in one of several declaration types. + /// Location types are composed of a tag 't' and a contents element 'c'. pub location: Location, - /// Free form text, possibly describing the model or configuration of the UAS identified. + /// (Optional) Free form text, possibly describing the model or configuration of the UAS identified. pub identification: Option, - /// The 3D GPS location of the CUAS recorded on this instant. Overrides the document's + /// (Optional) The 3D GPS location of the CUAS recorded on this instant. Overrides the document's /// static_cuas_location. pub cuas_location: Option, } +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Copy)] +#[cfg_attr(feature = "schemars", derive(JsonSchema))] +pub struct Alarm { + /// Whether the alarm function of the CUAS system is active or not. + pub active: bool, + /// How certain is the system of an active alarm, as a value from 0 (Least likely) to 1 (Most likely). + #[cfg_attr(feature = "schemars", validate(range(min = 0., max = 1.)))] + pub alarm_certainty: f64, +} + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Copy)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub enum Classification { @@ -92,6 +105,8 @@ pub enum Classification { #[serde(tag = "t", content = "c")] /// Location of an UAS, which may be relative to the CUAS. pub enum Location { + // All this variant descriptions are overwritten by the doc comments of their respective types + // clockwise: from -> to (degrees) /// Circular arc relative to the CUAS within which the UAS resides. Arc(Arc), @@ -161,5 +176,5 @@ pub struct Position3d { /// GPS WGS84 longitude measured in degrees. pub lon: f64, /// Height measured in meters from sea level. - pub height: f64, + pub height_amsl: f64, } From 625856edcc51dfcbea22c871c78e316a0fd2120c Mon Sep 17 00:00:00 2001 From: aleokdev Date: Mon, 17 Jul 2023 00:10:57 +0200 Subject: [PATCH 2/5] Review changes --- src/lib.rs | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 395b6cc..e54e431 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,15 +3,6 @@ use serde::{Deserialize, Serialize}; #[cfg(feature = "schemars")] use schemars::JsonSchema; -// for the company: schema + documentation -// TODO better docs -// TODO fix required * -// TODO change detection & tracking to arrays -// TODO solve classification enum variants not showing up in visualizer -// TODO add location variant names above structure in visualizer (Rather than "(?)") -// TODO solve static_cuas_location description not showing up -// TODO solve location variants descriptions issue - #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Document { @@ -30,7 +21,6 @@ pub struct Document { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Detection { - /// (Optional) /// A unique ID used to associate this detection with a specific UAS. /// The number itself is not relevant, it just needs to be unique per UAS. /// @@ -39,7 +29,7 @@ pub struct Detection { pub uas_id: Option, /// A list of records associated with this detection. pub records: Vec, - /// (Optional) Free-form text describing the detection set. Can be, for instance, the name present on the HMI. + /// Free-form text describing the detection set. Can be, for instance, the name present on the HMI. pub name: Option, } @@ -51,7 +41,7 @@ pub struct Track { pub uas_id: u64, /// A list of records associated with this track. pub records: Vec, - /// (Optional) Free-form text describing the track. Can be, for instance, the name present on the HMI. + /// Free-form text describing the track. Can be, for instance, the name present on the HMI. pub name: Option, } @@ -64,7 +54,6 @@ pub struct Record { pub record_number: u64, /// Classification of the record. pub classification: Classification, - /// (Optional) /// An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and /// the generation of associated data in the UAS Activity Log, as a result of Declared UAS /// activity. @@ -72,9 +61,9 @@ pub struct Record { /// The UAS location, which may be given in one of several declaration types. /// Location types are composed of a tag 't' and a contents element 'c'. pub location: Location, - /// (Optional) Free form text, possibly describing the model or configuration of the UAS identified. + /// Free form text, possibly describing the model or configuration of the UAS identified. pub identification: Option, - /// (Optional) The 3D GPS location of the CUAS recorded on this instant. Overrides the document's + /// The 3D GPS location of the CUAS recorded on this instant. Overrides the document's /// static_cuas_location. pub cuas_location: Option, } @@ -105,8 +94,6 @@ pub enum Classification { #[serde(tag = "t", content = "c")] /// Location of an UAS, which may be relative to the CUAS. pub enum Location { - // All this variant descriptions are overwritten by the doc comments of their respective types - // clockwise: from -> to (degrees) /// Circular arc relative to the CUAS within which the UAS resides. Arc(Arc), From d09da40e3a66210fce5acc994b47a4c1b47538fd Mon Sep 17 00:00:00 2001 From: aleokdev Date: Mon, 17 Jul 2023 00:19:17 +0200 Subject: [PATCH 3/5] Improve Location docs --- CHANGELOG.md | 4 ++++ Cargo.toml | 2 +- courageous.schema.json | 2 +- src/lib.rs | 3 ++- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f333a39 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +# 0.3.0 +- Improve docs +- Replace `alarm` and `alarm_certainty` members with single `alarm` member that contains both and is optional on detection +- Rename `height` to `height_amsl` on `Position3d`s \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index f82d274..ab24f6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "courageous-format" -version = "0.2.0" +version = "0.3.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/courageous.schema.json b/courageous.schema.json index e3ccc93..5c1ccbb 100644 --- a/courageous.schema.json +++ b/courageous.schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft-07/schema#","title":"Document","type":"object","required":["detection","static_cuas_location","system_name","tracks","vendor_name"],"properties":{"detection":{"description":"A list containing the detection sets present in the document.","type":"array","items":{"$ref":"#/definitions/Detection"}},"static_cuas_location":{"description":"The 3D GPS location of the CUAS. Can be overriden per Record, but even if overriden this value must exist and be a valid position.","allOf":[{"$ref":"#/definitions/Position3d"}]},"system_name":{"type":"string"},"tracks":{"description":"A list containing the tracks present in the document.","type":"array","items":{"$ref":"#/definitions/Track"}},"vendor_name":{"type":"string"}},"definitions":{"Alarm":{"type":"object","required":["active","alarm_certainty"],"properties":{"active":{"description":"Whether the alarm function of the CUAS system is active or not.","type":"boolean"},"alarm_certainty":{"description":"How certain is the system of an active alarm, as a value from 0 (Least likely) to 1 (Most likely).","type":"number","format":"double","maximum":1.0,"minimum":0.0}}},"Arc":{"description":"Describes a circular arc between two clockwise angles from true north.","type":"object","required":["from","to"],"properties":{"from":{"description":"Minimum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"},"to":{"description":"Maximum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"}}},"Classification":{"type":"string","enum":["Unknown","UAV","GCS","Other"]},"Detection":{"type":"object","required":["records"],"properties":{"name":{"description":"(Optional) Free-form text describing the detection set. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this detection.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"(Optional) A unique ID used to associate this detection with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.\n\nIf null, means the system was not able to identify the records present along with this object with any specific UAS.","type":["integer","null"],"format":"uint64","minimum":0.0}}},"Location":{"description":"Location of an UAS, which may be relative to the CUAS.","oneOf":[{"description":"Circular arc relative to the CUAS within which the UAS resides.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Arc"},"t":{"type":"string","enum":["Arc"]}}},{"description":"Compass quadrant where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Quad"},"t":{"type":"string","enum":["Quad"]}}},{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"type":"number","format":"double"},"t":{"type":"string","enum":["Bearing"]}}},{"description":"Flat 2D position given in latitude and longitude.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position2d"},"t":{"type":"string","enum":["Position2d"]}}},{"description":"3D position given in latitude, longitude and height.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position3d"},"t":{"type":"string","enum":["Position3d"]}}},{"description":"Ray where the UAS has been observed given in bearing and elevation.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevation"]}}},{"description":"3D position of the UAS given in bearing, elevation angle and distance.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","distance","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"distance":{"description":"Distance from the UAS to the CUAS given in meters.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevationDistance"]}}}]},"Position2d":{"description":"2D WGS84 position given in latitude and longitude.","type":"object","required":["lat","lon"],"properties":{"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Position3d":{"description":"3D WGS84 position given in latitude, longitude and height.","type":"object","required":["height_amsl","lat","lon"],"properties":{"height_amsl":{"description":"Height measured in meters from sea level.","type":"number","format":"double"},"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Quad":{"description":"Describes a compass quadrant.","type":"string","enum":["North","East","South","West"]},"Record":{"type":"object","required":["classification","location","record_number","time"],"properties":{"alarm":{"description":"(Optional) An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and the generation of associated data in the UAS Activity Log, as a result of Declared UAS activity.","anyOf":[{"$ref":"#/definitions/Alarm"},{"type":"null"}]},"classification":{"description":"Classification of the record.","allOf":[{"$ref":"#/definitions/Classification"}]},"cuas_location":{"description":"(Optional) The 3D GPS location of the CUAS recorded on this instant. Overrides the document's static_cuas_location.","anyOf":[{"$ref":"#/definitions/Position3d"},{"type":"null"}]},"identification":{"description":"(Optional) Free form text, possibly describing the model or configuration of the UAS identified.","type":["string","null"]},"location":{"description":"The UAS location, which may be given in one of several declaration types. Location types are composed of a tag 't' and a contents element 'c'.","allOf":[{"$ref":"#/definitions/Location"}]},"record_number":{"description":"A unique number that identifies this record between all other ones present in the document.","type":"integer","format":"uint64","minimum":0.0},"time":{"description":"UTC time as an Unix millisecond timestamp.","type":"integer","format":"uint64","minimum":0.0}}},"Track":{"type":"object","required":["records","uas_id"],"properties":{"name":{"description":"(Optional) Free-form text describing the track. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this track.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this track with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.","type":"integer","format":"uint64","minimum":0.0}}}}} \ No newline at end of file +{"$schema":"http://json-schema.org/draft-07/schema#","title":"Document","type":"object","required":["detection","static_cuas_location","system_name","tracks","vendor_name"],"properties":{"detection":{"description":"A list containing the detection sets present in the document.","type":"array","items":{"$ref":"#/definitions/Detection"}},"static_cuas_location":{"description":"The 3D GPS location of the CUAS. Can be overriden per Record, but even if overriden this value must exist and be a valid position.","allOf":[{"$ref":"#/definitions/Position3d"}]},"system_name":{"type":"string"},"tracks":{"description":"A list containing the tracks present in the document.","type":"array","items":{"$ref":"#/definitions/Track"}},"vendor_name":{"type":"string"}},"definitions":{"Alarm":{"type":"object","required":["active","alarm_certainty"],"properties":{"active":{"description":"Whether the alarm function of the CUAS system is active or not.","type":"boolean"},"alarm_certainty":{"description":"How certain is the system of an active alarm, as a value from 0 (Least likely) to 1 (Most likely).","type":"number","format":"double","maximum":1.0,"minimum":0.0}}},"Arc":{"description":"Describes a circular arc between two clockwise angles from true north.","type":"object","required":["from","to"],"properties":{"from":{"description":"Minimum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"},"to":{"description":"Maximum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"}}},"Classification":{"type":"string","enum":["Unknown","UAV","GCS","Other"]},"Detection":{"type":"object","required":["records"],"properties":{"name":{"description":"Free-form text describing the detection set. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this detection.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this detection with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.\n\nIf null, means the system was not able to identify the records present along with this object with any specific UAS.","type":["integer","null"],"format":"uint64","minimum":0.0}}},"Location":{"description":"Location of an UAS, which may be relative to the CUAS.\nLocation objects are composed of a tag 't' which indicates the variant and a contents element 'c' which contains the variant's data.","oneOf":[{"description":"Circular arc relative to the CUAS within which the UAS resides.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Arc"},"t":{"type":"string","enum":["Arc"]}}},{"description":"Compass quadrant where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Quad"},"t":{"type":"string","enum":["Quad"]}}},{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"type":"number","format":"double"},"t":{"type":"string","enum":["Bearing"]}}},{"description":"Flat 2D position given in latitude and longitude.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position2d"},"t":{"type":"string","enum":["Position2d"]}}},{"description":"3D position given in latitude, longitude and height.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position3d"},"t":{"type":"string","enum":["Position3d"]}}},{"description":"Ray where the UAS has been observed given in bearing and elevation.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevation"]}}},{"description":"3D position of the UAS given in bearing, elevation angle and distance.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","distance","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"distance":{"description":"Distance from the UAS to the CUAS given in meters.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevationDistance"]}}}]},"Position2d":{"description":"2D WGS84 position given in latitude and longitude.","type":"object","required":["lat","lon"],"properties":{"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Position3d":{"description":"3D WGS84 position given in latitude, longitude and height.","type":"object","required":["height_amsl","lat","lon"],"properties":{"height_amsl":{"description":"Height measured in meters from sea level.","type":"number","format":"double"},"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Quad":{"description":"Describes a compass quadrant.","type":"string","enum":["North","East","South","West"]},"Record":{"type":"object","required":["classification","location","record_number","time"],"properties":{"alarm":{"description":"An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and the generation of associated data in the UAS Activity Log, as a result of Declared UAS activity.","anyOf":[{"$ref":"#/definitions/Alarm"},{"type":"null"}]},"classification":{"description":"Classification of the record.","allOf":[{"$ref":"#/definitions/Classification"}]},"cuas_location":{"description":"The 3D GPS location of the CUAS recorded on this instant. Overrides the document's static_cuas_location.","anyOf":[{"$ref":"#/definitions/Position3d"},{"type":"null"}]},"identification":{"description":"Free form text, possibly describing the model or configuration of the UAS identified.","type":["string","null"]},"location":{"description":"The UAS location, which may be given in one of several declaration types.","allOf":[{"$ref":"#/definitions/Location"}]},"record_number":{"description":"A unique number that identifies this record between all other ones present in the document.","type":"integer","format":"uint64","minimum":0.0},"time":{"description":"UTC time as an Unix millisecond timestamp.","type":"integer","format":"uint64","minimum":0.0}}},"Track":{"type":"object","required":["records","uas_id"],"properties":{"name":{"description":"Free-form text describing the track. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this track.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this track with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.","type":"integer","format":"uint64","minimum":0.0}}}}} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index e54e431..74b6e8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,7 +59,6 @@ pub struct Record { /// activity. pub alarm: Option, /// The UAS location, which may be given in one of several declaration types. - /// Location types are composed of a tag 't' and a contents element 'c'. pub location: Location, /// Free form text, possibly describing the model or configuration of the UAS identified. pub identification: Option, @@ -93,6 +92,8 @@ pub enum Classification { #[cfg_attr(feature = "schemars", derive(JsonSchema))] #[serde(tag = "t", content = "c")] /// Location of an UAS, which may be relative to the CUAS. +#[schemars(description = "Location of an UAS, which may be relative to the CUAS. +Location objects are composed of a tag 't' which indicates the variant and a contents element 'c' which contains the variant's data.")] pub enum Location { // clockwise: from -> to (degrees) /// Circular arc relative to the CUAS within which the UAS resides. From 0f34b98c6a900494b80b417672fe934f6800aa8e Mon Sep 17 00:00:00 2001 From: aleokdev Date: Mon, 17 Jul 2023 00:24:47 +0200 Subject: [PATCH 4/5] Improve Alarm docs --- src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 74b6e8d..e314c1c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,9 +54,10 @@ pub struct Record { pub record_number: u64, /// Classification of the record. pub classification: Classification, - /// An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and - /// the generation of associated data in the UAS Activity Log, as a result of Declared UAS - /// activity. + /// If the record has Alarm data on this record, it may be specified here. + /// + /// On tracking data, this element SHOULD be present. If a parser finds a null alarm member on a tracking record, + /// the behavior is left as implementation-defined. pub alarm: Option, /// The UAS location, which may be given in one of several declaration types. pub location: Location, @@ -67,6 +68,9 @@ pub struct Record { pub cuas_location: Option, } +/// An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and +/// the generation of associated data in the UAS Activity Log, as a result of Declared UAS +/// activity. #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Copy)] #[cfg_attr(feature = "schemars", derive(JsonSchema))] pub struct Alarm { From d4731ab2f3cadc95c4b31c75f1bcdcd66aaf4791 Mon Sep 17 00:00:00 2001 From: aleokdev Date: Mon, 17 Jul 2023 00:29:11 +0200 Subject: [PATCH 5/5] Update schema --- courageous.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/courageous.schema.json b/courageous.schema.json index 5c1ccbb..90ac088 100644 --- a/courageous.schema.json +++ b/courageous.schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft-07/schema#","title":"Document","type":"object","required":["detection","static_cuas_location","system_name","tracks","vendor_name"],"properties":{"detection":{"description":"A list containing the detection sets present in the document.","type":"array","items":{"$ref":"#/definitions/Detection"}},"static_cuas_location":{"description":"The 3D GPS location of the CUAS. Can be overriden per Record, but even if overriden this value must exist and be a valid position.","allOf":[{"$ref":"#/definitions/Position3d"}]},"system_name":{"type":"string"},"tracks":{"description":"A list containing the tracks present in the document.","type":"array","items":{"$ref":"#/definitions/Track"}},"vendor_name":{"type":"string"}},"definitions":{"Alarm":{"type":"object","required":["active","alarm_certainty"],"properties":{"active":{"description":"Whether the alarm function of the CUAS system is active or not.","type":"boolean"},"alarm_certainty":{"description":"How certain is the system of an active alarm, as a value from 0 (Least likely) to 1 (Most likely).","type":"number","format":"double","maximum":1.0,"minimum":0.0}}},"Arc":{"description":"Describes a circular arc between two clockwise angles from true north.","type":"object","required":["from","to"],"properties":{"from":{"description":"Minimum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"},"to":{"description":"Maximum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"}}},"Classification":{"type":"string","enum":["Unknown","UAV","GCS","Other"]},"Detection":{"type":"object","required":["records"],"properties":{"name":{"description":"Free-form text describing the detection set. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this detection.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this detection with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.\n\nIf null, means the system was not able to identify the records present along with this object with any specific UAS.","type":["integer","null"],"format":"uint64","minimum":0.0}}},"Location":{"description":"Location of an UAS, which may be relative to the CUAS.\nLocation objects are composed of a tag 't' which indicates the variant and a contents element 'c' which contains the variant's data.","oneOf":[{"description":"Circular arc relative to the CUAS within which the UAS resides.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Arc"},"t":{"type":"string","enum":["Arc"]}}},{"description":"Compass quadrant where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Quad"},"t":{"type":"string","enum":["Quad"]}}},{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"type":"number","format":"double"},"t":{"type":"string","enum":["Bearing"]}}},{"description":"Flat 2D position given in latitude and longitude.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position2d"},"t":{"type":"string","enum":["Position2d"]}}},{"description":"3D position given in latitude, longitude and height.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position3d"},"t":{"type":"string","enum":["Position3d"]}}},{"description":"Ray where the UAS has been observed given in bearing and elevation.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevation"]}}},{"description":"3D position of the UAS given in bearing, elevation angle and distance.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","distance","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"distance":{"description":"Distance from the UAS to the CUAS given in meters.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevationDistance"]}}}]},"Position2d":{"description":"2D WGS84 position given in latitude and longitude.","type":"object","required":["lat","lon"],"properties":{"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Position3d":{"description":"3D WGS84 position given in latitude, longitude and height.","type":"object","required":["height_amsl","lat","lon"],"properties":{"height_amsl":{"description":"Height measured in meters from sea level.","type":"number","format":"double"},"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Quad":{"description":"Describes a compass quadrant.","type":"string","enum":["North","East","South","West"]},"Record":{"type":"object","required":["classification","location","record_number","time"],"properties":{"alarm":{"description":"An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and the generation of associated data in the UAS Activity Log, as a result of Declared UAS activity.","anyOf":[{"$ref":"#/definitions/Alarm"},{"type":"null"}]},"classification":{"description":"Classification of the record.","allOf":[{"$ref":"#/definitions/Classification"}]},"cuas_location":{"description":"The 3D GPS location of the CUAS recorded on this instant. Overrides the document's static_cuas_location.","anyOf":[{"$ref":"#/definitions/Position3d"},{"type":"null"}]},"identification":{"description":"Free form text, possibly describing the model or configuration of the UAS identified.","type":["string","null"]},"location":{"description":"The UAS location, which may be given in one of several declaration types.","allOf":[{"$ref":"#/definitions/Location"}]},"record_number":{"description":"A unique number that identifies this record between all other ones present in the document.","type":"integer","format":"uint64","minimum":0.0},"time":{"description":"UTC time as an Unix millisecond timestamp.","type":"integer","format":"uint64","minimum":0.0}}},"Track":{"type":"object","required":["records","uas_id"],"properties":{"name":{"description":"Free-form text describing the track. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this track.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this track with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.","type":"integer","format":"uint64","minimum":0.0}}}}} \ No newline at end of file +{"$schema":"http://json-schema.org/draft-07/schema#","title":"Document","type":"object","required":["detection","static_cuas_location","system_name","tracks","vendor_name"],"properties":{"detection":{"description":"A list containing the detection sets present in the document.","type":"array","items":{"$ref":"#/definitions/Detection"}},"static_cuas_location":{"description":"The 3D GPS location of the CUAS. Can be overriden per Record, but even if overriden this value must exist and be a valid position.","allOf":[{"$ref":"#/definitions/Position3d"}]},"system_name":{"type":"string"},"tracks":{"description":"A list containing the tracks present in the document.","type":"array","items":{"$ref":"#/definitions/Track"}},"vendor_name":{"type":"string"}},"definitions":{"Alarm":{"description":"An Alarm is defined as the function of a CUAS system alerting an Operator via the HMI and the generation of associated data in the UAS Activity Log, as a result of Declared UAS activity.","type":"object","required":["active","alarm_certainty"],"properties":{"active":{"description":"Whether the alarm function of the CUAS system is active or not.","type":"boolean"},"alarm_certainty":{"description":"How certain is the system of an active alarm, as a value from 0 (Least likely) to 1 (Most likely).","type":"number","format":"double","maximum":1.0,"minimum":0.0}}},"Arc":{"description":"Describes a circular arc between two clockwise angles from true north.","type":"object","required":["from","to"],"properties":{"from":{"description":"Minimum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"},"to":{"description":"Maximum compass angle from the CUAS System to the UAS in degrees.","type":"number","format":"double"}}},"Classification":{"type":"string","enum":["Unknown","UAV","GCS","Other"]},"Detection":{"type":"object","required":["records"],"properties":{"name":{"description":"Free-form text describing the detection set. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this detection.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this detection with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.\n\nIf null, means the system was not able to identify the records present along with this object with any specific UAS.","type":["integer","null"],"format":"uint64","minimum":0.0}}},"Location":{"description":"Location of an UAS, which may be relative to the CUAS.\nLocation objects are composed of a tag 't' which indicates the variant and a contents element 'c' which contains the variant's data.","oneOf":[{"description":"Circular arc relative to the CUAS within which the UAS resides.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Arc"},"t":{"type":"string","enum":["Arc"]}}},{"description":"Compass quadrant where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Quad"},"t":{"type":"string","enum":["Quad"]}}},{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"object","required":["c","t"],"properties":{"c":{"type":"number","format":"double"},"t":{"type":"string","enum":["Bearing"]}}},{"description":"Flat 2D position given in latitude and longitude.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position2d"},"t":{"type":"string","enum":["Position2d"]}}},{"description":"3D position given in latitude, longitude and height.","type":"object","required":["c","t"],"properties":{"c":{"$ref":"#/definitions/Position3d"},"t":{"type":"string","enum":["Position3d"]}}},{"description":"Ray where the UAS has been observed given in bearing and elevation.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevation"]}}},{"description":"3D position of the UAS given in bearing, elevation angle and distance.","type":"object","required":["c","t"],"properties":{"c":{"type":"object","required":["bearing","distance","elevation"],"properties":{"bearing":{"description":"Clockwise angle in degrees from true north where the UAS has been observed.","type":"number","format":"double"},"distance":{"description":"Distance from the UAS to the CUAS given in meters.","type":"number","format":"double"},"elevation":{"description":"Elevation angle in degrees over the horizon where the UAS has been observed.","type":"number","format":"double"}}},"t":{"type":"string","enum":["BearingElevationDistance"]}}}]},"Position2d":{"description":"2D WGS84 position given in latitude and longitude.","type":"object","required":["lat","lon"],"properties":{"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Position3d":{"description":"3D WGS84 position given in latitude, longitude and height.","type":"object","required":["height_amsl","lat","lon"],"properties":{"height_amsl":{"description":"Height measured in meters from sea level.","type":"number","format":"double"},"lat":{"description":"GPS WGS84 latitude measured in degrees.","type":"number","format":"double"},"lon":{"description":"GPS WGS84 longitude measured in degrees.","type":"number","format":"double"}}},"Quad":{"description":"Describes a compass quadrant.","type":"string","enum":["North","East","South","West"]},"Record":{"type":"object","required":["classification","location","record_number","time"],"properties":{"alarm":{"description":"If the record has Alarm data on this record, it may be specified here.\n\nOn tracking data, this element SHOULD be present. If a parser finds a null alarm member on a tracking record, the behavior is left as implementation-defined.","anyOf":[{"$ref":"#/definitions/Alarm"},{"type":"null"}]},"classification":{"description":"Classification of the record.","allOf":[{"$ref":"#/definitions/Classification"}]},"cuas_location":{"description":"The 3D GPS location of the CUAS recorded on this instant. Overrides the document's static_cuas_location.","anyOf":[{"$ref":"#/definitions/Position3d"},{"type":"null"}]},"identification":{"description":"Free form text, possibly describing the model or configuration of the UAS identified.","type":["string","null"]},"location":{"description":"The UAS location, which may be given in one of several declaration types.","allOf":[{"$ref":"#/definitions/Location"}]},"record_number":{"description":"A unique number that identifies this record between all other ones present in the document.","type":"integer","format":"uint64","minimum":0.0},"time":{"description":"UTC time as an Unix millisecond timestamp.","type":"integer","format":"uint64","minimum":0.0}}},"Track":{"type":"object","required":["records","uas_id"],"properties":{"name":{"description":"Free-form text describing the track. Can be, for instance, the name present on the HMI.","type":["string","null"]},"records":{"description":"A list of records associated with this track.","type":"array","items":{"$ref":"#/definitions/Record"}},"uas_id":{"description":"A unique ID used to associate this track with a specific UAS. The number itself is not relevant, it just needs to be unique per UAS.","type":"integer","format":"uint64","minimum":0.0}}}}} \ No newline at end of file