BotWay Getting Started Level 3: Using the Job Queue, Setting up Dynamic Staging, Triggers, and Cycles. - ResgreenGroup/Botway-Documentation GitHub Wiki

Current Location: Home-> Getting Started Level 3

Summary

The next level of modification to BotWay includes several tools that increase Botway's participation in a task. The job queue allows automatic distribution of jobs to robots, Dynamic staging allows BotWay to intelligently guide robots into a staging area that has an open or full cell, Triggers allow peripheral devices to supplement robot operation, and Cycles allow collection of data for performance metric analysis.


1. Using the Job Queue

BotWay's job handling proceeds in the following manner: First, a job call is made using a physical button or a tablet. This button press triggers the implementation of the job definition associated with that button press. BotWay puts a job in the job queue associated with that job definition and gives it the "queued" status. Any mobile robot at one of the queue's stations can now take the job. When a mobile robot receives the job, it will change its route to the job definition's start route. The job status will change to either "active" or "staged," depending on the job definition settings. If a job goes from queued to staged, it will require a "job status" button press to become active. This is an additional button in the BotWay button definitions page. When the mobile robot gets to the end of a job, the job status changes to "staged" or "complete" based on the job definition settings. Staged jobs require a button press from a "job complete" button. The job is then set to "completed" and either stays in the queue or is removed depending on how many completed jobs are set to remain in the queue.

Button definitions must be associated with a physical or digital button.


2. Setting up Dynamic Staging

When a robot's job includes picking up or dropping off an LHF, then dynamic staging can be used to expedite the process. To begin setting up dynamic staging, open the stagingData.xml file in the "Data" folder of BotWay into a text editor like Notepad++. This file should look like the image below.


Image: Brand new stagingData.xml file in Notepad ++.

On line 3 replace the "false" with "true." This will enable dynamic staging, creation of the staging area in BotWay, and reveal the staging area management window in the BotWay Dashboard. A full description of each line in stagingData.xml can be Found Here. To get dynamic staging working, create cells. An example set of cells is shown below


Image: Brand new stagingData.xml file in Notepad++.

Each cell declaration contains a row index, a column index, and a cell ID. The row and column indices specify a cell's location in the Dynamic Staging Management panel and the ID is what the cell is called. Lines 18, 26, and 33 contain examples of cell declaration statements. Each declaration needs an accompanying termination statement like on line 25. Inside each cell, declare a tag, a put route, a get route, a completer ID, and a staging status; an example of this can be seen on lines 20-24. The tag line specifies which tag is to be assigned this staging status, put route specifies which route will take the robot to this tag when BotWay receives a stagePut command, get route specifies which route will take the robot to this tag when BotWay receives a stageGet command, completerId is the assigned button that completes a job in the staging area, and status is used to set the staging status of each cell. Staging status can be only one of the five following conditions: "NONE," "EMPTY," "LHF," "LHF_PALLET," or "LHF_FULL."

Once all the cells are created, Dynamic staging can be used. There needs to be a tag before the staging area with 2 commands: a command with an action of "H0" for the robot types that travel through the staging area, and a command with a recipient type set to "BotWay," an action of "stagePut" or "stageGet," and a value of one of the five acceptable staging status labels. When a robot arrives at this staging tag, it will stop and BotWay will inspect the staging area for cells with a staging status that matches the staging status of the Botway command value at this tag. StagePut sends the robot on the putRoute of the first cell found to match and stageGet sends the robot on the getRoute of the first cell found to match.

Each putRoute and getRoute must be created in the route editor in order to use dynamic staging without causing delays. When a robot reaches the staging tag, BotWay changes the route that the robot is on like a jump in the route editor. The route to be jumped to must exist in BotWay and be a valid path to the cell that it is assigned to. Each putRoute and each getRoute should go from the staging tag to the tag in the cell where they are declared. Furthermore, each putRoute and eachgetRoute must contain an additional command at the staging cell. Shown below is an example of this additional command. This command must have the recipient type set to "BotWay," the action set to "stageSet," the value set to the cell ID associated with the tag, and the data1 section set to one of the five acceptable staging status labels. This instructs BotWay to update a cell's staging status when a robot drops an LHF off or picks one up from a cell. The staging status will be changed to whatever is entered for data1.


Image: BotWay staging status set command example.

3. Triggers

Triggers allow peripheral devices to interact with the robots' workflow. Click Here for a full discussion of triggers, their use, and the appropriate way to initialize one. This page will attempt to give a barebones introduction. Enter edit mode as Admin and click the "Triggers" button to open the trigger creation dialog window. An example dialog window is shown below.


Image: Triggers dialog window.

Triggers are written in Javascript. Each trigger needs a condition and an output. To create a new trigger, click the "Add" button in the trigger dialog window, then type a Boolean condition in the empty line below the condition box. Refer to the Triggers Page for information about creating conditions. Input for conditions can vary across a large range of possible logic, but each condition will only evaluate to "true" or "false." When a condition evaluates to "true," BotWay will initialize that trigger's output actions.

The "Actions" section of the triggers dialog window allows for modification of the responses to trigger conditions. When a trigger condition is created and saved, it may be selected in the "Conditions" box and an action may be assigned to it. With the condition selected, click the "Add" button in the actions section. Then, Fill in the Target #, value, and data fields. The Target # field specifies the device ID that the action will target. The data fields can only be filled in with numbers and these fields do different things depending on the device being targeted. For example: with RGGI's wireless stacklight, data 1, 2, and 3 specify RGB values and data 4 specifies a blinking pattern.


4. Cycles

Cycles are tools used to gather information on how long it takes robots to get from one point to another. This information can be used to diagnose problems in the process of a robot completing a task. To create a cycle, click the "Edit" button while signed in as Admin to enter edit mode, then click the "Cycles" button in the map display toolbar to open the cycles dialog window. Shown below is an example of the cycles dialog window.


Image: Cycles dialog window.

Click the "Add" button in the upper left of the window to make a new cycle. Then, fill in the five fields on the right side of the window. The cycle ID must be an integer. Start route and start tag specify the combination of route and tag that the robot must travel to begin the cycle. End route and end tag specify the combination of route and tag that will register completion of a cycle. Robots track their cycle information individually. When a cycle is created, any robot that travels over the start tag on the start route of a cycle will begin updating its cycle metrics.

Robots track cycle information individually. To reveal this information, right click on a robot tile while signed in as Admin and click the "Show Logs" option from the menu that appears. The cycle information will be in the top right of the window and it shows the minimum time to complete a cycle, maximum time to complete a cycle, average time to complete a cycle, and total time taken to complete all recorded cycles. Shown below is an example of a robot's cycle information.

⚠️ **GitHub.com Fallback** ⚠️