Use formant.run_script in teleop

Q: Is it possible to put a button in teleop that issues a command with formant.run_script?


Step 1: Add the command to Formant

  1. In Formant, in the upper-left corner, open the menu and click Settings >> Commands.
  2. Add a command which calls formant.run_script. Set Enable parameters to ON. In Command parameters, enter the absolute path of the script.

Step 2: Call the command during teleoperation

There are three ways to call this command during teleoperation:

Commands button module

  1. Navigate to your device and start a teleoperation session.

  2. In the bottom-right corner, click the three dots >> Configure device.

  3. Set one of the views to Command buttons.

  4. Click the pencil icon next to the Command buttons and enter the names of the commands you would like to send from the module. This will create a module where you press a button to send the command.

Commands module

Similar to the above, you can set one of the views to the Commands module. This requires no extra configuration, as it will auto-populate a drop down with the commands available to the device.

Issue command directly

You can call a command from the teleop screen natively by pressing the three dots in the corner and clicking Issue Command (or Shift+I as a shortcut).