59
8 Script Language Guide
8.1 Introduction
This script language guide applies to the programming of SIASUN collaboration
robot.
Script function name cannot use special
characters (e.g., underline and punctuation) as
the starting characters.
8.2 Data Types and Variables
8.2.1 1.6.2.1 Built-in Data Types
Arithmetic Type:
The built-in arithmetic type contains (int) and (float) data, which
are stored by 32-bit memory space in the system. Depending on whether the value
contains a decimal point, the system automatically infers the type of the value.
When a build-in arithmetic type is defined, the system will decide its type
depending on its initial value.
String Type:
The system only supports constants of string type, such as "siasun
robot". The string ends with ‘\0’.
Pose Type:
Pose type is an array with 6 float data. The system supports both
constants and variables of pose type.
Array Type:
The system supports two built-in array types, i.e., int and float.
8.2.2 1.6.2.2 System Constants
A value, such as 42 is called a literal constant. Each literal constant corresponds to
a data type. The form and the value of a literal constant determine the data type and
how it is used in the script function. The constants supported by the system are as
follows:
Common Constants:
Arithmetic constants, True, False
Arithmetic constants usually refer to constants of int or float types. This type of
constant not only can participate in relational operations, arithmetic operations and
logical operations, but also can be assigned or initialized for common variables. It
can also be used as arguments transfer to function.
True refers to the arithmetic constant of 1.
False refers to the arithmetic constant of 0.