Robot Control Meta Language (RCML)

5.1 Writing Functions for a Certain Robot Class

Specifying a new robot function starts with function keyword, followed by robot class name for that function after the separator, followed by “::” character, followed by the name of the new function and then the list of parameters in parentheses that can be empty. The list of parameters in curly brackets is followed by function code – a list of its operators. The syntax for specifying a robot function:

function robot_class::function_name(parameter_list) {
	operator_list
}

Example of a new sum function for the type of test class robot:

function robot_test::sum(a, b) {
	c = a + b;
	robot->do_something(c);
	returnc;
}

Specifying a robot function is very similar to specifying a common function in RCML, but the execution of such function has a number of significant differences.

The key difference is that a robot function is executed in the context of a particular robot instance and its class. Therefore it is impossible to access the other robots and thus the use of robot classes is prohibited. To access the robot for the function executed, the abstract robot is used (third line of the above example). Of course, all robot functions called via the abstract robot as part of this function must be present in this robot class, that is, they must be provided by robot module, or they must be described in the libraries linked, or in other functions in the source code of the program.

In case there is no access to the robot (attributed to the function) in this function, a real physical robot of the specified class will still be reserved for this function.

Additionally, as part of the robot functions, it is prohibited to use special variables because they are useless, as a robot attributed to the function is always available through the access to the abstract robot.

In the robot function, you can change modes of execution of other robot functions by conventional methods. For more information about modes of function execution and methods to change them, see Section "Writing Functions for a Certain Robot Class".

5.2 Writing Functions for Multiple Robot Classes

Specifying a new function simultaneously for multiple robot classes is similar to specifying a new function for a single robot, except that the required robot classes are separated by commas. Example of specifying such a function simultaneously for two robot classes – test and tarakan – is as follows:

function robot_test, robot_tarakan::sum(a, b) {…

Robot classes given for this function must include all functions called through the abstract robot within this function, otherwise this new function is contradictory and inapplicable to a specified set of robot classes.

Address:

12, Monastyrskaya St., lit. A,
Office 600, Perm, Russia

Phone:

+7 (342) 214 01 84

E-mail:

info@robotct.ru