-
Notifications
You must be signed in to change notification settings - Fork 1
Test Applications
As we noted at the outset, in a Component-Based Software Engineering (CBSE) project, such as DREAM, the source code application file is replaced by the application script file or application XML file that runs the various components and connects them together in a working system. Thus, DREAM applications, i.e. collections of inter-connected YARP modules, are described in XML and launched using a utility called _gyarpmanager _. Refer to the Software Users Guide for more details on how to run these application descriptions.
In this section, we provide two test applications.
The first test application shows how to configure and run a simple application to use the protoComponent by connecting it to other components that provide input images and display the output images. This application uses yarpview modules to view the images. The threshold is modified online by sending commands to protoComponent from the command line in a terminal window.
The second test application shows how to configure and run a simple application to use * protoComponent* and * protoComponentGUI* together. In this case, the images are displayed in the GUI rather than yarpview displays and the threshold is modified interactively using the GUI controls.
Both applications have some some command-line parameters for illustration. Remember that these command-line parameter values have priority over the same parameter values specified in the relevant configuration file, which in turn have priority over the default values provided in the source code.
<application> <name>Demo of protoComponent</name> <dependencies> <port>/robot/cam/left</port> </dependencies> <module> <name>protoComponent</name> <parameters>--context components/protoComponent/config </parameters> <node>dream1</node> <tag>protoComponent</tag> </module> <module> <name>imageSource</name> <parameters>--context components/imageSource/config</parameters> <node>dream1</node> <tag>imageSource</tag> </module> <module> <name>yarpview</name> <parameters>--name /inputImage --x 000 --y 000 --w 320 --h 318 </parameters> <node>dream1</node> <tag>input_image</tag> </module> <module> <name>yarpview</name> <parameters>--name /binaryImage --x 320 --y 000 --w 320 --h 318 </parameters> <node>dream1</node> <tag>plot_image</tag> </module> <connection> <from>/robot/cam/left</from> <to>/inputImage</to> <protocol>tcp</protocol> </connection> <connection> <from>/robot/cam/left</from> <to>/protoComponent/image:i</to> <protocol>tcp</protocol> </connection> <connection> <from>/protoComponent/image:o</from> <to>/binaryImage</to> <protocol>tcp</protocol> </connection> </application>
<application> <name>Demo of protoComponentGUI</name> <dependencies> <port>/robot/cam/left</port> </dependencies> <module> <name>protoComponentGUI</name> <parameters>--context components/protoComponentGUI/config </parameters> <node>dream1</node> <tag>protoComponentGUI</tag> </module> <module> <name>protoComponent</name> <parameters>--context components/protoComponent/config </parameters> <node>dream1</node> <tag>protoComponent</tag> </module> <module> <name>imageSource</name> <parameters>--context components/imageSource/config --width 640 --height 480 </parameters> <node>dream1</node> <tag>imageSource</tag> </module> <connection> <from>/robot/cam/left</from> <to>/protoComponent/image:i</to> <protocol>tcp</protocol> </connection> <connection> <from>/protoComponent/image:o</from> <to>/protoComponentGUI/binaryimage:i</to> <protocol>tcp</protocol> </connection> <connection> <from>/protoComponent/statistics:o</from> <to>/protoComponentGUI/statistics:i</to> <protocol>tcp</protocol> </connection> <connection> <from>/robot/cam/left</from> <to>/protoComponentGUI/colourimage:i</to> <protocol>tcp</protocol> </connection> <connection> <from>/protoComponentGUI/threshold:o</from> <to>/protoComponent/threshold:i</to> <protocol>tcp</protocol> </connection> </application>
To run the application, follow the instruction in the Software Users Guide.