Skip to content

Commit 4421818

Browse files
committed
1. Allow task_request fleet_name to be a string or string array
2. Reject array in fleet_name for robot specific tasks
1 parent 7915f6a commit 4421818

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

rmf_api_msgs/schemas/estimate_robot_task_request.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
"description": "If not provided, end state of robot's direct task requests will be used by planner.",
2323
"$ref": "#/$defs/state"
2424
},
25-
"request": {"$ref": "task_request.json"}
25+
"request": {
26+
"description": "An estimate robot task request always targets exactly one robot, so its nested fleet_name (if given) must be a single string, not an array.",
27+
"allOf": [
28+
{ "$ref": "task_request.json" },
29+
{ "properties": { "fleet_name": { "type": "string" } } }
30+
]
31+
}
2632
},
2733
"required": ["type", "robot", "fleet", "request"],
2834
"$defs": {

rmf_api_msgs/schemas/robot_task_request.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
"description": "The fleet the robot belongs to",
1919
"type": "string"
2020
},
21-
"request": { "$ref": "task_request.json" }
21+
"request": {
22+
"description": "A robot task request always targets exactly one robot, so its nested fleet_name (if given) must be a single string, not an array.",
23+
"allOf": [
24+
{ "$ref": "task_request.json" },
25+
{ "properties": { "fleet_name": { "type": "string" } } }
26+
]
27+
}
2228
},
2329
"required": ["type", "robot", "fleet", "request"]
2430
}

rmf_api_msgs/schemas/task_request.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@
3131
"type": "string"
3232
},
3333
"fleet_name": {
34-
"description": "(Optional) The name of the fleet that should perform this task. If specified, other fleets will not bid for this task.",
35-
"type": "string"
34+
"description": "(Optional) The name of the fleet, or an array of fleet names, allowed to perform this task. If specified, only the named fleet(s) will bid for this task.",
35+
"oneOf": [
36+
{ "type": "string" },
37+
{ "type": "array", "items": { "type": "string" } }
38+
]
3639
}
3740
},
3841
"required": ["category", "description"]

0 commit comments

Comments
 (0)