Skip to content

Re-factor of the package #8

@ipa-nhg

Description

@ipa-nhg

The purpose of this package is to support the .ros and the .rossystem models from python. For that we started creating mainly 2 modules:

  • Parsers for the models
  • Generators for the models

Ideally behind of these both modules we should create a common one that define the metamodels. A set of classes that describes the models and their attributes together with the Xtext code generator.

The PR #7 started this re-structuration

The first draft of this new modules, can be found under: https://github.com/ipa320/ros_model_parser/blob/d22d42278fd8319f9e21b6781992cb7a295a0b69/src/metamodel/metamodel_core.py

There we have together both models (ros and rossystem), we could separate both into 2 different files and have a dependency from rossystem to ros (they shared the definition of parameters).

In comparison with the ecore metamodels we are still missing:

  • The definition of the PackageSet and Package class for the .ros model, currently it starts with the Node
  • The proper support of components for the .rossystem model

Once the metamodel definition is complete, both, the parsers and the generators should be updated to use them.

With this approach the generators will be simplified and the create model functions will only have to call the dump_xtext_model for the upper layer of the model (PackageSet class for the .ros and RosSystem class for the .rossystem model).

For the parser instead of create local string variables to store the value of the attributes, we can create a proper model with the proper structure and fill it by parsing the selected file.

Summary of ToDos (starting from #7):

  • For consistency, split the metamodels_core.py into ros_metamodel_core.py and rossystem_metamodel_core.py (@ipa-nhg ) done in split the ros and rossystem metamodels into 2 different files #9
  • Complete the ros_metamodel_core.py: add PackageSet, CatkinPackage, Specs... Also a review of the nomenclature will be needed (for example the ecore model define fullname and name for the interfaces, while the current py code uses resolved and name) (@ipa-nhg )
  • Complete the rossystem_metamodel_core.py , the main issue here now is the definition of the references (@ipa-hsd )
  • Update the parsers to use the new modules and the provided script examples
  • Update the generators to use the new modules and the provided script examples

Apart of this the following 3 repositories will have to be updated:

@ipa-hsd please complete if needed

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions