Create initial message schemas
- No files found.
added Status: In Progress Weight::2 labels
- Trishna Saeharaseelan @trishna changed title from Create intial message schemas to Create initial message schemas
changed title from Create intial message schemas to Create initial message schemas
- Owner
Note: Ignore all the files under
examples/*
. Main files are:- README.md
- init.py
- autonomy_configuration.py
- platform_status.py
Edited by Trishna Saeharaseelan - Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
Another thing to consider is the sensor data for perception or scientific observation, and whether it should go under platform status or a separate status message/topic for on-board sensor payload. Another thing we discussed previously is if this could be made generic or if we should allow customised data/messages for some platforms.
For SoAR, this would be for the pings/targets/feature-of-interests detected by the AUVs.
- Last reply by Trishna Saeharaseelan
added 1 commit
- 8c944219 - refactor: schemas and ntoes for observation data
added 1 commit
- 4ba55ad5 - refactor(docs): add row for autonomy engine's mission plan
- Owner
[Alvaro] Add message format version
added 7 commits
-
4ba55ad5...defa0678 - 3 commits from branch
master
- 1b804987 - refactor: docs and schemas
- a264b259 - refactor(docs): updated message types and summary table
- f739a9ed - Merge branch 'master' into 7-message-formats-initial
- ca8d8e59 - refactor: update fields for all formats
Toggle commit list-
4ba55ad5...defa0678 - 3 commits from branch
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
added 1 commit
- f7ad53ea - fix: examples for hydrosurv and correct SOAR_README.md
added 1 commit
- 745ee8c4 - refactor(READMEs): Remove irrelevant details
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
added 1 commit
- 3a41f4a2 - refactor(docs): change swagger2.0 to openapi3.0 to support oneOf
added 1 commit
- e113878b - refactor: all messages from flask model to json schema definitions
- Resolved by Trishna Saeharaseelan
- OwnerResolved by Trishna Saeharaseelan
To add separate message schema for
usbl_position_updates
latitude: <> longitude: <> depth: <> timestamp: <> comms_quality: <> ref_platform_ID: <>
Edited by Trishna Saeharaseelan - Last reply by Trishna Saeharaseelan
added 1 commit
- 46142c35 - fix(acknowledgement): schema for swagger, update hydrosurv egs#
requested review from @jamki
- Last updated by Trishna Saeharaseelan
1 { 2 "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", 3 "timestamp": "2022-11-16T00:00:00Z", 4 "version": 2, 5 "source": "hermes", 6 "destination": "autonomy_engine", 7 "delivery_type": "publish", 8 "encoded": false, 9 "message_type": "platform_status", 10 "platform_ID": 1, - Owner
@geosal to have a look for USBL positions update example.
changed this line in version 27 of the diff
Please register or sign in to reply - Last updated by Trishna Saeharaseelan
1 { 2 "message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd", 3 "timestamp": "2022-11-16T00:00:00Z", 4 "version": 2, 5 "source": "ecosub_c2", 6 "destination": "autonomy_engine", 7 "delivery_type": "publish", 8 "encoded": false, 9 "message_type": "observation", 10 "platform_ID": 3, - Owner
@geosal to have a look at observations example. Is anything missing?
changed this line in version 27 of the diff
added 1 commit
- d5cf284f - refactor(example): planning configuration example to include emergency behaviour
- Last updated by Trishna Saeharaseelan
96 "safe_command": "go_home", 97 "target_depth": 10.0 98 }, 99 "max_velocity": 0.9, 100 "min_altitude": 15.2, 101 "min_velocity": 0.1, 102 "additional_data": { 103 "scan_type": "DVL", 104 "swath_width": 10 105 } 106 }, 107 { 108 "platform_ID": 10, 109 "serial": "ecosub-5", 110 "model": "ecosub", 111 "emergency": { - Owner
- Owner
Remove
safe_command
changed this line in version 27 of the diff
- OwnerResolved by Trishna Saeharaseelan
[DAN] Useful to add a heading value in the vehicle status updates
- Last reply by Trishna Saeharaseelan
added 1 commit
- db639711 - refactor: add heading field to platform status
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Last updated by Trishna Saeharaseelan
42 "example": 15.0, 43 }, 44 "activate_payload": { 45 "type": "boolean", 46 "description": "To activate/deactivate sensor for Autosub " 47 + "Hover-1 --> `MBES` sensor and for EcoSUB --> `Sidescan`", 48 "example": True, 49 }, 50 "send_environmental_data": { 51 "type": "boolean", 52 "description": "To trigger the platform to send list of" 53 + " observations if any found", 54 "example": False, 55 }, 56 }, 57 "required": [ - Owner
Should
action
also be required? I guess the sub can declare its position without that, but I'd think that might be an action in and of itself?declare_pos
action or something? - Owner
[TO DISCUSS]
action
is basically from the Autonomy engine's side (i.e. what is the "action" in autonomy engine lingo). Let's discuss?Edited by Trishna Saeharaseelan - Owner
To be platform-agnostic; remove
flightstyle
field + makeaction
mandatorydeclare_pos
> not needed
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- Resolved by Trishna Saeharaseelan
- OwnerResolved by Trishna Saeharaseelan
Few comments of little bits I think have been from copy + pasting
Only other thing is there's a lot of TODOs, commented out stuff, and just things to come back to later. Are the comments needed in there? And are there issues or notes somewhere of what work is left to do amongst all the TODOs and that? - Last reply by Trishna Saeharaseelan
Can we have a chat about the structure of the messages maybe after stand-up tomorrow? This (I think) is the opposite way round from the schema I've based the prototype on. In the prototype schema every message is an instance of Message and the anyOf defines which payload schema it contains. The idea is that the backbone only deals in messages and passes the message on to the protocol handler which cares about what a message contains.
The model here is there are a bunch of different top-level schemas which each contain the content of the "Message" schema. It may well be fine or even preferable but it doesn't match the thing I've currently got working so it's probably worth a conversation.
- Collapse replies
- Owner
[TO DISCUSS] Interesting. Let's discuss this (need to clarify). If we need to change it from this end instead of the core, we should make the changes sooner since the partners will be working with this schemas as a start
Edited by Trishna Saeharaseelan - Owner
- Trishna to follow the structure the adapter is using to read schemas
- Validate all examples
added Status::In Review label and removed Status::In Progress label
added 1 commit
- 1b8ad63e - fix(formats): corrected type and examples definitions#
changed milestone to %SoAR-2023W01
- Collapse replies
- Owner
So with
openapi-spec-validator
it was validated successfully. Let's chat. That being said, I will add a task to build some tests Oh wait a minute.
openapi-spec-validator
is validating that theswagger.json
conforms to the open api standard. It's not parsing a messaging and validating that the message conforms to the schema definition. What I'm talking about is validating that the exampleplatform_status.json
messages validate against thePlatformStatus definition
defined in the schema.I think the python version of what I'm talking about is here: https://github.com/p1c2u/openapi-schema-validator
- Resolved by Trishna Saeharaseelan
The
swagger.json
is also curiously different in structure to all out existing APIs. Normally the models are underdefinitions
but here they're undercomponents/schemas
anddefinitions
is there but empty.Edited by Dan Jones - Last reply by Trishna Saeharaseelan
added 1 commit
- 231dca1e - refactor(specs): replace components/schemas to definitions
7 action_schema = { 8 "type": "object", 9 "properties": { 10 "action": { 11 "type": "string", 12 "description": "Autonomy Engine's action from `move`, `payload`," 13 + " `dive`, `send_hits`, `scanline`, `scanpoint`.", 14 "example": "move", 15 }, 16 "flight_style": { 17 "type": "string", 18 "description": "Platform-specific modes/flight styles to perform" 19 + " next action", 20 "example": "orbit", 21 }, 22 "latitude_waypoint": { The other thing Ashley suggested was that rather than define our own schema for anything geographic we just point to the existing GeoJson feature schema: https://geojson.org/schema/Feature.json
We could explicitly require a Point or a BoundingBox or whatever or just point to the parent feature definition.
Point
is not very specific - it just has a min of 2 coordinates so we could supply 3=z or even 4=depth+altitude if it were necessary.The advantage of using Feature would be that the operating area and exclusion zones could be a BoundingBox or they could be a Polygon or even a MultiPolygon. We might not want to allow that complexity for the MVP but it would be good to have it in future - especially given the ultimate goal of the funders.
- Owner
Actually geojson is being in the
planning_configuration
message forexclusion_zones
and the optionalregion_of_interest
. Would we want to generate a 4-point polygon for eachpoint
then? What I mean by using geojson is adding a ref to the published geojson schema.
"coordinates": { "$ref": "https://geojson.org/schema/Point.json" },
What the planning configuration message is doing is creating a data structure that matches GeoJSON.
To do that we'd need a validator that supported resolving remote refs which it seems like the one I'm currently using doesn't.
This one does it: https://www.npmjs.com/package/json-schema-remote
added 1 commit
- 806f47dc - refactor(specs): revert definitions back to components/schemas
- Last updated by Trishna Saeharaseelan
22 "example": {"payload": [1.2, 434]}, 23 }, 24 }, 25 "required": [], 26 } 27 28 platform_status_message_schema = { 29 "allOf": [{"$ref": "#/components/schemas/Message"}], 30 "type": "object", 31 "properties": { 32 "platform_ID": { 33 "type": "integer", 34 "description": "Identifier for platform", 35 "example": 1, 36 }, 37 "status_source": { - Owner
@allore what's the best terminology to distinguish between the type of status message (i.e. from USBL or from the platform itself) vs. source/rx mode of the message (i.e. from acoustics, iridium, or wifi)?
- Owner
Tricky. Maybe we want a field called something like platform_source: {USBL, Slocum, Ecosub, ALR ...} and other called transmission_mean : {Wifi, acoustics, iridium, starlink ... }
changed this line in version 24 of the diff
- Last updated by Trishna Saeharaseelan
66 "description": "Minimum altitude set for squad.", 67 "example": 15.2, 68 }, 69 "min_velocity": { 70 "type": "number", 71 "format": "float", 72 "description": "Minimum velocity set for squad.", 73 "example": 0.1, 74 }, 75 "max_velocity": { 76 "type": "number", 77 "format": "float", 78 "description": "Maximum altitude set for squad.", 79 "example": 0.9, 80 }, 81 "additional_data": { - Owner
To add warm-up time field in the planning config (e.g. for ecosub warm-up of sidescan payload)
changed this line in version 24 of the diff
added 1 commit
- bc7486ed - refactor: schemas and added abstract message
removed Status::In Review label
added 1 commit
- f7f2af75 - refactor(platform_status): uncomment fields temporarily removed
added 1 commit
- 36a44fff - refactor: examples and platform_ID type to string
- Last updated by Trishna Saeharaseelan
1 Flask 2 flask-restx 3 flasgger 4 flask-marshmallow changed this line in version 30 of the diff
- Owner
DONE
- Last updated by Trishna Saeharaseelan
18 """ 19 schema, spec_url = read_from_filename("fixtures/swagger.json") 20 errors_iterator = openapi_v3_spec_validator.iter_errors(schema) 21 print(errors_iterator) 22 print(openapi_v30_spec_validator.validate(schema)) 23 24 """ 25 Test schema - Hydrosurv Messages 26 """ 27 message_types = ["acknowledgement", "mission_plan", "platform_status"] 28 for item in message_types: 29 f = open("mock_data/hydrosurv_adapter/%s.json" % item) 30 mock_data = json.load(f) 31 header_data = mock_data["header"] 32 payload_data = mock_data["payload"] 33 print(validate(header_data, message_header, format_checker=FormatChecker())) changed this line in version 29 of the diff
- Owner
-
Didn't just validate the FULL mock messages against message_schema because it kept passing even when it should have errors. Decided to break it down in the meantime to ensure it gets validated & does prompt errors (as it should). Added TODO in epic issue card to clean this up for better validation
-
DONE
Edited by Trishna Saeharaseelan -
added 2 commits
merged
mentioned in commit fd3f162a
- You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
- version 291ac5df20
- version 28e1120fa6
- version 2736a44fff
- version 26316a1b7a
- version 25f7f2af75
- version 24611b7b21
- version 2389576e08
- version 224c0a0aba
- version 21bc7486ed
- version 20806f47dc
- version 19231dca1e
- version 181b8ad63e
- version 17db639711
- version 16d5cf284f
- version 154d66e94b
- version 14e3120afe
- version 1346142c35
- version 12e113878b
- version 113a41f4a2
- version 10745ee8c4
- version 9f7ad53ea
- version 842a832fe
- version 7ca8d8e59
- version 64ba55ad5
- version 5e5c41f0a
- version 48c944219
- version 33a1cdab5
- version 27ceab743
- version 16d9a565f
- master (base)
- latest version2885764438 commits,
- version 291ac5df2037 commits,
- version 28e1120fa635 commits,
- version 2736a44fff34 commits,
- version 26316a1b7a33 commits,
- version 25f7f2af7532 commits,
- version 24611b7b2131 commits,
- version 2389576e0830 commits,
- version 224c0a0aba29 commits,
- version 21bc7486ed28 commits,
- version 20806f47dc27 commits,
- version 19231dca1e26 commits,
- version 181b8ad63e25 commits,
- version 17db63971124 commits,
- version 16d5cf284f23 commits,
- version 154d66e94b22 commits,
- version 14e3120afe21 commits,
- version 1346142c3520 commits,
- version 12e113878b19 commits,
- version 113a41f4a218 commits,
- version 10745ee8c417 commits,
- version 9f7ad53ea16 commits,
- version 842a832fe15 commits,
- version 7ca8d8e5914 commits,
- version 64ba55ad510 commits,
- version 5e5c41f0a9 commits,
- version 48c9442198 commits,
- version 33a1cdab57 commits,
- version 27ceab7436 commits,
- version 16d9a565f5 commits,