Commit a9fd1925 authored by Svetlana's avatar Svetlana
Browse files

EMAM files for generation.

parent 94026348
This diff is collapsed.
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.drivercontroller
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
affordanceIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
commandsOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.featureextraction
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
imageIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
affordanceOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
- !de.monticar.lang.monticar.generator.python.RosTag - !de.monticar.lang.monticar.generator.python.RosTag
component: sp.add component: sp.imagepreprocessing
subscriber: subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
a: clock.toSec() imageIn: clock.toSec()
b: clock.toSec()
topic: /clock topic: /clock
type: rosgraph_msgs/Clock type: rosgraph_msgs/Clock
publisher: publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface - !de.monticar.lang.monticar.generator.python.RosInterface
ports: ports:
c: data imageOut: data
topic: /echo topic: /echo
type: automated_driving_msgs/StampedFloat64 type: automated_driving_msgs/StampedFloat64
- !de.monticar.lang.monticar.generator.python.RosTag
component: sp.safetycontroller
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
imageIn: clock.toSec()
affordanceIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
safetyLevelOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
package sp;
component Add {
ports
in (0 m : 10 m) a,
in (0 m : 10 m) b,
out (0 m : 20 m) c;
implementation Math {
c = a + b;
}
}
package sp;
component Drivercontroller {
ports
in Q(0:1)^{13,1,1} affordanceIn,
out Q(0:1)^{3,1,1} commandsOut;
}
package sp;
component Featureextraction {
ports
in Z(0:255)^{3, 224, 224} imageIn,
out Q(0:1)^{13,1,1} affordanceOut;
}
package sp;
component Imagepreprocessing {
ports
in Z(0:255)^{3, 224, 224} imageIn,
out Z(0:255)^{3, 224, 224} imageOut;
}
package sp;
component Safetycontroller {
ports
in Z(0:255)^{3, 224, 224} imageIn,
in Q(0:1)^{13,1,1} affordanceIn,
out Q(0:1)^{1,1,1} safetyLevelOut;
}
...@@ -22,6 +22,7 @@ import de.monticore.symboltable.Scope; ...@@ -22,6 +22,7 @@ import de.monticore.symboltable.Scope;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import static de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab.createSymTab; import static de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab.createSymTab;
...@@ -42,13 +43,25 @@ public class Experiments { ...@@ -42,13 +43,25 @@ public class Experiments {
RosToEmamTagSchema.registerTagTypes(symtab); RosToEmamTagSchema.registerTagTypes(symtab);
ExpandedComponentInstanceSymbol componentInstanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("sp.add", ExpandedComponentInstanceSymbol.KIND).orElse(null);
GeneratorRosCpp generatorRosCpp = new GeneratorRosCpp(); GeneratorRosCpp generatorRosCpp = new GeneratorRosCpp();
generatorRosCpp.setGenerationTargetPath("generated/");
LinkedList<String> inputs = new LinkedList<String>();
inputs.add("Imagepreprocessing");
inputs.add("Featureextraction");
inputs.add("Safetycontroller");
inputs.add("Drivercontroller");
try { try {
List<File> files = YamlHelper.generateFromFile("resources/config/add.yaml", symtab, generatorRosCpp); for (String inpu : inputs) {
System.out.println("Generating for " + inpu);
generatorRosCpp.setGenerationTargetPath("generated/"+inpu);
List<File> files = YamlHelper.generateFromFile("resources/config/"+inpu+".yaml", symtab, generatorRosCpp);
for (File f : files) {
System.out.println(" " + f.toString());
}
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
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