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

First version of the DSL grammar with yaml format #181

Open
wants to merge 31 commits into
base: 2.0.0_stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4f51f57
Merge pull request #166 from ipa-rwu/rwu/feature/deployment_interface
ipa-nhg Nov 10, 2021
4a6c5a8
fix the extension of the launch files generated for ROS2 systems
ipa-nhg Nov 12, 2021
3fa1590
Fix: update the setup.py generator for ROS2 to support component stac…
ipa-nhg Nov 12, 2021
ed02714
fix path to __init__.py file for ROS2 launch packages
ipa-nhg Nov 18, 2021
c7fccf1
Merge pull request #174 from ipa-nhg/Ros2LaunchGeneratorFix
ipa-nhg Nov 22, 2021
7ffbf69
Create docker-compose.yml for ros2 application
ipa-rwu Oct 28, 2021
0c60f0d
Fix docker tag name
ipa-rwu Nov 12, 2021
f93d9a0
Add "_ros2" as extension for deploy package in foxy version
ipa-rwu Nov 12, 2021
d51325b
fix naming for path, image, folder
ipa-rwu Nov 19, 2021
2ccefab
Move listOfRepos to DeploymentHelpers, fix naming in rosinstall
ipa-rwu Nov 19, 2021
6b5d18a
Merge pull request #175 from ipa-rwu/rwu/feature/ros2_compose
ipa-nhg Nov 24, 2021
e340c94
fix ROS_HOSTNAME in docker-compose
ipa-rwu Nov 30, 2021
291961e
Add delpoyment documentation
ipa-rwu Dec 2, 2021
5ba375a
Merge pull request #177 from ipa-rwu/rwu/doc/deployment
ipa-nhg Dec 2, 2021
3c01e7b
Update README.md
ipa-nhg Dec 2, 2021
c1b7b18
Merge pull request #176 from ipa-rwu/rwu/fix/compose_file
ipa-nhg Dec 17, 2021
26ec423
Update Installation.md
ipa-nhg Mar 16, 2022
b130e8c
Modify the documentation for the installation of the developer verion…
ipa-nhg Mar 21, 2022
7301783
First version of the DSL grammar with yaml format
ipa-nhg Nov 7, 2022
0dba9b7
WIP- update .ros base DSL to yaml format
ipa-nhg Nov 16, 2022
30d1d98
Add the skelethon for the ros2 package DSL
ipa-nhg Nov 16, 2022
99278f9
update release and feature information
ipa-nhg Nov 16, 2022
8beeb76
deactivate test for ros grammar
ipa-nhg Nov 16, 2022
1e539ff
[Minor] Clean and organize model files
ipa-nhg Nov 22, 2022
bf12ae0
Update metamodel to set the quality of service attributes for ROS2
ipa-nhg Nov 22, 2022
3b3dd09
Update DSL grammars to follow the ROS2 updates of the metamodel
ipa-nhg Nov 22, 2022
b604e20
Allow empty messages and services
ipa-nhg Nov 22, 2022
53316d4
Allow unorder interfaces at node level
ipa-nhg Nov 28, 2022
150e9e4
update test cases and delete old resources
ipa-nhg Nov 28, 2022
bef3447
Regenerate ROS1 DSL backend
ipa-nhg Jan 18, 2023
5d1e34f
allow unordered attributes for the ROS2 interfaces configuration
ipa-nhg Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Publications:

- Features

