Commit d4cbd950 authored by Svetlana's avatar Svetlana

Renamed package. Proof of concept components and generator.

parent a9fd1925
<component name="libraryTable">
<library name="Maven: de.monticore.lang:NumberUnit:0.0.10-SNAPSHOT">
<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>
<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>
<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>
</library>
</component>
\ No newline at end of file
This diff is collapsed.
......@@ -4,8 +4,8 @@
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>
<groupId>de.pavlitskaya</groupId>
<artifactId>experiments</artifactId>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>torcs-dl</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
......
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.drivercontroller
component: dp.drivercontroller
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
affordanceIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
topic: /indocators
type: std_msgs/Int32
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
commandsOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
topic: /commands
type: std_msgs/Float64
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.featureextraction
component: dp.featureextraction
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
imageIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
topic: /images
type: std_msgs/Int32
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
affordanceOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
topic: /indicators
type: std_msgs/Float64
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.imagepreprocessing
component: dp.imagepreprocessing
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
imageIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
imageIn: data
topic: /camera
type: std_msgs/Int32
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
imageOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
topic: /images
type: std_msgs/Float64MultiArray
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.safetycontroller
component: dp.safetycontroller
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
imageIn: clock.toSec()
affordanceIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
topic: /indicators
type: std_msgs/Int32
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
safetyLevelOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
topic: /safety
type: std_msgs/Float64
package sp;
package dp;
component Imagepreprocessing {
ports
in Z(0:255)^{3, 224, 224} imageIn,
out Z(0:255)^{3, 224, 224} imageOut;
}
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.monticar.generator.middleware.MiddlewareGenerator;
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.embeddedmontiarc.embeddedmontiarc._symboltable.PortSymbol;
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.TagExecutionOrderTagSchema.TagExecutionOrderTagSchema;
......@@ -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.TagThresholdTagSchema.TagThresholdTagSchema;
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.tagging.RosToEmamTagSchema;
import de.monticore.lang.monticar.generator.rosmsg.GeneratorRosMsg;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.Scope;
......@@ -44,6 +41,7 @@ public class Experiments {
RosToEmamTagSchema.registerTagTypes(symtab);
GeneratorRosCpp generatorRosCpp = new GeneratorRosCpp();
GeneratorRosMsg generatorRosMsg = new GeneratorRosMsg();
LinkedList<String> inputs = new LinkedList<String>();
inputs.add("Imagepreprocessing");
......@@ -55,6 +53,14 @@ public class Experiments {
for (String inpu : inputs) {
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);
List<File> files = YamlHelper.generateFromFile("resources/config/"+inpu+".yaml", symtab, generatorRosCpp);
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