Build a Skill
A Skill is one behaviour drawn as a graph: the commands your device runs and the waits, decisions and approvals between them. The Quickstart built a straight line; this guide covers every building block and what to do when a step fails.
Before you begin
- A connected device, real or simulated. The editor only offers commands that connected devices report.
The editor
Open Build›Skills and select New Skill, or the name of a Skill to change it. Click Untitled Skill at the top to name it.
- Commands on the left lists what your devices can do, grouped by capability.
- Control flow below it holds the blocks that aren't device commands.
- Drag a block onto the canvas, or right-click the canvas and choose Add node here.
- Right-click a node to Copy, Duplicate or delete it. The i button at the top left of the canvas explains the colours and keyboard shortcuts.
The building blocks
| Block | Does |
|---|---|
| A command | Sends one command to the device, for example flight.takeoff. Select it to fill in its parameters. |
| Condition | Checks one or more comparisons and branches on the result. |
| Wait | Pauses for a number of seconds, or until a fixed time. |
| Event wait | Pauses until the device reports an event, optionally with a timeout and a filter. |
| Human approval | Pauses until a person approves or rejects. See Ask for approval. |
| Parallel gateway | Starts every branch connected to it at the same time. |
| Join gateway | Brings branches back together: All branches waits for every one, Any branch continues when the first succeeds. |
| End | Marks where a branch stops. |
The run starts at the node marked Start: the first node nothing leads into. To start somewhere else, select a node and Start the graph here.
Connect the steps
Drag from the dot on the right of a node to the dot on the left of the next. Select a connection to choose when it is followed:
| Type | Followed when |
|---|---|
| Normal, On success | The step before it succeeds. |
| On failure | The step before it fails, or a person rejects an approval. Drawn in red. |
| On timeout | The step before it runs out of time. Without one, a timeout follows On failure. |
Give a connection a Label, such as fly home, so the graph reads like a plan. A connection can also carry its own condition; it is then only followed when that condition holds.
Branch on a condition
Select a Condition node and Add condition. Pick the value to check, such as an input of the Skill or something an earlier step returned, an operator, and the value to compare with:
- equals, not equals, greater than, greater than or equal, less than,
less than or equal:
30is compared as a number,trueandfalseas yes or no. - in takes a list, for example
standby, patrol. contains, exists and matches (regex) check text.
With several comparisons, choose AND or OR. Then connect the branches: the first connection is When true, the second When false, and Always is followed either way. The branch that isn't taken shows as Skipped in the run.
Decide what happens when a step fails
Select a step. On failure at the bottom of its panel decides what a failure means.
| Setting | Does |
|---|---|
| Stop the execution (default) | The run fails, unless the step has an On failure connection; then the run takes it. |
| Carry on to the next node | The run continues along the normal connections. The failure doesn't fail the run. |
| Timeout | How many seconds the step may take. Without one, a device that never reports back keeps the run going. |
| Attempts | How often the platform tries to send the step when the device refuses it or doesn't answer in time. A step the device accepted and then reported as failed isn't sent again. |
When a flight step fails, the platform sends the drone home on its own. Use an On failure connection for anything else that should happen, for example an alert to another system.
Let the editor check your work
The editor checks the graph as you build:
| You see | Means |
|---|---|
| Incomplete on a node, 1 incomplete in the header | A required setting is missing, for example an approval without an approval type. Hover over the badge to see what. |
| Unwired on a node | Nothing connects it to the start. It never runs. |
Neither stops you from saving, but those nodes don't run until you fix them. Select Save when you are done. To change a Skill that is already in use, save it under a new version number: see Versions, staging and production.
What you have now
- A Skill that branches, waits, asks and recovers, instead of a straight line.
- A plan for every step that can fail.
Troubleshooting
- The Commands list is empty. No device is connected. Connect one or start a simulated device.
- A command says it is no longer in the live catalog. The device that offers it isn't connected right now. Its parameters can't be edited until it reconnects.
- A run stays on one step forever. The step has no timeout and the device never answered. Give it a Timeout.
- A comparison is never true. greater than and the other orderings need numbers on both sides. Try every branch with a simulated device.