| 1 | = Adding connection to the XML file = |
| 2 | |
| 3 | Let us suppose that we have createad a component ```MyComponent``` as described in [[TutorialAddingComponentToXML|previous tutorial]]. |
| 4 | |
| 5 | |
| 6 | Also, we suppose that we had added an input called "pose-low-quality" and an output called "pose-high-quality" to our class ```MyComponent```. |
| 7 | |
| 8 | **Inputs:** We will take our input from a component of class ```LowCostGps``` named ```gps``` which has an output called ```"pose"```. |
| 9 | |
| 10 | **Outputs:** We will send our processed pose to another component ```othercomp``` of class ```OtherComponent`` which has an input called ```"pose"```. |
| 11 | |
| 12 | **Warning:** |
| 13 | Output ```"pose"``` in class ```LowCostGps``` has the same type as our input ```"pose-low-quality"```. |
| 14 | Similarly, input ```"pose"``` in class ```OtherComponent``` has the same type as our output ```"pose-high-quality"```. |
| 15 | |
| 16 | To add a connection, we will modify the ```connections``` node of the XML file. |
| 17 | The rest of the file rests unchanged. |
| 18 | |
| 19 | {{{#!xml |
| 20 | <?xml version="1.0" encoding="ISO-8859-1"?> |
| 21 | <pacpus> |
| 22 | <components> |
| 23 | <!-- other components --> |
| 24 | |
| 25 | <component name="gps" type="LowCostGps" /> |
| 26 | <component name="mycomp" type="MyComponent" /> |
| 27 | <component name="othercomp" type="OtherComponent" /> |
| 28 | </components> |
| 29 | |
| 30 | <connections> |
| 31 | <!-- other connections --> |
| 32 | |
| 33 | <!-- Getting input from GPS --> |
| 34 | <connection output="gps.pose" input="mycomp.pose-low-quality" type="direct" /> |
| 35 | <!-- Outputting better pose to another component --> |
| 36 | <connection output="mycomp.pose-high-quality" input="othercomp.pose" type="direct" /> |
| 37 | </connections> |
| 38 | |
| 39 | <!-- Windows (release) --> |
| 40 | <plugins prefix="" postfix="" extension="dll"> |
| 41 | <plugin lib="MyComponent" /> |
| 42 | <!-- other plugins (libraries) --> |
| 43 | </plugins> |
| 44 | |
| 45 | <parameters> |
| 46 | </parameters> |
| 47 | </pacpus> |
| 48 | }}} |