Download
latest Releases : 2.0.0-RELESE
2.0.0-RELESE | Download page |
Number of Projects
RT-Component | 152 |
RT-Middleware | 33 |
Tools | 22 |
Documentation | 2 |
Choreonoid
Motion editor/Dynamics simulator
OpenHRP3
Dynamics simulator
OpenRTP
Integrated Development Platform
AIST RTC collection
RT-Components collection by AIST
TORK
Tokyo Opensource Robotics Association
DAQ-Middleware
Middleware for DAQ (Data Aquisition) by KEK
Making an OpenCV RT-Component (Flip component)
This section describes creating an RT-Component to invert an image using the OpenCV library and VC9:The cvFlip() function
The cvFlip() function flips a 2D array (i.e. an image) on the vertical axis, horizontal axis, or both axes at the same time.
Component outline
The component will flip an image received by an InPort and output it on an OutPort.
The flip mode will be controlled by an RTC configuration parameter called "flip_mode." Set flip_mode as below:
The specification of the component we will create is as follows:
※ TimedOctetSeq is a data type specified in BasicDataType.idl from OpenRTM-aist.
※ octet is a CORBA IDL base type that can store and transmit any data in 8-bit format without transformation.
Figure 1 illustrates the effects of different flip_mode settings.
Operating environment and development environment
Generate the Flip component template
We will generate the Flip component template using RTCBuilder.
Starting RTCBuilder
Upon starting Eclipse with a new workspace, the Welcome page will be displayed.
Close this Welcome screen using the close button to display the default perspective view.
Click the "Open Perspective" button in the top right and select "Other..." from the menu.
Select "RTC Builder".
Making an RTCBuilder project
First, we will make an Eclipse project for the RT-Component. From the File menu, select "New," then "Project."
In the displayed dialog, select "Other," then "RTCBuilder" (RTC ビルダ) and click "Next".
Enter a project name and click "Finish."
A project using the given name will be created and displayed in the package explorer.
Within the generated project will be an RTC profile XML (RTC.xml) containing default values.
Starting the RTC Profile Editor
To open the RTC Profile Editor, click the "Open New RtcBuilder Editor" button on the toolbar, or select "Open New Builder Editor" from the File menu.
Data type definition files location
It is necessary to set the location of the IDL files that define data types used by data ports and service ports.
※ This value is valid for the entire workspace, so it does not need to be set for each project created within the same workspace.
Entering the component profile and generating code
1. Select the "Basic" (基本) tab, and enter the basic component information as below.
-Module name: Flip
-Output Project: Flip
2. Select the "Activity" (アクティビティ) tab and select the action callbacks that will be used.
For the Flip component, the onActivated(), onDeactivated() and onExecute() callbacks will be used. Check them as in Figure 14.
3. Select the ""Data port" (データポート) tab and enter the data port information.
-InPort Profile:
-OutPort Profile:
4. Select the "Configuration" (コンフィギュレーション) tab and enter the configuration parameters.
-flip_mode
-image_height
-image_width
5. Select the "Language/Environment" (言語・環境) tab and choose a programming language. For the Flip component, choose C++.
6. Click the "Generate code" (コード生成) button in the "Basic" tab to generate the component template.
※ The component template code will be generated in the currently-active Eclipse workspace directory. You can check this directory by selecting "Change workspace" from the File menu.