Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create telemetry sub-folders in "iCub Telemetry" dictionary #133

Closed
Tracked by #121
nunoguedelha opened this issue Aug 30, 2022 · 5 comments · Fixed by #149
Closed
Tracked by #121

Create telemetry sub-folders in "iCub Telemetry" dictionary #133

nunoguedelha opened this issue Aug 30, 2022 · 5 comments · Fixed by #149
Assignees
Labels
enhancement New feature or request

Comments

@nunoguedelha
Copy link
Collaborator

nunoguedelha commented Aug 30, 2022

The "iCubTelemetry" folder in the visualiser left pane has a long list of telemetry domain entries which make the search for any of those somewhat inefficient and difficult. This should be easily solved by grouping the entries in modalities adding some sub-folders.

Implemented in #149 .

@nunoguedelha nunoguedelha added the enhancement New feature or request label Aug 30, 2022
@nunoguedelha nunoguedelha self-assigned this Aug 30, 2022
@nunoguedelha
Copy link
Collaborator Author

After an initial analysis, we see that in order to freely add folders in the telemetry dictionaries, some refactoring of the dictionary-plugin, more precisely the implementation of the Object and Composition Providers refer to the API documentation:

  • The composition provider only returns the array of identifiers directly under the dictionary root level (telemetryEntries field)
    • => there should be a search of identifiers based on a relative path under the input domain object for which the composition is requested.
    • => either we do a raw search of the domain object in the dictionary, either we use the namespace for locating it directly in the dictionary. this requires changing how we set the namespaces returned in the composition array of identifiers.
  • The Object Provider builds either a folder domain object either a telemetry domain object, depending on the identifier key of the requested domain object, i.e. if the key matches the dictionary's, a folder domain object is built and returned.
    • => most probably, here we should directly check the type of the dictionary elements, which needs to be introduced.
  • less critical improvements could be done in the Object Provider definition using smartly the instantiation of the respective class ObjectProvider in order to avoid some conditional branching within its implementation.

@nunoguedelha
Copy link
Collaborator Author

On the composition provider...

  • either we use the namespace for locating it directly in the dictionary. this requires changing how we set the namespaces returned in the composition array of identifiers.

Actually this would compromise the current mapping used for selecting the dictionary depending on the namespace => we would have to parse the namespace, for instance keep the initial segment, for using it in the mapping.

Probably the best is to build a mapping [identifier -> path-in-the-dictionary-to-the-domain-object-properties-block] and leave the namespace intact.

On the ObjectProvider specificities w.r.t. the dictionary/namespace

In addition to use the class instantiation to select the processing depending on the namespace, the prior branching in the getDictionary function should be keep because the compositionProvider is not associated to a particular namespace (unfortunately).

@nunoguedelha
Copy link
Collaborator Author

nunoguedelha commented Sep 29, 2022

Probably the best is to build a mapping [identifier -> path-in-the-dictionary-to-the-domain-object-properties-block]

A simple alternative, with the same effect and much less processing would be to set as identifier.key of a domain object the key path to the respective parameter block starting from the dictionary root. E.g:

  • sens.legacyIMU key would become IMUsens.legacyIMU, considering the objects path [icubtelemetry dictionary root -> folder IMUsens -> telemetry entry legacyIMU] resulting in the structure path icubtelemetry.compposition.IMUsens.composition.legacyIMU and the final identifier.key to be icubtelemetry.IMUsens.legacyIMU1.
  • the same way, sens.rightArmJointState would become icubtelemetry.encoders.rightArmJointState.

Footnotes

  1. We could omit icubtelemetry since it is unequivocally associated to the namespace, but we shall keep it since the namespace is not exchanged with the telemetry server (i.e. the servers.json config file). In addition, all the signal keys received through the websocket need to be unique, so all the identifier keys of the telemetry objects passed to the Open MCT API need to be unique whatever the dictionary.

@nunoguedelha
Copy link
Collaborator Author

nunoguedelha commented Oct 5, 2022

Implementation Steps

Dictionaries

  • Some refactoring for allowing following steps.
  • Introduce a "type" field in the dictionaries.
  • Introduce folders where needed.

Object Provider

  • Some refactoring for allowing following steps.
  • Once the input domain object identifier is matched with an element in the dictionary:
    • We check the respective "type".
    • Depending on this type, we build a folder or a telemetry domain object to return to Open MCT API.
    • Set as identifier.key of the returned domain object the key path to the respective parameter block starting from the dictionary root.
  • Minor improvements:
    • Use the class ObjectProvider instantiation to perform namespace dependent processing, avoiding additional conditional branching. => not an option anymore since, after the refactoring we only use a single namespace for all the dictionaries: YARPOPENMCT_DICTIONARY_PLUGIN_NAMESPACE.
    • The existing conditional branching in the getDictionary function should be keep because the compositionProvider is not associated to a particular namespace.

Composition Provider

  • Some refactoring for allowing following steps.
  • Use the input domain object identifier key to locate the matching element in the dictionary for which the composition was requested.
  • Build the list of identifiers under that element.

@nunoguedelha nunoguedelha changed the title Create telemetry sub-folders in "iCubTelemetry" dictionary Create telemetry sub-folders in "iCub Telemetry" dictionary Oct 7, 2022
@nunoguedelha
Copy link
Collaborator Author

Implemented in #149 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant