An overview of the main concepts about this program.
Go to Introduction
A rapid description of how the program works (with references to the code).
Go to How it works
How install yarpmanager-console2 on Linux.
Go to Installation, Configuration and Execution
A small tutorial to run a module and check if it terminates unexpectedly.
Go to Tutorial (example)
Conclusion of this documentation.
Go to Acknowledgments
Bachelor's thesis degree in Computer Engineering by Simone Contorno.
Documentation about yarpmanager-console2 program.
YARP supports building a robot control system as a collection of programs communicating in a peer-to-peer way, with an extensible family of connection types (tcp, udp, multicast, ...).
YARP offers a lot of command line tools like yarpmanager-console; this is a program to run and manage multiple programs on a set of machines; you can do it managing:
- Module: an executable binary file (program).
- Application: a collection of modules, connections, and other applications.
- Resources: refers to any physical or logical resources which are needed by module.
It is possible control the state of a module or an application:
- RUNNING: the module or the application is in execution.
- STOPPED: the module or the application is not in execution.
and of a connection:
- CONNECTED
- DISCONNECTED
yarpmanager-console2 implement a new function that works as a separate thread during the execution of the program: monitors modules, connections, and reports if one of them terminates unexpectedly.
It looks like this at start:
yarpmanager-console2 allows many commands to launch:
- help: show help.
- exit: exit from the program.
- list mod: list available modules.
- list app: list available applications.
- list res: list available resources.
- add mod [filename]: add a module from its description file.
- add app [filename]: add an application from its description file.
- add res [filename]: add a resource from its description file.
- load app [application]: load an application to run.
- run [IDs]: run an application or a module indicated by IDs.
- stop [IDs]: stop running application or modules indicated by IDs.
- kill [IDs]: kill running application or modules indicated by IDs.
- connect [IDs]: establish all connections or just one connection indicated by IDs.
- disconnect [IDs]: remove all connections or just one connection indicated by IDs.
- which: list loaded modules, connection, and resource dependencies.
- check dep: check for all resource dependencies.
- check state [id]: check for running state of application or a module indicated by id.
- check con [id]: check for all connections state or just one connection indicated by id.
- set [value]: set value to an option. To see all available options type 'set --help'.
- export [filename]: export application's graph as Graphviz dot format.
- assign hosts: automatically assign modules to proper nodes using load balancer.
It appears like this in the program:
When you launch the program it starts with the main function; if you did not set the 'ymc2-config.ini' file, you need to insert the folder's paths that contain your applications, modules and resources (in this last one case, only if you have them, otherwise you can digit 'n' when the program will ask you, or set it in the 'ymc2-config.ini' file).
After, the 'main' class starts the separate thread, that will check all modules and connections each 5 seconds (to default, but you can set it in the 'ymc2-config.ini' file), and calls the function 'messageConsole' by the 'Console' class; it starts a 'while' cycle that calls the function 'getInput', so you can start to use all the commands shown above; when you digit one of them, it starts a control with a conditional structure 'if-else if-else' to select the correct operation and call the correct functions.
When you have finished to use the program, you need to digit 'exit' to close it, because there is a control in the 'main' function to catch the 'CTRL+C' signal; in this way the program will close all connections and running modules before the end.
Open the terminal and go in the folder where you want to download yarpmanager-console2 and digit:
git clone https://github.com/simone-contorno/yarpmanager-console2
You can also download the zip code:
Go in the folder where you downloaded the zip and extract it:
unzip yarpmanager-console2-main.zip
Enter in the folder:
cd yarpmanager-console2-main
Open the 'ymc2-config.ini' file:
nano ymn2-config.ini
Set:
- appPath: path of your application files.
- modPath: path of your module files.
- resPath: path of your resource files.
- anyRes: write 'y' if you have any resource file, otherwise write 'n'.
- sleepTimer: timer to check modules and connections states; it is '5000' (milliseconds) to default.
Save typing 'CTRL+X' and 'y' to confirm.
Create a folder named 'build':
mkdir build
Enter in the 'build' folder:
cd build
Generates the 'Makefile':
cmake ..
Build the program:
make
Run the program:
./yarpmanager-console2
Now you can play with yarpmanager-console2.
First make sure you have a name server running:
yarpserver
Open another terminal, run the program and watch all the available commands:
help
Show all available applications:
list app
If you set, or insert, correctly the path of your application, you will see a list like this one:
Add one of them (in this example i added 'eyesviewer-localhost.xml'):
add app eyesviewer-localhost.xml
Load it:
load app eyesviewer-localhost.xml
Show all information (name, modules, connections, and resources) about it:
which
You will see something like this:
Run one of the available modules (in this example i ran the first one):
run 0
If you digit 'run' without specifying the module's number, all modules will run.
Check the state of the running module:
check state 0
You will see something like this:
If you digit 'check state' without specifying the module's number, all module's states will be shown.
Stop it:
stop 0
If you digit 'stop' without specifying the module's number, all modules will stop.
Check again the state of the module; you will see something like this:
Now, to see what happen when a module terminates unexpectedly: run again a module and, if the module that you ran open a window you can try to close it, otherwise you can open the task manager, search the name of the module, and terminate it. You will see a message like this one:
Close the program:
exit
You will see this message:
If you are sure digit 'y', otherwise digit 'n'.
I hope that this documentation helped you to understand the functioning of yarpmanager-console2 clearly.
Bye. :slightly_smiling_face: