Use formant.run_script in teleop
Q: Is it possible to put a button in teleop that issues a command with formant.run_script
?
formant.run_script
?Step 1: Add the command to Formant
- In Formant, in the upper-left corner, open the menu and click Settings >> Commands.
- 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
-
Navigate to your device and start a teleoperation session.
-
In the bottom-right corner, click the three dots >> Configure device.
-
Set one of the views to Command buttons.
-
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).
Updated 9 months ago