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

  1. In Formant, in the upper-left corner, open the menu and click Settings.
  2. Click Commands >> Add command.
  3. Give your command a name and click Continue.
  4. 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:

CommandUsage
formant.get_fileIngest a file from your device.
formant.publish_ros_topicPublish a message to a ROS topic.
formant.run_scriptRun a script on the device.

Configuring formant.get_file

configuring the formant get file command

Configuring the built-in formant.get_file command.

ParameterUsage
CommandEnter formant.get_file.
Absolute file path on deviceAbsolute file path of the file on your device which you want to ingest.
DescriptionDescription that will display to the user when selecting this command.

Configuring formant.publish_ros_topic

configuring the built in formant publish ros topic command

Configuring the built-in formant.publish_ros_topic command.

ParameterUsage
CommandEnter formant.publish_ros_topic.
ROS topicName of the ROS topic to which you want to publish.
String to be publishedString you want to publish to the specified ROS topic.
DescriptionDescription that will display to the user when selecting this command.

Configuring formant.run_script

Configuring the built-in formant run script command

Configuring the built-in formant.run_script command.

ParameterUsage
CommandEnter formant.run_script.
Absolute file path of scriptAbsolute file path of the script on your device which you want to run. Script name should start with a shebang (#!).
DescriptionDescription 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.

configuring a custom command

Configuring a custom command.

PropertyUsage
CommandEnter 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 parametersIf 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.
DescriptionEnter 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].