Commit ee5e43ba authored by Dan Jones's avatar Dan Jones
Browse files

Merge branch '61-mas-dt-refactor-action-schema' into '67-mas-dt'

Resolve "MAS-DT refactor action schema"

See merge request !43
3 merge requests!59Release v2.0.0,!43Resolve "MAS-DT refactor action schema",!36Resolve "Create temporary mas-dt branch for initial schema refactor"
Pipeline #232352 passed with stages
in 1 minute and 5 seconds
...@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ...@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed ### Changed
- Refactor action schema to accept geojson.Points
- Use geojson Point for platform_status - Use geojson Point for platform_status
- Add waypoint to platform_status - Add waypoint to platform_status
- Store remote schemas as committed local files - Store remote schemas as committed local files
......
{
"header": {
"message_ID": "b427003c-0000-11aa-a1eb-bvcdfghjgfdd",
"timestamp": "2022-11-16T00:00:00Z",
"version": 2,
"source": "autonomy_engine",
"destination": "soar.noc.autosub.alr-52.to_platform.mission_plan",
"delivery_type": "publish",
"encoded": false
},
"payload":{
"message_type": "mission_plan",
"platform_ID": "alr-52",
"autonomy_engine_plan_ID": "a427003c-0000-11aa-a1eb-bvcdfghjgfcc",
"plan": [
{
"action": "move",
"start": {
"type": "Point",
"coordinates": [
-3.0071,
50.3707
]
},
"target": {
"type": "Point",
"coordinates": [
-3.2371,
52.3707,
0.0
]
}
}
]
}
}
\ No newline at end of file
...@@ -25,42 +25,6 @@ action_schema = { ...@@ -25,42 +25,6 @@ action_schema = {
], ],
"example": "move", "example": "move",
}, },
"start_point_latitude": {
"type": "number",
"format": "float",
"description": "Start point, y-coordinate",
"example": 50.37072283932642,
},
"start_point_longitude": {
"type": "number",
"format": "float",
"description": "Start point, x-coordinate",
"example": -4.187143188645706,
},
"target_waypoint_latitude": {
"type": "number",
"format": "float",
"description": "Target waypoint, y-coordinate",
"example": 50.37072283932642,
},
"target_waypoint_longitude": {
"type": "number",
"format": "float",
"description": "Target waypoint, x-coordinate",
"example": -4.187143188645706,
},
"altitude": {
"type": "number",
"format": "float",
"description": "Altitude of next action",
"example": 15.0,
},
"depth": {
"type": "number",
"format": "float",
"description": "Depth of next action",
"example": 15.0,
},
"activate_payload": { "activate_payload": {
"type": "boolean", "type": "boolean",
"description": "To activate/deactivate sensor for Autosub " "description": "To activate/deactivate sensor for Autosub "
...@@ -74,9 +38,66 @@ action_schema = { ...@@ -74,9 +38,66 @@ action_schema = {
"example": 1800.0, "example": 1800.0,
}, },
}, },
"required": [ "oneOf": [
"target_waypoint_latitude", {
"target_waypoint_longitude", "type": "object",
"properties": {
"start": {
"$ref": "https://geojson.org/schema/Point.json",
},
"target": {
"$ref": "https://geojson.org/schema/Point.json",
},
},
"required": [
"target",
],
},
{
"type": "object",
"properties": {
"start_point_latitude": {
"type": "number",
"format": "float",
"description": "Start point, y-coordinate",
"example": 50.37072283932642,
},
"start_point_longitude": {
"type": "number",
"format": "float",
"description": "Start point, x-coordinate",
"example": -4.187143188645706,
},
"target_waypoint_latitude": {
"type": "number",
"format": "float",
"description": "Target waypoint, y-coordinate",
"example": 50.37072283932642,
},
"target_waypoint_longitude": {
"type": "number",
"format": "float",
"description": "Target waypoint, x-coordinate",
"example": -4.187143188645706,
},
"altitude": {
"type": "number",
"format": "float",
"description": "Altitude of next action",
"example": 15.0,
},
"depth": {
"type": "number",
"format": "float",
"description": "Depth of next action",
"example": 15.0,
},
},
"required": [
"target_waypoint_latitude",
"target_waypoint_longitude",
],
},
], ],
} }
...@@ -90,10 +111,20 @@ mission_plan_schema = { ...@@ -90,10 +111,20 @@ mission_plan_schema = {
"enum": ["mission_plan"], "enum": ["mission_plan"],
}, },
"autonomy_engine_plan_ID": { "autonomy_engine_plan_ID": {
"type": "integer", "oneOf": [
"description": "Unique identifier for this plan" {
+ "generated by the Autonomy Engine", "type": "string",
"example": 3, "format": "uuid",
"description": "Unique identifier for this plan"
+ "generated by the Autonomy Engine",
},
{
"type": "integer",
"description": "Unique identifier for this plan"
+ "generated by the Autonomy Engine",
"example": 3,
},
]
}, },
"platform_ID": { "platform_ID": {
"type": "string", "type": "string",
......
...@@ -1449,9 +1449,18 @@ ...@@ -1449,9 +1449,18 @@
"mission_plan": { "mission_plan": {
"properties": { "properties": {
"autonomy_engine_plan_ID": { "autonomy_engine_plan_ID": {
"description": "Unique identifier for this plangenerated by the Autonomy Engine", "oneOf": [
"example": 3, {
"type": "integer" "description": "Unique identifier for this plangenerated by the Autonomy Engine",
"format": "uuid",
"type": "string"
},
{
"description": "Unique identifier for this plangenerated by the Autonomy Engine",
"example": 3,
"type": "integer"
}
]
}, },
"emergency": { "emergency": {
"default": false, "default": false,
...@@ -1469,6 +1478,67 @@ ...@@ -1469,6 +1478,67 @@
}, },
"plan": { "plan": {
"items": { "items": {
"oneOf": [
{
"properties": {
"start": {
"$ref": "#/components/schemas/geojson.org.schema.Point.json"
},
"target": {
"$ref": "#/components/schemas/geojson.org.schema.Point.json"
}
},
"required": [
"target"
],
"type": "object"
},
{
"properties": {
"altitude": {
"description": "Altitude of next action",
"example": 15.0,
"format": "float",
"type": "number"
},
"depth": {
"description": "Depth of next action",
"example": 15.0,
"format": "float",
"type": "number"
},
"start_point_latitude": {
"description": "Start point, y-coordinate",
"example": 50.37072283932642,
"format": "float",
"type": "number"
},
"start_point_longitude": {
"description": "Start point, x-coordinate",
"example": -4.187143188645706,
"format": "float",
"type": "number"
},
"target_waypoint_latitude": {
"description": "Target waypoint, y-coordinate",
"example": 50.37072283932642,
"format": "float",
"type": "number"
},
"target_waypoint_longitude": {
"description": "Target waypoint, x-coordinate",
"example": -4.187143188645706,
"format": "float",
"type": "number"
}
},
"required": [
"target_waypoint_latitude",
"target_waypoint_longitude"
],
"type": "object"
}
],
"properties": { "properties": {
"action": { "action": {
"description": "Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.", "description": "Autonomy Engine's action from `move`, `payload`, `dive`, `send_hits`, `scanline`, `scanpoint`.",
...@@ -1492,42 +1562,6 @@ ...@@ -1492,42 +1562,6 @@
"example": true, "example": true,
"type": "boolean" "type": "boolean"
}, },
"altitude": {
"description": "Altitude of next action",
"example": 15.0,
"format": "float",
"type": "number"
},
"depth": {
"description": "Depth of next action",
"example": 15.0,
"format": "float",
"type": "number"
},
"start_point_latitude": {
"description": "Start point, y-coordinate",
"example": 50.37072283932642,
"format": "float",
"type": "number"
},
"start_point_longitude": {
"description": "Start point, x-coordinate",
"example": -4.187143188645706,
"format": "float",
"type": "number"
},
"target_waypoint_latitude": {
"description": "Target waypoint, y-coordinate",
"example": 50.37072283932642,
"format": "float",
"type": "number"
},
"target_waypoint_longitude": {
"description": "Target waypoint, x-coordinate",
"example": -4.187143188645706,
"format": "float",
"type": "number"
},
"timeout": { "timeout": {
"description": "Timeout set to perform action", "description": "Timeout set to perform action",
"example": 1800.0, "example": 1800.0,
...@@ -1535,10 +1569,6 @@ ...@@ -1535,10 +1569,6 @@
"type": "number" "type": "number"
} }
}, },
"required": [
"target_waypoint_latitude",
"target_waypoint_longitude"
],
"type": "object" "type": "object"
}, },
"type": "array" "type": "array"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment