Commit d4cbd950 authored by Svetlana's avatar Svetlana

Renamed package. Proof of concept components and generator.

parent a9fd1925
<component name="libraryTable"> <component name="libraryTable">
<library name="Maven: de.monticore.lang:NumberUnit:0.0.10-SNAPSHOT"> <library name="Maven: de.monticore.lang:NumberUnit:0.0.10-SNAPSHOT">
<CLASSES> <CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180310.011750-1.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180313.012035-1.jar!/" />
</CLASSES> </CLASSES>
<JAVADOC> <JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180310.011750-1-javadoc.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180313.012035-1-javadoc.jar!/" />
</JAVADOC> </JAVADOC>
<SOURCES> <SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180310.011750-1-sources.jar!/" /> <root url="jar://$MAVEN_REPOSITORY$/de/monticore/lang/NumberUnit/0.0.10-SNAPSHOT/NumberUnit-0.0.10-20180313.012035-1-sources.jar!/" />
</SOURCES> </SOURCES>
</library> </library>
</component> </component>
\ No newline at end of file
This diff is collapsed.
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.pavlitskaya</groupId> <groupId>de.monticore.lang.monticar</groupId>
<artifactId>experiments</artifactId> <artifactId>torcs-dl</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<build> <build>
<plugins> <plugins>
......
- !de.monticar.lang.monticar.generator.python.RosTag - !de.monticar.lang.monticar.generator.python.RosTag
component: sp.drivercontroller component: dp.drivercontroller
subscriber: subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
affordanceIn: clock.toSec() affordanceIn: clock.toSec()
topic: /clock topic: /indocators
type: rosgraph_msgs/Clock type: std_msgs/Int32
publisher: publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
commandsOut: data commandsOut: data
topic: /echo topic: /commands
type: automated_driving_msgs/StampedFloat64 type: std_msgs/Float64
- !de.monticar.lang.monticar.generator.python.RosTag - !de.monticar.lang.monticar.generator.python.RosTag
component: sp.featureextraction component: dp.featureextraction
subscriber: subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
imageIn: clock.toSec() imageIn: clock.toSec()
topic: /clock topic: /images
type: rosgraph_msgs/Clock type: std_msgs/Int32
publisher: publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
affordanceOut: data affordanceOut: data
topic: /echo topic: /indicators
type: automated_driving_msgs/StampedFloat64 type: std_msgs/Float64
- !de.monticar.lang.monticar.generator.python.RosTag - !de.monticar.lang.monticar.generator.python.RosTag
component: sp.imagepreprocessing component: dp.imagepreprocessing
subscriber: subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
imageIn: clock.toSec() imageIn: data
topic: /clock topic: /camera
type: rosgraph_msgs/Clock type: std_msgs/Int32
publisher: publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
imageOut: data imageOut: data
topic: /echo topic: /images
type: automated_driving_msgs/StampedFloat64 type: std_msgs/Float64MultiArray
- !de.monticar.lang.monticar.generator.python.RosTag - !de.monticar.lang.monticar.generator.python.RosTag
component: sp.safetycontroller component: dp.safetycontroller
subscriber: subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
imageIn: clock.toSec() imageIn: clock.toSec()
affordanceIn: clock.toSec() affordanceIn: clock.toSec()
topic: /clock topic: /indicators
type: rosgraph_msgs/Clock type: std_msgs/Int32
publisher: publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
safetyLevelOut: data safetyLevelOut: data
topic: /echo topic: /safety
type: automated_driving_msgs/StampedFloat64 type: std_msgs/Float64
package sp; package dp;
component Drivercontroller { component Drivercontroller {
ports ports
......
package sp; package dp;
component Featureextraction { component Featureextraction {
ports ports
......
package sp; package dp;
component Imagepreprocessing { component Imagepreprocessing {
ports ports
in Z(0:255)^{3, 224, 224} imageIn, in Z(0:255)^{3, 224, 224} imageIn,
out Z(0:255)^{3, 224, 224} imageOut; out Z(0:255)^{3, 224, 224} imageOut;
} }
package sp; package dp;
component Safetycontroller { component Safetycontroller {
ports ports
......
package de.monticore.lang.monticar.generator; package de.monticore.lang.monticar.torcs_dl;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.middleware.MiddlewareGenerator; import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortSymbol;
import de.monticore.lang.monticar.generator.middleware.impls.CPPGenImpl;
import de.monticore.lang.monticar.generator.middleware.impls.DummyMiddlewareGenImpl;
import de.monticore.lang.monticar.generator.middleware.impls.RosCppGenImpl;
import de.monticore.lang.monticar.generator.order.nfp.TagBreakpointsTagSchema.TagBreakpointsTagSchema; import de.monticore.lang.monticar.generator.order.nfp.TagBreakpointsTagSchema.TagBreakpointsTagSchema;
import de.monticore.lang.monticar.generator.order.nfp.TagDelayTagSchema.TagDelayTagSchema; import de.monticore.lang.monticar.generator.order.nfp.TagDelayTagSchema.TagDelayTagSchema;
import de.monticore.lang.monticar.generator.order.nfp.TagExecutionOrderTagSchema.TagExecutionOrderTagSchema; import de.monticore.lang.monticar.generator.order.nfp.TagExecutionOrderTagSchema.TagExecutionOrderTagSchema;
...@@ -13,9 +10,9 @@ import de.monticore.lang.monticar.generator.order.nfp.TagMinMaxTagSchema.TagMinM ...@@ -13,9 +10,9 @@ import de.monticore.lang.monticar.generator.order.nfp.TagMinMaxTagSchema.TagMinM
import de.monticore.lang.monticar.generator.order.nfp.TagTableTagSchema.TagTableTagSchema; import de.monticore.lang.monticar.generator.order.nfp.TagTableTagSchema.TagTableTagSchema;
import de.monticore.lang.monticar.generator.order.nfp.TagThresholdTagSchema.TagThresholdTagSchema; import de.monticore.lang.monticar.generator.order.nfp.TagThresholdTagSchema.TagThresholdTagSchema;
import de.monticore.lang.monticar.generator.roscpp.GeneratorRosCpp; import de.monticore.lang.monticar.generator.roscpp.GeneratorRosCpp;
import de.monticore.lang.monticar.generator.roscpp.helper.TagHelper;
import de.monticore.lang.monticar.generator.roscpp.helper.YamlHelper; import de.monticore.lang.monticar.generator.roscpp.helper.YamlHelper;
import de.monticore.lang.monticar.generator.roscpp.tagging.RosToEmamTagSchema; import de.monticore.lang.monticar.generator.roscpp.tagging.RosToEmamTagSchema;
import de.monticore.lang.monticar.generator.rosmsg.GeneratorRosMsg;
import de.monticore.lang.tagging._symboltable.TaggingResolver; import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.Scope; import de.monticore.symboltable.Scope;
...@@ -44,6 +41,7 @@ public class Experiments { ...@@ -44,6 +41,7 @@ public class Experiments {
RosToEmamTagSchema.registerTagTypes(symtab); RosToEmamTagSchema.registerTagTypes(symtab);
GeneratorRosCpp generatorRosCpp = new GeneratorRosCpp(); GeneratorRosCpp generatorRosCpp = new GeneratorRosCpp();
GeneratorRosMsg generatorRosMsg = new GeneratorRosMsg();
LinkedList<String> inputs = new LinkedList<String>(); LinkedList<String> inputs = new LinkedList<String>();
inputs.add("Imagepreprocessing"); inputs.add("Imagepreprocessing");
...@@ -55,6 +53,14 @@ public class Experiments { ...@@ -55,6 +53,14 @@ public class Experiments {
for (String inpu : inputs) { for (String inpu : inputs) {
System.out.println("Generating for " + inpu); System.out.println("Generating for " + inpu);
ExpandedComponentInstanceSymbol component = symtab.<ExpandedComponentInstanceSymbol>resolve("dp."+inpu.toLowerCase(), ExpandedComponentInstanceSymbol.KIND).orElse(null);
generatorRosMsg.setTarget("generated/", inpu);
for(PortSymbol port : component.getPorts()) {
List<File> msgFiles = generatorRosMsg.generate(port.getTypeReference());
System.out.println(" Msg files: " + msgFiles.toString());
}
generatorRosCpp.setGenerationTargetPath("generated/"+inpu); generatorRosCpp.setGenerationTargetPath("generated/"+inpu);
List<File> files = YamlHelper.generateFromFile("resources/config/"+inpu+".yaml", symtab, generatorRosCpp); List<File> files = YamlHelper.generateFromFile("resources/config/"+inpu+".yaml", symtab, generatorRosCpp);
for (File f : files) { for (File f : files) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment