README.md 2.06 KB
Newer Older
1
# EMAM2Middleware
2

ahellwig's avatar
ahellwig committed
3 4
## Usage
### Defining the connection between a component and the middleware
Alexander David Hellwig's avatar
Alexander David Hellwig committed
5 6 7 8 9 10 11 12
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(http://wiki.ros.org/Topics) with name, type and optional msgField(http://wiki.ros.org/msg , 2.)
Examples:
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)

ahellwig's avatar
ahellwig committed
13
### Use case 1: Creating 1 executable
Alexander David Hellwig's avatar
Alexander David Hellwig committed
14 15
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)

ahellwig's avatar
ahellwig committed
16
### Use case 2: Creating multiple executables for distributed systems
Alexander David Hellwig's avatar
Alexander David Hellwig committed
17 18
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)

ahellwig's avatar
ahellwig committed
19
### Compile and run the generated Projects
Alexander David Hellwig's avatar
Alexander David Hellwig committed
20 21 22 23
1. install needed software:
    * ROS Kinetic(http://wiki.ros.org/kinetic/Installation)
    * CMake(https://cmake.org/)
    * Armadillo( www.arma.sourceforge.net)
ahellwig's avatar
ahellwig committed
24
        * Ubuntu package: libarmadillo-dev
Alexander David Hellwig's avatar
Alexander David Hellwig committed
25 26 27 28 29 30 31 32 33 34
        * creating a copy of the library named armadillo.h might be necessary. Ubuntu location: /usr/include/armadillo 
1. source your ros environment(http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment , 2.)
1. a) run src/test/resources/TargetCompilation.sh 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
ahellwig's avatar
ahellwig committed
35
1. If the project was created by a MiddlewareGenerator, run the executable(s) at build/coordinator(/<subcomp.name>)/Coordinator_<(sub)component.name>