Create a command
Before you can issue a command to your robot, you'll have to create one in your Formant organization. This guide will teach you how to create a command.
Step 1: Create a command
- In Formant, in the upper-left corner, open the menu and click Settings.
- Click Commands >> Add command.
- Give your command a name and click Continue.
- Choose which devices can receive this command by applying an appropriate set of tags, and then click Next.
For more information on tags, see Configure access levels.
Step 2: Configure your command
Using built-in Formant commands
You can configure one of the built-in Formant commands as follows:
Command | Usage |
---|---|
formant.get_file | Ingest a file from your device. |
formant.publish_ros_topic | Publish a message to a ROS topic. |
formant.run_script | Run a script on the device. |
Configuring formant.get_file
formant.get_file
Parameter | Usage |
---|---|
Command | Enter formant.get_file . |
Absolute file path on device | Absolute file path of the file on your device which you want to ingest. |
Description | Description that will display to the user when selecting this command. |
Configuring formant.publish_ros_topic
formant.publish_ros_topic
Parameter | Usage |
---|---|
Command | Enter formant.publish_ros_topic . |
ROS topic | Name of the ROS topic to which you want to publish. |
String to be published | String you want to publish to the specified ROS topic. |
Description | Description that will display to the user when selecting this command. |
Configuring formant.run_script
formant.run_script
Parameter | Usage |
---|---|
Command | Enter formant.run_script . |
Absolute file path of script | Absolute file path of the script on your device which you want to run. Script should start with a shebang (#! ). |
Description | Description that will display to the user when selecting this command. |
Creating a custom command
In addition to the built-in commands offered in Formant, you can also generate custom commands which trigger callbacks on your robot. To accomplish this, you'll first create the command in the Formant web application, and then program its function using the Formant Agent SDK.
Property | Usage |
---|---|
Command | Enter the name of the command for which you will write a callback function using the Agent SDK, exactly as it will appear in your program. |
Command parameters | If your command has input parameters, or output values, specify those variables here. If you specify a value for these parameters, that will be the default value of this command. |
Description | Enter a description. This will appear when issuing the command in the Formant UI. |
Step 3 (custom command only): Write an Agent SDK script which handles your command
Using the Agent SDK, write a script which registers a command request callback.
For more information and an example of how to accomplish this in the Agent SDK, see Agent SDK: Handling commands.
For a complete reference of the Agent SDK, see Agent SDK: Complete reference.
See also
If you notice an issue with this page or need help, please reach out to us! Use the 'Did this page help you?' buttons below, or get in contact with our Customer Success team via the Intercom messenger in the bottom-right corner of this page, or at [email protected].
Updated 6 months ago