Added readme

parent cab34d37
# EMAM2Middleware
This generator needs versions of other EMAM libraries that are not yet distributed via Maven.
Workaround: Download these branches and build each via 'mvn clean install -U -s settings.xml'
* EmbeddedMontiArc/RosPort:
* EmbeddedMontiArcMath/RosPort:
* EMAM2RosMsg:
* EMAM2RosCpp/RosPort:
###Defining the connection between a component and the middleware
The connection between middleware and the component is defined as tags on Ports in .tag files.
#### ROS:
Tags of the type RosConnection can either be simple tags(see Example 3) or define a topic( with name, type and optional msgField( , 2.)
1. src/test/resources/tests/a/Add.tag (TODO: link)
1. src/test/resources/tests/a/Echo.tag (TODO: link)
1. src/test/resources/tests/dist/SimpleDist.tag (TODO: link)
###Use case 1: Creating 1 executable
Look at GenerationTest::testMiddlewareGenerator. The component is defined in src/test/resources/tests/a/AddComp.emam (TODO: link) and the tags for the connection to ros are defined in src/test/resources/tests/a/Add.tag (TODO: link)
###Use case 2: Creating multiple executables for distributed systems
Look at GenerationTest::testDistributedTargetGenerator. The component is defined in src/test/resources/dist/DistComp.emam (TODO: link) and the tags for the connection to ros are defined in src/test/resources/dist/SimpleDist.tag (TODO: link)
###Compile and run the generated Projects
1. install needed software:
* ROS Kinetic(
* CMake(
* Armadillo(
* creating a copy of the library named armadillo.h might be necessary. Ubuntu location: /usr/include/armadillo
1. source your ros environment( , 2.)
1. a) run src/test/resources/ from **this project's** root
1. or b) compile a single project by
* changing to the **generated project's** root
* create a folder build/ and change into it
* run: cmake ../src
* run: make
1. Start ros and the other nodes
* minimal working example: run: roscore
1. If the project was created by a MiddlewareGenerator, run the executable(s) at build/coordinator(/<>)/Coordinator_<(sub)>
\ No newline at end of file
......@@ -52,19 +52,24 @@ public class GenerationTest extends AbstractSymtabTest {
public void testMiddlewareGenerator() throws IOException {
TaggingResolver taggingResolver = createSymTabAndTaggingResolver("src/test/resources/");
//register the middleware tag types
ExpandedComponentInstanceSymbol componentInstanceSymbol = taggingResolver.<ExpandedComponentInstanceSymbol>resolve("tests.a.addComp", ExpandedComponentInstanceSymbol.KIND).orElse(null);
//make sure the middleware tags are loaded
TagHelper.resolveTags(taggingResolver, componentInstanceSymbol);
StarBridgeGenerator starBridgeGenerator = new MiddlewareGenerator();
starBridgeGenerator.add(new CPPGenImpl(), "cpp");
starBridgeGenerator.add(new RosCppGenImpl(), "roscpp");
starBridgeGenerator.add(new DummyMiddlewareGenImpl(), "dummy");
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
//generator for component itself
middlewareGenerator.add(new CPPGenImpl(), "cpp");
//generator for the ros connection
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
//generator for a dummy to test support for multiple middleware at the same time
middlewareGenerator.add(new DummyMiddlewareGenImpl(), "dummy");
starBridgeGenerator.generate(componentInstanceSymbol, taggingResolver);
middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
......@@ -77,11 +82,11 @@ public class GenerationTest extends AbstractSymtabTest {
TagHelper.resolveTags(taggingResolver, componentInstanceSymbol);
StarBridgeGenerator starBridgeGenerator = new DistributedTargetGenerator("./target/generated-sources-cmake/distributed/src/");
DistributedTargetGenerator distributedTargetGenerator = new DistributedTargetGenerator("./target/generated-sources-cmake/distributed/src/");
starBridgeGenerator.add(new CPPGenImpl(), "cpp");
starBridgeGenerator.add(new RosCppGenImpl(), "roscpp");
distributedTargetGenerator.add(new CPPGenImpl(), "cpp");
distributedTargetGenerator.add(new RosCppGenImpl(), "roscpp");
starBridgeGenerator.generate(componentInstanceSymbol, taggingResolver);
distributedTargetGenerator.generate(componentInstanceSymbol, taggingResolver);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment