CLI Reference
  • 1 Minute to read

CLI Reference


Article Summary

Overview

The Command-Line Interface of the RaYa SDK is a terminal tool that allows:

  • Create RaYa applications.
  • Discover robots and simulators connected to your local network.
  • Connect applications under development to real robots and simulators.
  • Run the developed applications on the robot\simulator its (the app) connected to.

General usage:

Text
Text
Text
Text
$ rayasdk [-h] [-v | -q] command {command-options}

Optional arguments:

  • -h, --help: show this help message and exit.
  • -v, --verbose: increase output verbosity.
  • -q, --quiet: don't print on stdout.

Positional arguments:

  • command: SDK Command.


Commands

init

Initialize RaYa project in current folder.

Usage:

Text
Text
Text
Text
$ rayasdk init [-h] --app-id APP_ID [--app-name APP_NAME]

Required arguments:

  • --app-id APP_ID: application unique identifier.

Optional arguments:

  • --app-name APP_NAME: application name.
  • -h, --help: show this help message and exit.

Example:

Text
Text
Text
Text
$ rayasdk init --app-id helloworld --app-name 'Hello World'

This command will create all the files and folders required to create and run a RaYa app.

Good to know:

Current folder must be empty.

scan

Discover robots and simulators that are connected to the same local network.

Usage:

Text
Text
Text
Text
$ rayasdk scan [-h]

Required arguments:

  • None

Optional arguments:

  • -h, --help: show this help message and exit.

Example:

Text
Text
Text
Text
$ rayasdk scan

Output:

Text
Text
Text
Text
Scanning local network for robots...

Robot ID        Serial                DDS Domain   IP Address
--------------  --------------------  -----------  ------------------------------
GARY_KITCHEN    ABCDE12345                      3  ['10.0.0.8 ', '193.168.20.12']
GARY_2665232    66d22020b8a13068239c            1  ['10.0.0.8 ', '193.168.20.12']
GARY_RECEPTION  31ur03ga20ry22join              2  ['10.0.0.8 ', '193.168.20.12']

connect

Connect current RaYa app to a robot or simulator.

Usage:

Text
Text
Text
Text
$ rayasdk connect [--robot-id ROBOT_ID ]

Required arguments:

  • --robot-id ROBOT_ID: robot identifier (from scan list).

Optional arguments:

  • -h, --help: show this help message and exit.

Example:

Text
Text
Text
Text
$ rayasdk connect --robot-id AmazingGary 

Connects the app to one of the robots/simulators from the scan list.

Good to know
  • You must cd to the app folder before command execution in order to be able to connect.
  • When connecting to a new robot, it overrides any previous robot connected.

run

Execute the current RaYa application.

Usage:

Text
Text
Text
Text
$ rayasdk run [--local]

Required arguments:

  • None

Optional arguments:

  • --local: executes the application inside the robot.
  • -h, --help: show this help message and exit.

Example:

Text
Text
Text
Text
$ rayasdk  run
Before running an application, you must be connected to a device (real robot or simulator)
To verify if/where your app is connected to, you can take a look at Exec_settings.json file. The details of the connected device should appear there. If file is empty, you are not connected to any device.


Was this article helpful?