- [Deployment features](docu/deployment.md)
- [Compare your model with a Specification](docu/CompareSpec.md)
- [Introspection at design time](docu/simulateRuntime.md)
- [Models combination](docu/ModelCombine.md)
Expand Down
12 changes: 10 additions & 2 deletions docu/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ First the java environment have to be setup, for eclipse it is recomended the in
```
sudo apt-get install openjdk-11-jre
```
Download the official [Eclipse Installer](https://www.eclipse.org/downloads/packages/installer) for your preferred operating system. Execute the installer and choose the advanced mode (menu on the right-up corner). Select the Product *Eclipse Modeling tools* package, for the version it is recommended *2020-12*.
Download the official [Eclipse Installer](https://www.eclipse.org/downloads/packages/installer) for your preferred operating system. Execute the installer and choose the advanced mode (menu on the right-up corner). Select the Product *Eclipse Modeling tools* package, for the version it is recommended *2021-12*.

![alt text](images/eclipse_installer1.png)

Expand All @@ -35,11 +35,19 @@ Press *Next* and add a new *User project* pressing the green button *+*:
Catalog: Github Projects
Resource URIs: https://raw.githubusercontent.com/ipa320/ros-model/master/EclipseInstaller/ROSModel.setup
```
Sometimes eclipse is not able to find the file, for those cases we recommend to download the file to the local memory of the machine and import it:

```
wget https://raw.githubusercontent.com/ipa320/ros-model/master/EclipseInstaller/ROSModel.setup
```

![alt text](images/eclipse_installer2.png)

Select the the ROS Model project (under Github Projects -> <User>) and press next.

By default the ROS tooling installation will be saved under the folder *ros-model-master* in your home directory. In case your github credentials are not setup on your machine, change the *Ros model Github repository* to the *HTTPs(read-write)* option.
By default the ROS tooling installation will be saved under the folder *ros-model-master* in your home directory. To ensure that you have access to get the source code from GitHub, select the check box *Show all variable* and change the *Ros model Github repository* to the *HTTPs(read-write)* option, verify that the option *Github user ID* is set to "anonymous".

![alt text](images/eclipse_installer3.png)

Follow the installation instructions of the Oompth installer dialog, after the installation eclipse will be restarted to launch the ROS tooling configuration. Finally, when all the startup tasks finished press "Workbench".

Expand Down
93 changes: 93 additions & 0 deletions docu/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
## How to get deployment artifacts


### Preparation

Please be sure that the tool is installed and your workspace setup, see the [installation guide](../README.md) for further details.

Import the example project pub_sub_ros2 (from the [ros-model-examples](https://github.com/ipa-nhg/ros-model-examples) repository) to the workbench of your application:

```
pub_sub_ros2
```

Import the example project agriculture_demo_sprint2 (from the [ros-model-examples](https://github.com/ipa-nhg/ros-model-examples) repository) to the workbench of your application:

```
agriculture_demo_sprint2
```

Install docker and docker-compose

### Get get deployment artifacts

To create deployment artifacts you need to right click "*.rossystem" file.

#### Rossystem without parameters
In this case, you need to right click "communication.rossystem". Then you need to choose "Deployment Artifacts Generator".

A dialog will be open and ask you to select a ROS Distro. In this case, the rossystem doesn't contain parameters, so you only need to choose a ROS Distro.

This process is as shown blow.

![alt text](images/rostooling_deployment.gif)

Then deployment artifacts will automatically created, as you can find under "src-gen" folder

![alt text](images/pub_sub_ros2_deployment_gen.png)


#### Rossystem with parameters

In some case, you need to choose device ports based on parameters defined in a rossystem.

For example, if you want to run teleop with a joystick in a docker container, docker need to know which port is the joystick connect to.

In this case, you need to right click "communication.rossystem". Then you need to choose "Deployment Artifacts Generator".

A dialog will be open and ask you to select a ROS Distro. In this case, the rossystem contains parameters, you need to choose the corresponding parameter to the joystick port value.

This process is as shown blow.

![alt text](images/rostooling_deployment_jackal.gif)

Then deployment artifacts will automatically created.

![alt text](images/jackal_deployment_gen.png)

### Use github action to generate docker images

Once you get deployment artifacts, you can use git action to build and release docker images automatically.

If you already have a repository in github, you can use it. If not, you need to create a repository. For example, we use ("rossystem-deployment" repository)[https://github.com/ipa-rwu/rossystem-deployment.

You also need a dockerhub account. Once you have dockerhub account, you need to add your Docker ID as a secret to GitHub.
1. Add your Docker ID as a secret to GitHub. Navigate to your GitHub repository and click Settings > Secrets > New secret.
2. Create DOCKER_USERNAME and DOCKER_PASSWORD

The result should looks like below.

![alt text](images/github_secrets.png)

In this repository, you need to create a folder ".github/workflows". Then you need to put a file with suffix "_workflow.yml" from a generated folder to this folder. For example, you can put "communication_foxy_workflow.yml" or "agriculture_robot_sprint3_noetic_workflow.yml" under ".github/workflows" folder, as shown below.

![alt text](images/github_workflows_folder.png)


Then you need to put the generated folder in this repository. For example, we put "communication_ros2" and "agriculture_robot_sprint3" in the repository. The locations of these two folder as shown below.

![alt text](images/rossystem_deployment_repo.png)

You can push them to github. Github action will build docker image and push images in dockerhub.

### Start the system

Before starting the system, you need to modify "docker-compose" file. You need to add your docker account as prefix before a docker image name.
For example, we add "kogrob2" (docker hub account name) in front of "communication_foxy:latest", as shown below.

![alt text](images/docker-compose.png)

Then you can use the command below to start the system.
```
docker-compose up
```
Binary file added docu/images/docker-compose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docu/images/eclipse_installer1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/eclipse_installer3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/github_secrets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/github_workflows_folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/jackal_deployment_gen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/pub_sub_ros2_deployment_gen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/rossystem_deployment_repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/rostooling_deployment.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docu/images/rostooling_deployment_jackal.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions plugins/de.fraunhofer.ipa.ros.edit/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,13 @@ _UI_Parameter_value_feature = Value
_UI_Package_fromGitRepo_feature = From Git Repo
_UI_Package_dependency_feature = Dependency
_UI_AmentPackage_type = Ament Package
_UI_InterfaceType_type = Interface Type
_UI_QualityOfService_type = Quality Of Service
_UI_InterfaceType_namespace_feature = Namespace
_UI_InterfaceType_name_feature = Name
_UI_InterfaceType_qos_feature = Qos
_UI_QualityOfService_QoSProfile_feature = Qo SProfile
_UI_QualityOfService_History_feature = History
_UI_QualityOfService_Depth_feature = Depth
_UI_QualityOfService_Reliability_feature = Reliability
_UI_QualityOfService_Durability_feature = Durability
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class ActionClientItemProvider extends NamespacedElementItemProvider {
public class ActionClientItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class ActionServerItemProvider extends NamespacedElementItemProvider {
public class ActionServerItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import ros.NamespacedElement;
import ros.InterfaceType;
import ros.RosFactory;
import ros.RosPackage;

/**
* This is the item provider adapter for a {@link ros.NamespacedElement} object.
* This is the item provider adapter for a {@link ros.InterfaceType} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class NamespacedElementItemProvider
public class InterfaceTypeItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
Expand All @@ -48,7 +48,7 @@ public class NamespacedElementItemProvider
* <!-- end-user-doc -->
* @generated
*/
public NamespacedElementItemProvider(AdapterFactory adapterFactory) {
public InterfaceTypeItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}

Expand All @@ -64,6 +64,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
super.getPropertyDescriptors(object);

addNamePropertyDescriptor(object);
addQosPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand All @@ -79,9 +80,9 @@ protected void addNamePropertyDescriptor(Object object) {
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_NamespacedElement_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_NamespacedElement_name_feature", "_UI_NamespacedElement_type"),
RosPackage.Literals.NAMESPACED_ELEMENT__NAME,
getString("_UI_InterfaceType_name_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_InterfaceType_name_feature", "_UI_InterfaceType_type"),
RosPackage.Literals.INTERFACE_TYPE__NAME,
true,
false,
false,
Expand All @@ -90,6 +91,28 @@ protected void addNamePropertyDescriptor(Object object) {
null));
}

/**
* This adds a property descriptor for the Qos feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addQosPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_InterfaceType_qos_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_InterfaceType_qos_feature", "_UI_InterfaceType_type"),
RosPackage.Literals.INTERFACE_TYPE__QOS,
true,
false,
true,
null,
null,
null));
}

/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
Expand All @@ -102,7 +125,7 @@ protected void addNamePropertyDescriptor(Object object) {
public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) {
if (childrenFeatures == null) {
super.getChildrenFeatures(object);
childrenFeatures.add(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE);
childrenFeatures.add(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE);
}
return childrenFeatures;
}
Expand All @@ -121,14 +144,14 @@ protected EStructuralFeature getChildFeature(Object object, Object child) {
}

/**
* This returns NamespacedElement.gif.
* This returns InterfaceType.gif.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object getImage(Object object) {
return overlayImage(object, getResourceLocator().getImage("full/obj16/NamespacedElement"));
return overlayImage(object, getResourceLocator().getImage("full/obj16/InterfaceType"));
}

/**
Expand All @@ -139,12 +162,12 @@ public Object getImage(Object object) {
*/
@Override
public String getText(Object object) {
String label = ((NamespacedElement)object).getName();
String label = ((InterfaceType)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_NamespacedElement_type") :
getString("_UI_NamespacedElement_type") + " " + label;
getString("_UI_InterfaceType_type") :
getString("_UI_InterfaceType_type") + " " + label;
}


/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
Expand All @@ -157,11 +180,11 @@ public String getText(Object object) {
public void notifyChanged(Notification notification) {
updateChildren(notification);

switch (notification.getFeatureID(NamespacedElement.class)) {
case RosPackage.NAMESPACED_ELEMENT__NAME:
switch (notification.getFeatureID(InterfaceType.class)) {
case RosPackage.INTERFACE_TYPE__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case RosPackage.NAMESPACED_ELEMENT__NAMESPACE:
case RosPackage.INTERFACE_TYPE__NAMESPACE:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
Expand All @@ -181,17 +204,17 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors

newChildDescriptors.add
(createChildParameter
(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE,
(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE,
RosFactory.eINSTANCE.createGlobalNamespace()));

newChildDescriptors.add
(createChildParameter
(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE,
(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE,
RosFactory.eINSTANCE.createRelativeNamespace()));

newChildDescriptors.add
(createChildParameter
(RosPackage.Literals.NAMESPACED_ELEMENT__NAMESPACE,
(RosPackage.Literals.INTERFACE_TYPE__NAMESPACE,
RosFactory.eINSTANCE.createPrivateNamespace()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class ParameterItemProvider extends NamespacedElementItemProvider {
public class ParameterItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class PublisherItemProvider extends NamespacedElementItemProvider {
public class PublisherItemProvider extends InterfaceTypeItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down
Loading