Make a Skill reusable
A Skill that flies to one fixed spot is only useful for that spot. Give it inputs instead, and the same Skill flies wherever the alarm, the schedule or the person starting it says.
Before you begin
- A Skill, for example the one from the Quickstart.
Add inputs
Open the inputs
Open the Skill under Build›Skills and select Inputs in the header.
Add a field for each value that changes
Select Add field and give each a name, a type and a description. Tick Required when the Skill can't run without it.
Type For number Coordinates, heights, durations. string Text, for example a name or a serial number. boolean Yes or no. object, array Structured data, usually passed in by another system. Name them like the parameters they fill
A step picks up an input with the same name as its parameter by itself. Name the fields
latitudeandlongitude, and every step with alatitudeandlongitude, such as navigation.go_to and gimbal.look_at, takes its position from them. Leave those parameters empty in the steps.Save
Select Done, then Save. Save it as a new version if the Skill is already in use: see Versions, staging and production.
Where the values come from
Every way of starting the Skill fills its inputs:
| Started by | Fills the inputs |
|---|---|
| You, with the run button | A form asks for each input. Required ones must be filled before Run for real works. |
| A schedule | The values saved with the schedule, under Parameters. |
| An event trigger | The event, for example the position where the radar saw something. See the Quickstart. |
| A webhook | The JSON the other system sends. |
If a schedule or trigger no longer passes an input the Skill requires, for example after you added one, it is switched off and marked Needs attention. Edit it and fill in the new input.
Pass a result to the next step
Some steps return something, for example a position or a reading. A later step can use it:
Open the later step
Select the step on the canvas.
Switch the parameter to Mapped
Next to the parameter, switch from Static to Mapped.
Pick the value
Select Pick and choose where the value comes from:
- This skill's input: one of the inputs you added.
- An earlier step: what it returned.
- This execution: the run itself, for example the serial number of the device running it.
Once one parameter of a step is mapped, its other parameters no longer pick up same-named inputs by themselves. The console maps those for you when you switch the first one, and the step says how many are mapped.
To hand results back from a Skill to the Application that uses it, select Outputs in the header and name each value the Skill returns.
What you have now
- One Skill that flies wherever it is told, instead of a copy per target.
- Values handed from step to step, without typing them twice.
Troubleshooting
- A step is marked Incomplete. A required parameter has no value: give it a static value, map it, or add an input with its name.
- Run for real stays disabled. Fill in every required input in the form.
- A schedule shows Needs attention. The Skill now requires an input the schedule doesn't pass. Edit the schedule and fill it in.