From 4c77b4a1c86e4169b923a09858feb2337acb43b6 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:39:45 +0900 Subject: [PATCH 1/9] rename angle to pose --- AMR_Interop_Standard.json | 10 +++++----- MassRobotics-AMR-Sender/client.py | 18 +++++++++--------- examples/statusReport1.json | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index bf0647f..b9c8c07 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -1,7 +1,7 @@ { "definitions": { "quaternion": { - "description": "Quaternion representation of an angle", + "description": "Quaternion representation of an pose", "type": "object", "required": ["x", "y", "z", "w"], "properties": { @@ -14,7 +14,7 @@ "location": { "description": "Location of an object or AMR", "type": "object", - "required": ["x", "y", "angle", "planarDatum"], + "required": ["x", "y", "pose", "planarDatum"], "properties": { "x": { "type": "number" }, "y": { "type": "number" }, @@ -22,8 +22,8 @@ "type": "number", "default" : 0 }, - "angle" : { "$ref": "#/definitions/quaternion" }, "planarDatum": { + "pose" : { "$ref": "#/definitions/quaternion" }, "description": "Id of planarDatum AMR is referencing", "type": "string", "format": "uuid" @@ -33,7 +33,7 @@ "predictedLocation": { "description": "Predicted future location of an object or AMR", "type": "object", - "required": ["timestamp", "x", "y", "angle"], + "required": ["timestamp", "x", "y", "pose"], "properties": { "timestamp": { "description": "Predicted UTC time AMR will reach this location", @@ -46,7 +46,7 @@ "type": "number", "default" : 0 }, - "angle" : { "$ref": "#/definitions/quaternion" }, + "pose" : { "$ref": "#/definitions/quaternion" }, "planarDatumUUID": { "description": "Only necessary if different from AMRs current planarDatum", "type": "string", diff --git a/MassRobotics-AMR-Sender/client.py b/MassRobotics-AMR-Sender/client.py index 1f2477e..a4d01d1 100644 --- a/MassRobotics-AMR-Sender/client.py +++ b/MassRobotics-AMR-Sender/client.py @@ -57,24 +57,24 @@ async def sendMessage(uri): # Generate a random location, simulating that the AMR moves in circles r = 20 - angle = random.choice([ + pose = random.choice([ { "x": 0., "y": 0., "z": 0.087, "w": 0.996 }, { "x": 0., "y": 0., "z": -0.131, "w": 0.991 } ]) - status["location"] = {"x": math.cos(now) * r, "y": math.sin(now) * r, "z": 0, "angle": angle, "planarDatum": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"} + status["location"] = {"x": math.cos(now) * r, "y": math.sin(now) * r, "z": 0, "pose": pose, "planarDatum": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"} # Generate random paths and destinations side = random.choice([10, 20, 30]) status["path"] = [ - {"timestamp": (nowDt+timedelta(seconds=10)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": 0, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, - {"timestamp": (nowDt+timedelta(seconds=20)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": side, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, - {"timestamp": (nowDt+timedelta(seconds=30)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": side, "y": side, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, - {"timestamp": (nowDt+timedelta(seconds=40)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": side, "y": 0, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, - {"timestamp": (nowDt+timedelta(seconds=50)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": 0, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"} + {"timestamp": (nowDt+timedelta(seconds=10)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": 0, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, + {"timestamp": (nowDt+timedelta(seconds=20)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": side, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, + {"timestamp": (nowDt+timedelta(seconds=30)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": side, "y": side, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, + {"timestamp": (nowDt+timedelta(seconds=40)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": side, "y": 0, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, + {"timestamp": (nowDt+timedelta(seconds=50)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": 0, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"} ] status["destinations"] = [ - {"timestamp": (nowDt+timedelta(seconds=30)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": side, "y": side, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, - {"timestamp": (nowDt+timedelta(seconds=50)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": 0, "angle": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"} + {"timestamp": (nowDt+timedelta(seconds=30)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": side, "y": side, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"}, + {"timestamp": (nowDt+timedelta(seconds=50)).strftime("%Y-%m-%dT%H:%M:%S%z"), "x": 0, "y": 0, "pose": { "x": 0., "y": 0., "z": 0., "w": 1 }, "planarDatumUUID": "4B8302DA-21AD-401F-AF45-1DFD956B80B5"} ] # Send the report message diff --git a/examples/statusReport1.json b/examples/statusReport1.json index b396acb..ab005a5 100644 --- a/examples/statusReport1.json +++ b/examples/statusReport1.json @@ -5,7 +5,7 @@ "location" : { "x" : 0.5, "y" : 1, - "angle" : { + "pose" : { "w" : 0.924, "x" : 0.000, "y" : 0.000, From aa3679413e355439fd1ebe4eb757a3b436bbaff2 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:41:15 +0900 Subject: [PATCH 2/9] add datnumReferencePoint --- AMR_Interop_Standard.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index b9c8c07..2d465fb 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -11,6 +11,20 @@ "w": { "type": "number" } } }, + "datnumReferencePoint": { + "description": "A Datum Reference Point", + "type": "object", + "required": ["id", "name", "x", "y"], + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { "type": "string" }, + "x": { "type": "number" }, + "y": { "type": "number" } + } + }, "location": { "description": "Location of an object or AMR", "type": "object", From ed66ae7f360bf14ec76eaf81f81c082ae38f143e Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:43:49 +0900 Subject: [PATCH 3/9] add planarDatum --- AMR_Interop_Standard.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index 2d465fb..a8caa6a 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -25,6 +25,25 @@ "y": { "type": "number" } } }, + "planarDatum": { + "description": "Planar Datum", + "type": "object", + "required": ["id", "name", "level", "datumReferencePoints"], + "properties": { + "id": { "type": "string" }, + "name": { "type": "string" }, + "level": { "type": "integer" }, + "datumReferencePoints": { + "description": "Datum Reference Point ids", + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 2 + } + } + }, "location": { "description": "Location of an object or AMR", "type": "object", From 40676ac181601deaf7339c2fefb22942c1ade908 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:45:37 +0900 Subject: [PATCH 4/9] rename manualOverride to manualMode --- AMR_Interop_Standard.json | 2 +- MassRobotics-AMR-Sender/client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index a8caa6a..c72147f 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -188,7 +188,7 @@ "operationalState": { "description": "Current action the robot is performing", "type": "string", - "enum": ["navigating", "idle", "disabled", "offline", "charging", "waitingHumanEvent", "waitingExternalEvent", "waitingInternalEvent", "manualOverride"] + "enum": ["navigating", "idle", "disabled", "offline", "charging", "waitingHumanEvent", "waitingExternalEvent", "waitingInternalEvent", "manualMode"] }, "location": { "description": "Current Location of AMR", diff --git a/MassRobotics-AMR-Sender/client.py b/MassRobotics-AMR-Sender/client.py index a4d01d1..a11c99d 100644 --- a/MassRobotics-AMR-Sender/client.py +++ b/MassRobotics-AMR-Sender/client.py @@ -12,7 +12,7 @@ from datetime import datetime, timezone, timedelta OPERATIONAL_STATES = ["navigating", "idle", "disabled", "offline", "charging", - "waitingHumanEvent", "waitingExternalEvent", "waitingInternalEvent", "manualOverride"] + "waitingHumanEvent", "waitingExternalEvent", "waitingInternalEvent", "manualMode"] async def sendMessage(uri): async with websockets.connect(uri) as websocket: From dbe141ecb9fc2e20419d9c22b0af5f9d0281b785 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:48:45 +0900 Subject: [PATCH 5/9] move errorCodes definition --- AMR_Interop_Standard.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index c72147f..52db389 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -194,6 +194,14 @@ "description": "Current Location of AMR", "$ref": "#/definitions/location" }, + "errorCodes" : { + "description": "List of current error states - should be omitted for normal operation", + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, "velocity": { "description": "Current velocity of AMR", "type": "object", @@ -226,14 +234,6 @@ "minimum": 0, "inclusiveMaximum": 100 }, - "errorCodes" : { - "description": "List of current error states - should be omitted for normal operation", - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - }, "destinations" : { "description": "Target destination(s) of AGV", "type": "array", From 0e2a0a3190a51eb4277a3aed70fc4c5eebcf6786 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:50:07 +0900 Subject: [PATCH 6/9] rename destinations to nextWorkingLocations --- AMR_Interop_Standard.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index 52db389..6783f79 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -217,6 +217,15 @@ } } }, + "nextWorkingLocations" : { + "description": "Next working location(s). It is recommended that at least the destination is provided", + "type": "array", + "items": { + "$ref": "#/definitions/predictedLocation" + }, + "maxItems": 10, + "uniqueItems": true + }, "batteryPercentage" : { "description": "Percentage of battery remaining", "type": "number", @@ -234,15 +243,6 @@ "minimum": 0, "inclusiveMaximum": 100 }, - "destinations" : { - "description": "Target destination(s) of AGV", - "type": "array", - "items": { - "$ref": "#/definitions/predictedLocation" - }, - "maxItems": 10, - "uniqueItems": true - }, "path" : { "description": "Short term path of AGV ~10 sec", "type": "array", From d4a5ad1c5d2b55acdccf3c88d4fa7edcb8b4b070 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:56:40 +0900 Subject: [PATCH 7/9] change tab to space and remove white space at end of line --- AMR_Interop_Standard.json | 92 +++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index 6783f79..041e4d3 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -18,11 +18,11 @@ "properties": { "id": { "type": "string", - "format": "uuid" + "format": "uuid" }, - "name": { "type": "string" }, + "name": { "type": "string" }, "x": { "type": "number" }, - "y": { "type": "number" } + "y": { "type": "number" } } }, "planarDatum": { @@ -31,17 +31,17 @@ "required": ["id", "name", "level", "datumReferencePoints"], "properties": { "id": { "type": "string" }, - "name": { "type": "string" }, - "level": { "type": "integer" }, - "datumReferencePoints": { + "name": { "type": "string" }, + "level": { "type": "integer" }, + "datumReferencePoints": { "description": "Datum Reference Point ids", "type": "array", "items": { "type": "string", - "format": "uuid" + "format": "uuid" }, "minItems": 2 - } + } } }, "location": { @@ -51,12 +51,12 @@ "properties": { "x": { "type": "number" }, "y": { "type": "number" }, - "z": { - "type": "number", + "z": { + "type": "number", "default" : 0 }, - "planarDatum": { "pose" : { "$ref": "#/definitions/quaternion" }, + "planarDatum": { "description": "Id of planarDatum AMR is referencing", "type": "string", "format": "uuid" @@ -68,19 +68,19 @@ "type": "object", "required": ["timestamp", "x", "y", "pose"], "properties": { - "timestamp": { + "timestamp": { "description": "Predicted UTC time AMR will reach this location", - "type": "string", - "format": "date-time" + "type": "string", + "format": "date-time" }, "x": { "type": "number" }, "y": { "type": "number" }, - "z": { - "type": "number", + "z": { + "type": "number", "default" : 0 }, "pose" : { "$ref": "#/definitions/quaternion" }, - "planarDatumUUID": { + "planarDatumUUID": { "description": "Only necessary if different from AMRs current planarDatum", "type": "string", "format": "uuid" @@ -101,74 +101,74 @@ "timestamp": { "type": "string", "format": "date-time" }, "manufacturerName": { "type": "string" }, "robotModel": { "type": "string" }, - "robotSerialNumber": { + "robotSerialNumber": { "description": "Unique robot identifier that ideally can be physically linked to the AMR", "type": "string" }, - "baseRobotEnvelope": { + "baseRobotEnvelope": { "description": "Footprint of robot based on orientation - centered on current location.", "type": "object", "required": ["x", "y"], "properties": { "x": { "type": "number" }, "y": { "type": "number" }, - "z": { - "type": "number", + "z": { + "type": "number", "default" : 0 } } }, - "maxSpeed": { + "maxSpeed": { "description": "Max robot speed in m/s", - "type": "number" + "type": "number" }, - "maxRunTime": { + "maxRunTime": { "description": "Estimated Runtime in hours", "type": "number" }, - "emergencyContactInformation": { + "emergencyContactInformation": { "description": "Emergency Contact - preferrably phone number", "type": "string" }, - "chargerType": { + "chargerType": { "description": "Type of charger", "type": "string" }, - "supportVendorName": { + "supportVendorName": { "description": "Vendor that supplied robot", "type": "string" }, - "supportVendorContactInformation": { + "supportVendorContactInformation": { "description": "Contect information for vendor", "type": "string" }, - "productDocumentation": { + "productDocumentation": { "description": "Link to product documenation", "type": "string", "format": "uri" }, - "thumbnailImage": { + "thumbnailImage": { "description": "Link to thumbnail graphic stored as PNG", "type": "string", "format": "uri" - }, - "cargoType": { + }, + "cargoType": { "description": "Discription of cargo", "type": "string" - }, - "cargoMaxVolume": { + }, + "cargoMaxVolume": { "description": "Max volume of cargo in meters", "type": "object", "required": ["x", "y"], "properties": { "x": { "type": "number" }, "y": { "type": "number" }, - "z": { - "type": "number", + "z": { + "type": "number", "default" : 0 } } }, - "cargoMaxWeight": { + "cargoMaxWeight": { "description": "Max weight of cargo in kg", "type": "string" } @@ -185,14 +185,14 @@ "format": "uuid" }, "timestamp": { "type": "string", "format": "date-time" }, - "operationalState": { + "operationalState": { "description": "Current action the robot is performing", "type": "string", "enum": ["navigating", "idle", "disabled", "offline", "charging", "waitingHumanEvent", "waitingExternalEvent", "waitingInternalEvent", "manualMode"] }, - "location": { + "location": { "description": "Current Location of AMR", - "$ref": "#/definitions/location" + "$ref": "#/definitions/location" }, "errorCodes" : { "description": "List of current error states - should be omitted for normal operation", @@ -202,18 +202,18 @@ }, "uniqueItems": true }, - "velocity": { + "velocity": { "description": "Current velocity of AMR", "type": "object", "required": ["linear"], "properties": { - "linear": { + "linear": { "description": "Linear velocity in m/s in heading direction, forward is postive", - "type": "number" + "type": "number" }, - "angular" : { + "angular" : { "description": "Angular velocity in quaternions per second", - "$ref": "#/definitions/quaternion" + "$ref": "#/definitions/quaternion" } } }, @@ -246,7 +246,7 @@ "path" : { "description": "Short term path of AGV ~10 sec", "type": "array", - "items": { + "items": { "$ref": "#/definitions/predictedLocation" }, "maxItems": 10, From 9d2a67329eb66019cdda0f1dc923fcba2d86271b Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:57:14 +0900 Subject: [PATCH 8/9] fix typo --- AMR_Interop_Standard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AMR_Interop_Standard.json b/AMR_Interop_Standard.json index 041e4d3..d155d92 100644 --- a/AMR_Interop_Standard.json +++ b/AMR_Interop_Standard.json @@ -11,7 +11,7 @@ "w": { "type": "number" } } }, - "datnumReferencePoint": { + "datumReferencePoint": { "description": "A Datum Reference Point", "type": "object", "required": ["id", "name", "x", "y"], From 69326cefd2b8e4df7df903f058ff894033796076 Mon Sep 17 00:00:00 2001 From: MIURA Yasuyuki Date: Tue, 10 Aug 2021 14:58:05 +0900 Subject: [PATCH 9/9] update indent to two spaces --- examples/identityReport1.json | 20 ++++++++++---------- examples/statusReport1.json | 28 ++++++++++++++-------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/identityReport1.json b/examples/identityReport1.json index 112ac8d..f4f6f48 100644 --- a/examples/identityReport1.json +++ b/examples/identityReport1.json @@ -1,11 +1,11 @@ { - "uuid": "6948DF80-14BD-4E04-8842-7668D9C001F5", - "timestamp": "2012-04-21T18:25:43-05:00", - "manufacturerName": "Mass Robotics AMR", - "robotModel" : "AMR-01", - "robotSerialNumber" : "0000001", - "baseRobotEnvelope" : { - "x" : 0.5, - "y" : 1 - } -} \ No newline at end of file + "uuid": "6948DF80-14BD-4E04-8842-7668D9C001F5", + "timestamp": "2012-04-21T18:25:43-05:00", + "manufacturerName": "Mass Robotics AMR", + "robotModel" : "AMR-01", + "robotSerialNumber" : "0000001", + "baseRobotEnvelope" : { + "x" : 0.5, + "y" : 1 + } +} diff --git a/examples/statusReport1.json b/examples/statusReport1.json index ab005a5..6aa12fc 100644 --- a/examples/statusReport1.json +++ b/examples/statusReport1.json @@ -1,16 +1,16 @@ { - "uuid": "6948DF80-14BD-4E04-8842-7668D9C001F5", - "timestamp": "2012-04-21T18:25:43-05:00", - "operationalState": "navigating", - "location" : { - "x" : 0.5, - "y" : 1, - "pose" : { - "w" : 0.924, - "x" : 0.000, - "y" : 0.000, - "z" : 0.383 - }, - "planarDatum":"4B8302DA-21AD-401F-AF45-1DFD956B80B5" - } + "uuid": "6948DF80-14BD-4E04-8842-7668D9C001F5", + "timestamp": "2012-04-21T18:25:43-05:00", + "operationalState": "navigating", + "location" : { + "x" : 0.5, + "y" : 1, + "pose" : { + "w" : 0.924, + "x" : 0.000, + "y" : 0.000, + "z" : 0.383 + }, + "planarDatum":"4B8302DA-21AD-401F-AF45-1DFD956B80B5" + } }