Setting up AWS IoT RoboRunner - AWS IoT RoboRunner

Setting up AWS IoT RoboRunner

A site is a logical boundary within which all other resources in AWS IoT RoboRunner are created. You can create more than one site per AWS account. Resources created within one site can't be used in any other site. For example, a worker registered to site A can't be used to execute work in site B.

Create a site

To get started using AWS IoT RoboRunner, first create a site. A site is a physical place such as a building or a specific area within a building where your resources and fleets are located and managed.

To create a site

Follow the steps under one of these tabs.

Using the console
  1. Sign in to the AWS IoT RoboRunner console.

  2. In the left navigation pane, choose Sites, and then choose Create site.

  3. In the Create site page, enter your Site name, Description, and choose your Country from the dropdown list.

  4. Choose Create site.

Using the SDK

The following SDK example performs the equivalent of the console-based steps.

import requests from aws_requests_auth.boto_utils import BotoAWSRequestsAuth auth = BotoAWSRequestsAuth( aws_host='<AWS IoT RoboRunner regional endpoint>', aws_region='<region>', aws_service='iotroborunner') # createSite body = { 'name': 'MySite1' } response = requests.post('https://<AWS IoT RoboRunner regional endpoint>/createSite', json=body, auth=auth) print(response.content)

Create destinations and paths

For workers that move, such as automated guided vehicles (AGV), AWS IoT RoboRunner can reason about moving through space. Destinations are labels used to identify a particular location or group of locations in a site. They can have coordinates associated with them, but it is not required. The low-level planning and navigation is done by the worker or fleet management system and not by AWS IoT RoboRunner. Instead, AWS IoT RoboRunner stores whether a path exists between any given two destinations, as shown in the following image.


        Viewing destinations and their paths.

Destinations can be related to one another based on the following types:

  • TRAVERSAL: The worker (robot) can move from source to target.

  • COMPOSITION: The target is part of the source. For example, if destination A has loading areas B, C, and D, then the path from A to B is a composition relationship.

Destination relationships can be used to find the most optimal route to complete a task from destination A to destination B and also to find out if certain destinations can't be reached from another destination. The destination information and relationships can be used to do effective task planning in a customized task manager. See Develop a task manager for more information.

import requests from aws_requests_auth.boto_utils import BotoAWSRequestsAuth auth = BotoAWSRequestsAuth( aws_host='<AWS IoT RoboRunner regional endpoint>', aws_region='<region>', aws_service='iotroborunner') # createDestination body = { 'name': 'MyDestination1' 'site': '<Site ARN>' "location":{ "x":0.0, "y":0.0, "z":0.0 }, 'additionalInformation': ("{ "'destinationMetadata' : 'ABCD'" }") "state": "DISABLED" } response = requests.post('https://<AWS IoT RoboRunner regional endpoint>/createDestination', json=body, auth=auth) print(response.content)

Create workers and fleets

Task management, such as moving resources between destination A and B, requires workers like robots and worker fleets. Different fleets can have different types of workers. For example, there could be a fleet of robots from vendor A, while another fleet is comprised of robots from vendor B. Workers are required to be in the ENABLED state for them to used in task management and should be in DECOMMISSIONED state for tear down (delete).

The following code snippet creates a worker and a worker fleet.

import requests from aws_requests_auth.boto_utils import BotoAWSRequestsAuth auth = BotoAWSRequestsAuth( aws_host='<AWS IoT RoboRunner regional endpoint>', aws_region='<region>', aws_service='iotroborunner') # createWorkerFleet body = { 'name': 'fleetName', 'site': '<Site ARN>' } response = requests.post('<AWS IoT RoboRunner regional endpoint>/createWorkerFleet', json=body, auth=auth) print(response.content) # createWorker body = { 'name': 'workerName', 'fleet': '<Fleet ARN>', 'site': '<Site ARN>', 'state': 'ENABLED', 'status': ("{'batteryStatus': 24.33," "'problemStatus': ''," "'WorkerErrors': 'No path to the destination'," "'position': {" "'x': 10.11," "'y': 30.01," "'z': 27.74" "}" "}"), 'additionalInformation': ("{ "'workerModel' : 'ABCD'," "'workerSerial': 'XYZ'" }") } response = requests.post('<AWS IoT RoboRunner regional endpoint>/createWorker', json=body, auth=auth) print(response.content)

Read worker status

While performing complex task management involving a heterogeneous fleet of workers, it is important for you to track the status of each worker to prevent assignments of workers with depleted batteries. To do this, you can use the AWS CLI to read the status of a worker using the AWS IoT RoboRunner GetWorker operation as shown in the following example.

aws iotroborunner get-worker --id "<ARN of the worker resource>"

For additional information, see Read worker and task status.

Create a task

Most industrial systems have their own way of modeling work orders they want their fleet of workers to perform. A typical customer would start by translating their work order into a AWS IoT RoboRunner task. After a task is registered in AWS IoT RoboRunner, you can use a task manager to plan, allocate, and dispatch it.

The following code snippet creates a task.

import requests from aws_requests_auth.boto_utils import BotoAWSRequestsAuth auth = BotoAWSRequestsAuth( aws_host='<AWS IoT RoboRunner regional endpoint>', aws_region='<region>', aws_service='iotroborunner') # createTask body = { 'state': 'NEW', 'parentTask': '<ARN of the parent task, if any>', 'payload': ("{ "'source' : '<ARN of the source. This is the ARN of a source object modelled in AWS IoT RoboRunner>'," "'destination' : '<ARN of the source. This is the ARN of a destination object modelled in AWS IoT RoboRunner>'," "'taskCompletionDeadline': '1632461646'," "'itemIds': <List of items to move>," "'sampleOrderId': 'orderIdValue'" }") } response = requests.post('https://<AWS IoT RoboRunner regional endpoint>;/createTask', json=body, auth=auth) print(response.content)