iml130 / firos

Firos helps to connect ROS-based robots to the Fiware Ecosystem...
MIT License
12 stars 8 forks source link

Changing entity context_type to something else than default "ROBOT" causes communication problems #28

Open marija185 opened 5 years ago

marija185 commented 5 years ago

Hi @Luxxii Yesterday I changed the entity context_type in config.json as described here: https://firos.readthedocs.io/en/latest/install/configuration-files.html

My config.json now has the additional line with the parameter "context_type" as:

{
  "environment": "fof_lab",

  "fof_lab": {
    "context_type": "CentralSP",
    "server": {
etc...

In OCB now I can see:

"id":"map","type":"CentralSP", etc...

Now, what is interesting is that I can not receive the data from another docker container also using firos because there I have the default type "ROBOT", although I can see the data in a web browser under entities. If I rename the default type of the firos config.json of this other docker container to the same name "CentralSP", then the data are received!

To have more info how OCB looks of this other docker container, it begins with:

"id":"robot_0","type":"CentralSP", ...

The problem is that the type needs to be the same in all the containers that communicate through firos to each other. However, it would be nice if the type does not prevent the communication of different types.

best regards, Marija

Luxxii commented 5 years ago

Hi @marija185 this behavior is intended. FIROS uses this context_type to distinguish between other FIROS instances to only communicate with the FIROS-instance, which also uses the same context_type.

Note: Multiple FIROS instances (E.g.: 20 or more ) can run simultaneously on only ONE Contextbroker. To avoid Message-Collisions, the type-attribute is "abused" here, so that the FIROS-Instance can cleanly distinguish, which Message it should subscribe/publish on the Context-Broker.

I talked with @DLuensch and @ptrdtznr and we have a solution (#32 ). This needs to be implemented first. Basically, the feature i described above is not used somewhere to our knowledge. So we will omit it and restructure the Appearance of the Entities inside the OCB. This should solve the Problem.

Just allowing custom types is not that easy to implement in FIROS. To subscribe or publish on the ContextBroker, the values: id, type need to be known prior..

best regards, Dominik

marija185 commented 5 years ago

Hi @Luxxii, thank you for the answer! By now we will use a default type "ROBOT" since this works!

best regards, Marija

Luxxii commented 4 years ago

Hi @marija185 Most of the problems have been tackled inside the Development branch. However, it is currently not finished. The context-type has been removed completely and inside the OCB, the messages are now looking as described in #32 . I will inform you, after we have finished :)

marija185 commented 4 years ago

Hi @Luxxii! Thank you for informing me! I am happy to test a new version when it will be ready. :)