This sample is included with the C++, Python and the Java editions of OpenRTM-aist.
This is a sample that shows how to use ServicePort. The service is defined using the IDL shown below.
typedef sequence<string> EchoList; typedef sequence<float> ValueList;
interface MyService { string echo(in string msg); EchoList get_echo_history(); void set_value(in float value); float get_value(); ValueList get_value_history(); };
Start the MyServiceConsumer and MyServiceProvider components. Activate the Consumer component and a list of available commands will be displayed on the console. Try each command. (Use RTSystemEditor for connection between ports.)
SimpleService is a sample that sends a command from MyServiceConsumer and causes it to be processed by MyServiceProvider. Connect the corresponding ports of MyServiceConsumer and MyServiceProvider on RTSystemEditor. Activate both components (If the Consumer component is activated, it may activate the Provider too). A list of commands will be displayed at the Consumer prompt, so try to use the commands. The response of the Provider can be observed on the prompt.
The startup of the component differs depending on the OS and the language of OpenRTM-aist, so start regarding the table below.
Windows | Linux | |||
MyServiceConsumer component | MyServiceProvider component | MyServiceConsumer component | MyServiceProvider component | |
C++ | MyServiceConsumer.bat | MyServiceProvider.bat | MyServiceConsumerComp | MyServiceProviderComp |
Python | MyServiceConsumer.bat | MyServiceProvider.bat | MyServiceConsumer.py | MyServiceProvider.py |
Java | MyServiceConsumer.bat | MyServiceProvider.bat | MyServiceConsumer.sh | MyServiceProvider.sh |