Commit a9fd1925 authored by Svetlana's avatar Svetlana

EMAM files for generation.

parent 94026348
This source diff could not be displayed because it is too large. You can view the blob instead.
- !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
component: sp.add
component: sp.imagepreprocessing
subscriber:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
a: clock.toSec()
b: clock.toSec()
imageIn: clock.toSec()
topic: /clock
type: rosgraph_msgs/Clock
publisher:
- !de.monticar.lang.monticar.generator.python.RosInterface
ports:
c: data
imageOut: data
topic: /echo
type: automated_driving_msgs/StampedFloat64
\ No newline at end of file
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;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import static de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab.createSymTab;
......@@ -42,13 +43,25 @@ public class Experiments {
RosToEmamTagSchema.registerTagTypes(symtab);
ExpandedComponentInstanceSymbol componentInstanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("sp.add", ExpandedComponentInstanceSymbol.KIND).orElse(null);
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 {
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) {
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