|
| 1 | +## CognitiveModule_ModelImplementation_Pilot |
| 2 | +This repository holds the metamodel and the DSL implementation for the formal represnetation of Cognitive Modules for the CORESENSE project. |
| 3 | + |
| 4 | + |
| 5 | +### Installation |
| 6 | + |
| 7 | +First, the Java environment has to be set. For Linux it can be installed with the following command: |
| 8 | + |
| 9 | +``` |
| 10 | +sudo apt-get install openjdk-XY-jre |
| 11 | +``` |
| 12 | + |
| 13 | +The current status of this repository has been sucesfully tested with the XY version 21. However, it is expected to work also with tha letest version. |
| 14 | + |
| 15 | +Then Eclipse can be installed. Please download the installer from the official Eclipse [website](https://www.eclipse.org/downloads/packages/installer). After unpacking the downloaded file, the installer can be run by calling the command *./eclipse-inst* from the console. |
| 16 | + |
| 17 | +Once you start the installer, select the package "Eclipse Modeling Tools". You can find it just by scrolling or using the searching tool: |
| 18 | + |
| 19 | +Press next, and then pick the Java version and the folder where you would like to install Eclipse. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +Continue the installation, accepting the license, as usual. |
| 24 | + |
| 25 | +#### From Release (recommended) |
| 26 | + |
| 27 | +Once the installation is completed, go to *Help* > *Install New Software...*. To install the latest version of the ROS tooling, add the update site URL [https://raw.githubusercontent.com/CoreSenseEU/Tooling-update-site/main](https://raw.githubusercontent.com/CoreSenseEU/Tooling-update-site/main). in the *Work with* section. |
| 28 | + |
| 29 | +Update site address: |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +If no package is listed, please uncheck the option *Group items by category*. The category *ROS Model* appears in the *Name* area. Check the box in front of *CoreSense Cognitive Module Feature* and click *Next* to review the list of items to be installed. Click *Next* again to read and accept the terms of the license agreements and afterwards click *Finish*. Eclipse will then start to install the ROS tooling and its dependencies. If you get a security warning about the authenticity, click OK. Finally, when asked, restart Eclipse to complete the installation process. |
| 34 | + |
| 35 | +#### From Source (only for tooling developers) |
| 36 | + |
| 37 | +Clone the repository directly on your workspace: |
| 38 | + |
| 39 | +``` |
| 40 | +git clone [email protected]:CoreSenseEU/CognitiveModule_ModelImplementation_Pilot.git |
| 41 | +``` |
| 42 | + |
| 43 | +Then use the menu File->Import->Existing Projects Into Workspace and select the folder of the cloned repository as root folder. |
| 44 | + |
| 45 | + |
| 46 | +This installation requires the Xtext framework, this can be installed using the Eclipse Marketplace, it can be open within the menu "Help"->"Eclipse MarketPlace" |
| 47 | + |
| 48 | + |
| 49 | +### Create new projects and models |
| 50 | + |
| 51 | +To start developing your model you can create a new Project. We recommend the creation of an empty one. Then you can create a file with the extension ".cogmod" within the project, by default Eclipse will ask you to set the Project as a Xtext one, and open the Cognitive Module models editor which contains autocomplete funcion (by pressing Ctrl+Espace bar) and validation of the model. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +The current model implementation has the following grammar: |
| 56 | + |
| 57 | +``` |
| 58 | +my_awesome_cognitive_module: #Name of the module |
| 59 | + **core:** CoreName |
| 60 | + **efferent:** # Optional |
| 61 | + EfferentName: |
| 62 | + **topic:** TopicName |
| 63 | + **type:** TopicType |
| 64 | + **afferent:** # Optional |
| 65 | + AfferentName: |
| 66 | + **topic:** TopicName |
| 67 | + **type:** TopicType |
| 68 | + **meta:** MetaName |
| 69 | + **Coupling:** CouplingName |
| 70 | +``` |
| 71 | +The attributes name of the module, core, meta and coupling are mandatory, if the are now set the model will provide an error. |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +While saving (Ctrl+S) a valid model, a new src-gen folder will be automatically generated. For this first release version it contains only a README.md file. |
| 76 | + |
| 77 | +### Development guide |
| 78 | + |
| 79 | +tbd.... |
0 commit comments