robotology / yarp

YARP - Yet Another Robot Platform
http://www.yarp.it
Other
523 stars 195 forks source link

Setting the order of module/application in yarpmanager #2002

Open yeshasvitirupachuri opened 5 years ago

yeshasvitirupachuri commented 5 years ago

I am trying to write a new yarpmanager application for HumanDynamicsEstimation

In the xml file the application is divided into modules and embedded applications with the following order

Ideally I want to preserve and see the same order of the modules and application as written above. But when I am launching yarpmanger, the embedded applications go onto and the modules are loaded after them as shown below

screenshot from 2019-01-24 16-57-35

The graph on the side shows the order I want to have

Is there any way to assign them the ordering based on using fixed process id in the config file or another way?

@Nicogene please let me know if you need to know more information

yeshasvitirupachuri commented 5 years ago

Changing all the modules to embedded applications preserves the order as defined in the main application xml file

screenshot from 2019-01-24 17-36-06

Nicogene commented 5 years ago

Hi @Yeshasvitvs ,

do you want to obtain this order in term of execution/stop of the modules?

yeshasvitirupachuri commented 5 years ago

Ciao @Nicogene ,

Primarily I want to preserve the order of loading modules and embedded applications as I define them in the application xml file

Nicogene commented 5 years ago

Digging int libYARP_manager I found out that here :

https://github.com/robotology/yarp/blob/master/src/libYARP_manager/src/kbase.cpp#L215-L237

a sort is performed over the modules.

The sorting seems alphabetical :

https://github.com/robotology/yarp/blob/master/src/libYARP_manager/include/yarp/manager/kbase.h#L210-L222

Maybe @apaikan knows if there is a sort of priority for applications.

yeshasvitirupachuri commented 5 years ago

From what I understand during my testing the order with in the modules and with in the embedded applications is preserved i.e if my main application is written as

Then when they are loaded in yarpmanager the order is

Alternatively, if my main application is written as

Then when they are loaded in yarpmanager the order is

Nicogene commented 5 years ago

Ah ok so that sort is not alphabetical or the order is changed again later, it would be nice solve this mystery 😅

yeshasvitirupachuri commented 5 years ago

A simple way to handle this problem is to put even a single modules into an embedded application and the resulting order in yarpmanager is exactly as defined in the application xml file. However I wonder if using a ID tag to enforce the order is a better way to tackle the issue. what do you think ?

pattacini commented 5 years ago

Any update on this?

Nicogene commented 5 years ago

Primarily I want to preserve the order of loading modules and embedded applications as I define them in the application xml file

Since it is not clear the order of the loaded xml files I suggest to open a PR that make possible the preservation of the order that is in the xml file.

yeshasvitirupachuri commented 5 years ago

I suggest to open a PR that make possible the preservation of the order that is in the xml file

@Nicogene before the PR we need to see what is the best way to enforce the order of the modules/applications

pattacini commented 5 years ago

This is a yarp related discussion that didn't come to a conclusion yet. Moving to yarp repo then.