Skip to content

Adding New Action Scripts

How to add action scripts manually to a robot

  1. Add new action metadata to online_assets spreadsheet here. Metadata = category_slug, robot, script_lang, name_en, name_kk, name_ru, description_en, description_kk, description_ru, image_filename, script_en, script_kk, script_ru
  2. Create audio files necessary for the action.
  3. Create a python script that references these files in the proper remote path (see other robot scripts for reference on the syntax and file path).
  4. Add audio file paths to the perfect_state_robots spreadsheet here. Create a copy spreadsheet page with the proper name and date when adding new paths to keep track the changes (see other page names for reference). You only need to insert new paths to remote_path column.
  5. Update perfect state file on the online app server (in static files). The file is localed at /srv/apps/april_robots_online/mount/static/perfect_state/<robot>_files.csv. To update, export the spreadsheet page for the robot as CSV and replace the file, edit the CSV file directly.
  6. Upload audio files to the correct path on the online app server into static files. Audios are located at /srv/apps/april_robots_online/mount/static/robot_files/<robot>/audios/<some-path>. Behaviours for NAO are located in a directory next to audios/. The part after robot_files/ should be equal to the url column in the perfect_state_robots spreadsheet, with robot_files/<path> swapped as rf/<path>.
  7. Add the action via AR Online admin dashboard based on the metadata from step 1. Beware: the script paths will be resolved to <lang>/<category-slug>/<script-name>.py (e.g. kk/povar/povar.py in the actions/ dir of the MS).
  8. Add the python script file to the proper location in the robot’s MS repository (see previous step).
  9. Release the new version of the MS (check the release docs for that).
  10. Installed Offline App should pull the new version of the MS on the next start-up. The action will work only if MS is updated on the PC.
  11. Launch the cloud sync process from the Offline App to pull new action metadata.
  12. Launch the robot sync process from the Offline App to upload necessary robot files on the robot.

How it should work in the future

Admins should be able to upload script files directly through AR Online frontend, from which corresponding MS will be semi-automatically updated (via GH workflows).

    sequenceDiagram
   participant Admin / Developer
   participant OnlineApp
   participant Server
   participant GitHub
   participant GitRunner
   participant GHCR


   Admin / Developer->>OnlineApp: Creates new Action, uploads action script and audio files via UI
   OnlineApp->>Server: Saves audio files to RFs folder, script file to private folder


   Note over Admin / Developer,GitHub: Admin triggers workflow manually (workflow_dispatch) on the MS repo?

   Admin / Developer->>GitHub: Manually triggers workflow_dispatch
   GitHub->>GitRunner: Starts CI/CD workflow
   GitRunner->>Server: Executes scp to download the script file
   GitRunner->>GitRunner: Saves the script file into MS repo action scripts folder


   GitRunner->>GitRunner: Builds new MS Docker image with files
   GitRunner->>GHCR: Pushes image to registry