This tutorial covers how to write and read XML files that are used by yarprobotinterface tool and by the libYARP_robotinterface C++ library.
Collaboration diagram for YARP robotinterface XML files:This tutorial covers how to write and read XML files that are used by yarprobotinterface tool and by the libYARP_robotinterface C++ library.
Here is a minimal config file, let's call it "config.xml":
This configuration files create two devices: One fake_motor_device, that creates a fake motor control board. One fake_motor_nws_yarp, that creates a Network Wrapper Server (NWS) that exposes fake_motor_device functionality over YARP ports.
The robot element is the root element of the XML file. It contains the following attributes: name: The name of the robotinterface instance. portprefix: The portprefix to be used by the port created by the robotinterface instance. It can be used as ${portprefix} when specifying a parameter. It must start with a /. build: Not used.
The devices element is a child element of robot element.
It is a collector of YARP devices that are spawned by the robotinterface instance.
The device element is a child element of devices element.
It is used to specify a YARP device that is spawned by the robotinterface. It contains the following attributes: name: The name of the specific instance of YARP device that is created. type: The name of the type of YARP device to instantiate.
The group element is a child element of device or action element.
It is a collector of parameters under a specific group name.
The param element is a child element of device, action or group element.
This element it is used to specify a specific configuration parameter. It contain the following attributes: name: The name (i.e. key) of the attribute.
The inner text of the element represents the value of the parameter. If the inner text contains the string ${portprefix}, it will be substituted with the portprefix parameter specified in the portprefix attribute of the robot element.
This element still needs to be documented.