Articles Forum Examples Download Open Source
Copyright(c) 2006 by Pocomatic Software. All rights reserved.
OMG RTC (Robotic Technology Component) is a component model designed for robotic applications. The RTC specification itself only defines programming models (namely interfaces and signatures in either PIM or PSM) and leaves assembly, deployment and configuration models to applications. This example illustrates a domain specific assembly, deployment and configuration framework for RTC based on PocoCapsule/C++ IoC and DSM.
The modeled RTC robotic vehicle motion control application consists of the following seven component instances:
Two ServoComponent: the left and right wheels
Two BumperSensorComponent: the front and rear bumper
A VehicleController: the central motion controller
A RangerScannerComponent: the laser range finder
A LogAndDisplayComponent: logger and display status.
For simplicity of the example, these components are defined as CORBA local objects. They and wired up using the PocoCapsule/C++ IoC Container according to the setup.xml description. The assembled RTC application is illustrated in the following diagram:

main.C: This is a mini container, used by PocoCapsule/C++ to assemble/deploy this RTC application.
rtc_lite.idl: This is simplified version of OMG RTC IDL, sufficient to build this example.
sample.idl: The interface IDL definitions of all RTC components used in this example.
ServoComponentImpl.h and ServoComponentImpl.C: The implementation of ServoComponent.
BumperSensorComponentImpl.h and BumperSensorComponentImpl.C: The implementation of BumperSensorComponent.
RangeScannerComponentImpl.h and RangeScannerComponentImpl.C: The implementation of laser RangeScannerComponent.
VehicleControllerImpl.h and VehicleControlImpl.C: The implementation of VehicleController.
setup.xml: This is the application context described the setup of this RTC application.
rtc-application.dtd: This is the document type definition specifying the DSM schema.
rtc-application2poco.xsl: This is the DSM schema to the core schema of PocoCapsule/C++ transformation stylesheet.
To build this example, the environment variable POCOCAPSULE_DIR should point to the PocoCapsule/C++ installed directory. Then, this example can be built by simply invoking gmake/make on linux/unix or nmake on windows.
· Before starting the application deployment container (i.e. the main executable), make sure the LD_LIBRARY_PATH (on linux and solaris) or the PATH (on windows) environment variable is set correctly to include the ${POCOCAPSULE_DIR}/lib directory.
· start the main executable:
prompt> main
It will display the following component instantiation and wiring operations made during the assembling:
[init]: the vehicle controller is initialized [init]: the left wheel servo is initialized [wire]: The Control facet of the left wheel servo is connected to the LeftWheelControlOut port of the vehicle controller [init]: the right wheel servo is initialized [wire]: The Control facet of the right wheel servo is connected to the RightWheelControlOut port of the vehicle controller [init]: the laser ranger scanner is initialized [wire]: The Control facet of laser ranger scanner is connected to the ScanCommandOut port of the vehicle controller [init]: the log and display is initialized [wire]: The log and display is connected to the StatusOut port of the vehicle controller [wire]: The LeftWheelDataIn sink port of the vehicle controller is connected to the SpeedDataOut port of left wheel servo [wire]: The RightWheelDataIn sink port of the vehicle controller is connected to the SpeedDataOut port of right wheel servo [init]: the front bumper sensor is initialized [wire]: The FrontBumperDataIn sink port of the vehicle controller is connected to the BumperDataOut port of the front bumper sensor [init]: the rear bumper sensor is initialized [wire]: The RearBumperDataIn sink port of the vehicle controller is connected to the BumperDataOut port of rear the bumper sensor [wire]: The RangeScanDataIn sink port of the vehicle controller is connected to the RangeScanDataOut port of laser ranger scanner The robotic vehicle is ready to work ................. Terminating the robotic vehicle now .................. [fini]: the rear bumper sensor is finalized [fini]: the front bumper sensor is finalized [fini]: the log and display is finalized [fini]: the laser ranger scanner is finalized [fini]: the right wheel servo is finalized [fini]: the left wheel servo is finalized [fini]: the vehicle controller is finalized