Skip to content

Commit

Permalink
Support fleet-level task (#201)
Browse files Browse the repository at this point in the history
* update task request to include fleet_name for fleet-level task

Signed-off-by: Charly Wu <[email protected]>

* added DCO commit.

Signed-off-by: Charly Wu <[email protected]>

* simplify logic for populating request['fleet_name']

Signed-off-by: Charly Wu <[email protected]>

* remove extra whitespaces.

Signed-off-by: Charly Wu <[email protected]>

* remove trailing whitespace.

Signed-off-by: Charly Wu <[email protected]>

---------

Signed-off-by: Charly Wu <[email protected]>
Co-authored-by: Yadunund <[email protected]>
  • Loading branch information
cwrx777 and Yadunund authored Jan 26, 2024
1 parent 86b308e commit 9f23005
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions rmf_demos_tasks/rmf_demos_tasks/dispatch_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def __init__(self, argv=sys.argv):
# Define task request category
request["category"] = "compose"

if self.args.fleet:
request["fleet_name"] = self.args.fleet

# Define task request description with phases
description = {} # task_description_Compose.json
description["category"] = self.args.action
Expand Down
3 changes: 3 additions & 0 deletions rmf_demos_tasks/rmf_demos_tasks/dispatch_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def __init__(self, argv=sys.argv):
# Define task request category
request["category"] = "compose"

if self.args.fleet:
request["fleet_name"] = self.args.fleet

# Define task request description with cleaning zone
description = {} # task_description_Compose.json
description["category"] = "clean"
Expand Down
3 changes: 3 additions & 0 deletions rmf_demos_tasks/rmf_demos_tasks/dispatch_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ def __init__(self, argv=sys.argv):
start_time = now.sec * 1000 + round(now.nanosec/10**6)
request["unix_millis_earliest_start_time"] = start_time

if self.args.fleet:
request["fleet_name"] = self.args.fleet

def __create_pickup_desc(index):
if index < len(self.args.pickup_payloads):
sku_qty = self.args.pickup_payloads[index].split(',')
Expand Down
3 changes: 3 additions & 0 deletions rmf_demos_tasks/rmf_demos_tasks/dispatch_go_to_place.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ def __init__(self, argv=sys.argv):
'unix_millis_earliest_start_time': start_time
}

if self.args.fleet:
rmf_task_request["fleet_name"] = self.args.fleet

payload["request"] = rmf_task_request

msg.json_msg = json.dumps(payload)
Expand Down
3 changes: 3 additions & 0 deletions rmf_demos_tasks/rmf_demos_tasks/dispatch_patrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def __init__(self, argv=sys.argv):
# Define task request category
request["category"] = "patrol"

if self.args.fleet:
request["fleet_name"] = self.args.fleet

# Define task request description
description = {
'places': self.args.places,
Expand Down
7 changes: 5 additions & 2 deletions rmf_demos_tasks/rmf_demos_tasks/dispatch_teleop.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class TaskRequester(Node):
def __init__(self, argv=sys.argv):
super().__init__('task_requester')
parser = argparse.ArgumentParser()
parser.add_argument('-F', '--fleet', required=False, default='',
parser.add_argument('-F', '--fleet', required=False,
type=str, help='Fleet name')
parser.add_argument('-R', '--robot', required=False, default='',
parser.add_argument('-R', '--robot', required=False,
type=str, help='Robot name')
parser.add_argument('-s', '--start', required=True,
type=str, help='Start waypoint')
Expand Down Expand Up @@ -94,6 +94,9 @@ def __init__(self, argv=sys.argv):
# Define task request category
request["category"] = "compose"

if self.args.fleet:
request["fleet_name"] = self.args.fleet

# Define task request description with phases
description = {} # task_description_Compose.json
description["category"] = "teleop"
Expand Down

0 comments on commit 9f23005

Please sign in to comment.