여기에서는 OpenRTM-aist(C++)의 Windows에의 인스톨 방법을 설명합니다. ※이후의 설명은 편의상 OpenRTM-aist-0.4.0에 대해서 쓰여져 있습니다.OpenRTM-aist-0.4.x에 대해서도 같은 순서로 인스톨 할 수 있습니다.
OpenRTM-aist 의 리포지터리 서버로부터 인스톨 할 수 있게 되었습니다.
아래와 같은 Linux 디스트리뷰션에서 동작합니다.
※이전 버전의 OpenRTM-aist가 인스톨 되어 있는 환경에서는 그것을 완전히 삭제하고 나서 인스톨을 해주십시오.
참고:
→ ''FAQ:'' OpenRTM-aist의 인스톨에 실패하는 경우
> su # sh pkg_install_vine.sh
rpm http://www.openrtm.org/pub/Linux/Vine/apt x.x/$(ARCH) main
rpm http://www.openrtm.org/pub/Linux/Vine/apt 3.2/$(ARCH) main
> su # apt-get update # apt-get install gcc-c++ python # apt-get install omniORB omniORB-devel omniORB-servers omniORB-doc # apt-get install ace ace-devel # apt-get install OpenRTM-aist OpenRTM-aist-devel OpenRTM-aist-doc OpenRTM-aist-example # apt-get install PyYAML
# rpm -q OpenRTM-aist OpenRTM-aist-0.4.2-0.vl31
> su # sh pkg_install_fedora.sh
[openrtm] name=Fedora $releasever - $basearch failovermethod=priority baseurl=http://www.openrtm.org/pub/Linux/Fedora/releases/$releasever/Fedora/$basearch/os/Packages enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
> su # yum install gcc-c++ python # yum install omniORB omniORB-devel omniORB-doc omniORB-servers omniORB-utils omniORB-bootscripts # yum install ace ace-devel # yum install OpenRTM-aist OpenRTM-aist-devel OpenRTM-aist-doc OpenRTM-aist-example # yum install PyYAML
# rpm -q OpenRTM-aist OpenRTM-aist-0.4.2-0.fcX
> su # sh pkg_install_debian.sh 또는 # sh pkg_install_ubuntu.sh
도중 , 인스톨의 「필요·불필요」를 물어보므로,y를 입력하면서 완료시킵니다.
deb http://www.openrtm.org/pub/Linux/ubuntu/ ''code name'' main
또는
deb http://www.openrtm.org/pub/Linux/debian/ ''code name'' main
"code name" 의 부분에는 이하의 debian/ubuntu의 버전에 대응한 코드네임을 지정합니다.
| 버젼 | code name |
| Debian 3.1 | sarge |
| Debian 4.0 | etch |
| Ubuntu 7.04 | feisty |
| Ubuntu 7.10 | gutsy |
| Ubuntu 8.04 | hardy |
| Ubuntu 8.10 | intrepid |
| Ubuntu 9.04 | jaunty |
| Ubuntu 9.10 | karmic |
| Ubuntu 9.10 | lucid |
| Ubuntu 9.10 | maverick |
> su # vi /etc/apt/sources.list # "sources.list" 를 편집 # apt-get update # apt-get install gcc g++ make # apt-get install libomniorb4 libomniorb4-dev omniidl4 omniorb4-nameserver # apt-get install python-support (Debian 3.1 Sarge만 인스톨 해 주세요.) # apt-get install python-yaml # apt-get install libace-dev # apt-get install libace ⇒ "주:를 참조" # apt-get install openrtm-aist openrtm-aist-doc openrtm-aist-dev openrtm-aist-example # apt-get install python-yaml
주: libace 에 대해
「E: 패키지 libace 가 발견되지 않습니다」라는 메세지가 나오지만, 일반적으로 libace-dev의 의존관계에 의해 libace 는 자동적으로 적용되므로, 상기 순서 중 「# apt-get install libace」의 부분은 생략해도 괜찮습니다.
덧붙여 인스톨 끝난 OpenRTM-aist를 특정 버전인 채 보관 유지하고 싶은 경우에는,/etc/apt/preferences를 편집해 이하의 행을 추가합니다.(이 예에서는 0.4 계열로 버전을 고정합니다.)
Package: OpenRTM-aist Pin: version 0.4.*
$ dpkg -l 'openrtm*' Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend |/ Err?=(none) /Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii openrtm-aist 0.4.2-1 OpenRTM-aist runtime libraries and configura ii openrtm-aist-d 0.4.2-1 Header files for OpenRTM-aist development pn openrtm-aist-d <none> (no description available) ii openrtm-aist-e 0.4.2-1 OpenRTM-aist examples
◆계속 샘플을 사용해 테스트 로 진행해 주십시오.;
※이후의 설명은 편의상 OpenRTM-aist-0.4.0에 대해서 쓰여져 있습니다.OpenRTM-aist-0.4.x에 대해서도 같은 순서로 인스톨 할 수 있습니다.
OpenRTM-aist-0.4.x는 아래와 같은 OS 및 Linux 디스트리뷰션에서 동작 하는 것이 확인되고 있습니다.
OpenRTM-aist-0.4.x 는 아래와 같은 OS 및 Linux 배포 버전에서 동작 하는 것이 확인되고 있습니다.
OpenRTM-aist-0.4.0의 인스톨에는 아래와 같은 패키지가 필요합니다.
다만, OpenRTM-aist-0.4.2소스에 부속의 이러한 셸 스크립트는 OpenRTM-aist-0.4.2 빌드된 패키지도 동시에 인스톨 하게 되어 있는 것도 있습니다. 상기 툴 패키지만을 인스톨 하고 싶은 경우는, 이러한 셸 스크립트를 적당 편집해 사용해 주십시오.
Fedora 와 Vine의 몇개의 대표적인 버전에 대해서는 여기의 리포지터리 서버에 ACE 와 omniORB의 rpm, deb 패키지가 준비되어 있습니다. 이것에 의해 apt-get 나 yum를 이용해 간단하게 인스톨 할 수 있게 되었습니다.
참고OpenRTM-aist 의 소스로부터의 빌드를 실시하는 경우는 참고: 중 OpenRTM-aist 관련 (OpenRTM-aist, OpenRTM-aist-devel, OpenRTM-aist-doc, OpenRTM-aist-example)의 인스톨 부분은 생략해 주십시오.
상기 이외의 OS에 대해서는 각각의 패키지의 문서에 따라 인스톨해 주십시오. 이러한 패키지가, 표준 디렉토리(/usr, /usr/local 등 ) 아래에 인스톨 되어 있으면, 이후의 OpenRTM-aist의 컴파일 작업을 비교적 간단하게 실시할 수 있습니다.
우선 소스 코드 OpenRTM-aist-0.4.0.tar.gz zip(※최신 버전은 여기⇒OpenRTM-aist-1.0.0-RC1.tar.gz)를 적당한 디렉토리에 전개합니다.
> tar xvzf OpenRTM-aist-0.4.0.tar.gz > cd OpenRTM-aist-0.4.0
OpenRTM-aist 는 패키지의 빌드에 autoconf, automake 를 사용하고 있습니다. 빌드 방법은 다른 autoconf, automake를 사용한 패키지와 같기 때문에 같은 방법으로 실시합니다.
> ./configure --prefix=/usr [options]
./configure에게 줄 수 있는 옵션의 일부를 이하에 나타냅니다.
--with-omniorb=dir --with-tao=dir --with-mico=dir --with-orbix=dir --with-orbacus=dir
--with-gcc2
--with-ace-includes=dir --with-ace-lib=dir
--with-ace-include=/tmp/src/ACE_wrappers --with-ace-libs=/tmp/src/ACE_wrappers/ace
> ./configure --help
configure가 정상적으로 종료한 것을 확인해 주십시오. 정상적으로 종료했다면 make 합니다.
> make
인스톨 하기 위해서는 적어도
OpenRTM-aist-0.4.0/rtm OpenRTM-aist-0.4.0/rtm/idl OpenRTM-aist-0.4.0/utils/rtm-config OpenRTM-aist-0.4.0/utils/rtm-naming OpenRTM-aist-0.4.0/utils/rtc-template
이하의 디렉토리가 정상적으로 빌드 되고 있을 필요가 있습니다. 빌드가 정상적으로 종료되어 헤더 파일, 라이브러리, 유틸리티 커멘드군을 인스톨 합니다.
> su # make install
※이후의 설명은 편의상 OpenRTM-aist-0.4.0에 대해 쓰여져 있습니다. OpenRTM-aist-0.4.x에 대해서도 같은 순서로 인스톨 할 수 있습니다. 이하의 작업은 Administrator 권한을 가진 상태로 해주십시오.
OpenRTM-aist-0.4.0 의 인스톨에는 아래와 같은 패키지가 필요합니다.
덧붙여 ACE 및 omniORB의 Windows용의 헤더 및 라이브러리(LIB.DLL)를 포함한 인스톨러를 다운로드 페이지 및 아래와 같이에 준비되어 있습니다. 또, OpenCV의 인스톨러는 아래와 같이 링크 sourceforge의 다운로드 페이지로부터 다운로드할 수 있습니다.
ACE, omniORB, OpenCV를 상기 이외의 인스톨러로 인스톨 했을 경우한 후의 OpenRTM-aist의 빌드 및 자작 컴포넌트의 빌드 시에 필요한 환경 변수가 설정되지 않으므로 주의해 주십시오. 이러한 인스톨러를 사용한 인스톨을 추천합니다.
최신 정보:2008/06/02
Visual C++ 2008 Express Edition 일본어판 에 대응한 OpenRTM-aist-0.4.2-jp_vc9패키지가 08/05/29에 릴리스 되었습니다. 이것을 동작시키기 위해서는 ACE, omniORB등도 새로운 버전으로 설치하지 않으면 안됩니다. 그것들을 여기 에 정리하였으니 참고해 주십시오.
다운로드 페이지 혹은, 상기 링크로부터 omniORB의 인스톨러 omniORB-4.0.7-jp_vcX.msi를 다운로드합니다. omniORB-4.0.7-jp_vcX.msi를 실행하면 인스톨러가 기동하므로 지시에 따라서 인스톨 합니다.
인스톨러는 이하의 작업을 실시합니다.덧붙여 환경 변수의 어플리케이션에의 통지 되지 않으므로, 환경 변수의 갱신을 유효하게 하려면 재기동해 주십시오. (※「내 컴퓨터」→「속성」→「상세 설정」→「환경 변수」로부터 환경 변수를 선택해 「편집」을 클릭해 편집 다이얼로그를 표시하고 그대로 아무것도 변경하지 않고 OK를 누르는 것으로 셸에 환경 변수의 변경이 통지되어 그 셸로부터 새롭게 실행한 어플리케이션에서는 변경된 환경 변수가 유효하게 됩니다만, 확실하지 않을 경우 재기동하는 편이 좋습니다.)
omniidl (omniORB의 IDL 컴파일러)나, 그 외 OpenRTM-aist의 툴에서 필요합니다. 다운로드 페이지 혹은, 상기의 링크Python 2.4.4 win32 installer로부터 다운로드해 인스톨러를 기동해 주십시오. 인스톨러를 기동하면, 위저드에서 몇이나 선택하는 부분이 있습니다만, 디폴트인 채로 인스톨 해도 괜찮습니다.
→ FAQ:Cygwin을 인스톨 하고 있는 환경에서 python.exe가 복수 존재하는 경우
OpenRTM-aist-0.4.2만, rtc-template에 필요합니다.다운로드 페이지 혹은, 상기의 링크PyYAML win32 installer 로부터 다운로드해 인스톨러를 기동해 주십시오.
다운로드 페이지 혹은, 상기 링크로부터 OpenCV의 인스톨러 OpenCV_1.0.exe를 다운로드합니다. OpenCV_1.0.exe를 실행하면 인스톨러가 기동하므로 지시에 따라서 인스톨 합니다. OpenCV는 부속의 샘플 RT컴포넌트 USBCamera를 사용하는 경우에게만 필요합니다.
Windows용의OpenRTM-aist의 인스톨러 (※이 링 크는 현재 0.4.2의 인스톨러가 링크 되고 있습니다)를 다운로드합니다. OpenRTM-aist-0.4.0.msi를 실행해, 지시에 따라서 인스톨 합니다.
인스톨러는 이하의 작업을 실시합니다.또, Window로 사용하는 경우에는 환경 변수 Path에 %RTM_ROOT%\bin 및%RTM_ROOT%\utils\rtc-template도 등록하는 것을 추천합니다.
추가: 08/03/17(08/04/28개)
VC++2005 관련의 개발 환경(Microsoft Visual Studio 2005,Visual C++ 2005 Express등)을 인스톨 하고 있지 않는 환경에서는 반드시Microsoft Visual823C++ 2005 SP1 재배포 가능 패키지 (x86) 도 인스톨 해 주십시오.
※이후의 설명은 편의상 OpenRTM-aist-0.4.0에 대해서 쓰여져 있습니다. OpenRTM-aist-0.4.x에 대해서도 같은 순서로 인스톨 할 수 있습니다.
OpenRTM-aist-0.4.0-win32는 다음의 개발 환경에서 빌드가 가능합니다.
혹은
최신 정보:2008/06/02
Visual C++ 2008 Express Edition 일본어판 에 대응한 OpenRTM-aist-0.4.2-jp_vc9 패키지 세트가 08/05/29에 릴리스 되었습니다. 이것을 동작시키기 위해서는 ACE, omniORB등도 새로운 버전을 설치하지 않으면 안됩니다. 그것들을 여기 에 정리하였으니 참고해 주십시오.
「Visual C++ 2005 Express Edition」→「Microsoft Platform SDK」의 순서로 인스톨 해 주십시오. 「Microsoft Platform SDK」를 인스톨 할 때, 인스톨 폴더를 물어 봅니다만, 그 때 디폴트*로 인스톨 하지 않고 , 다음과 같이 지정해 주십시오.
<VC의 인스톨 폴더>\PlatformSDK''*''통상 디폴트에서는 「C:\Program Files\Microsoft Platform SDK\」에 인스톨 됩니다.
C:\Program Files\Microsoft Visual Studio 8\VC에 있기 때문에 예를 들어 이 경우, Microsoft Platform SDK는 C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK에 인스톨 해 주십시오.
덧붙여 ACE 및 omniORB의 Windows용의 헤더 및 라이브러리(LIB.DLL)를 포함한 인스톨러를 다운로드 페이지 및 아래와 같이 준비되어 있습니다.
덧붙여 환경 변수의 어플리케이션에 통지가 되지 않으므로, 환경 변수의 갱신을 유효하게 하려면 재기동해 주십시오. (※「내 컴퓨터」→「속성」→「상세 설정」→「환경 변수」로부터 환경 변수의 어떤 것인지를 선택해 「편집」을 클릭해 편집 다이얼로그를 표시시켜, 그대로 아무것도 변경하지 않고 OK를 누르는 것으로 셸에 환경 변수의 변경이 통지되어 그 셸로부터 새롭게 실행한 어플리케이션에서는 변경된 환경 변수가 유효하게 됩니다만, 확실하지 않을 경우는 재기동하는 편이 좋습니다.)
다운로드 페이지 혹은 Python 2.4.4 win32 installer 로부터 다운로드해 인스톨러를 기동해 주십시오. 인스톨러를 기동하면 위저드로 몇이나 선택하는 부분이 있습니다만, 디폴트인 채로 인스톨해도 됩니다.
다운로드 페이지 혹은 OpenCV win32 installer(sourceforge) 에서 OpenCV의 인스톨러 OpenCV_1.0.exe를 다운로드}; 합니다. OpenCV_1.0.exe를 실행하면 인스톨러가 기동하므로 지시에 따라서 인스톨 합니다. OpenCV는 부속의 샘플 RT컴포넌트 USBCamera를 사용하는 경우에게만 필요합니다.
인스톨이 정상적으로 종료되면 부속되어 있는 샘플로 동작 테스트를 합니다. 샘플은 {prefix}* /share/OpenRTM-aist/examples에 있습니다(소스로 빌드·인스톨 했을 경우는 인스톨 디렉토리 이하의 /examples/<샘플 컴포넌트 세트명> 에도 있습니다). 샘플 컴포넌트 세트인 SimpleIO 를 사용하여 샘플 컴포넌트와 OpenRTM-aist 의 동작을 확인합니다.
{prefix}*: 통상 Linux라면 /usr 그 이외에서는 /usr/local 가 되는 경우가 대부분입니다. 소스로 빌드·인스톨 했을 경우는 configure 시의 옵션, --prefix 에게 준 경로( --prefix 를 설정하지 않았던 경우의 디폴트치는 /usr/local).
샘플 컴포넌트 세트 SimpleIO: RT컴포넌트 ConsoleInComp, ConsoleOutComp와 이것들의 통신을 접속하는 ConnectorComp로 된 샘플 세트입니다. 이 세트는 ConsoleInComp에게 준 수치를 ConsoleOutComp에 표시시키는 「가장 간단한 I/O 데몬스트레이션」을 목적으로 한 샘플입니다. ConsoleInComp로부터 ConsoleOutComp에 접속해, 그 통신을 개시시키는 것이 ConnectorComp의 역할입니다.
◆편의상 샘플은 usr/share/OpenRTM-aist/examples 이하에 있는 것으로서 설명을 기술합니다.
우선, rtm-naming *으로 네임서버를 기동합니다. 이 때 포트 넘버는 9876로 지정해 주십시오.
$ rtm-naming 9876 tarting omniORB omniNames: localhost.localdomain:9876 $ Wed Jun 4 23:03:09 2008: Starting omniNames for the first time. Wrote initial log file. Read log file successfully. Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000001000000000000006400000001010200100000003139322e3136382e3130302e32333600942600000b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100 Checkpointing Phase 1: Prepare. Checkpointing Phase 2: Commit. Checkpointing completed.
* 패스는 {prefix} /bin/rtm-naming. 대개, which rtm-naming 명령어로 검색할 수 있습니다.
테스트를 위한 RTC 컨피그레이션 파일 rtc.conf를 작성해 배치합니다. 우선, 적당한 작업 디렉토리를 만듭니다. 여기에서는 편의상 홈 디렉토리 아래에 RTCwork 라고 하는 디렉토리를 작업 디렉토리로 하겠습니다. 작업 디렉토리 RTCwork에 다음과 같은 내용의 파일 rtc.conf 를 작성해 저장합니다. ※/usr/share/OpenRTM-aist/examples 아래에 있는 rtc.conf는 이 예에서는 사용할 수 없으므로, ~/RTCWork/rtc.conf 로서 새롭게 작성해 주십시오.
corba.nameservers: localhost:9876 naming.formats: %n.rtc
터미널을 기동하고 다음과 같이 2.에서 작성한 rtc.conf를 참조시키는 형태로 ConsoleInComp를 기동합니다.
$ /usr/share/OpenRTM-aist/examples/ConsoleInComp -f ~/RTCwork/rtc.conf Creating a component: "ConsoleIn"....succeed. ================================================= Component Profile ------------------------------------------------- InstanceID: ConsoleIn0 Implementation: ConsoleIn Description: Console input component Version: 1.0 Maker: Noriaki Ando, AIST Category: example Other properties ================================================= ================================================= Port0 (name): out ------------------------------------------------- - properties - port.port_type: DataOutPort dataport.data_type: TimedLong dataport.interface_type: CORBA_Any dataport.dataflow_type: Push, Pull dataport.subscription_type: Flush, New, Periodic -------------------------------------------------
자신이 빌드·인스톨 했을 경우는, {인스톨 디렉토리}/examples/SimpleIO/ConsoleInComp -f ~/RTCwork/rtc.conf 으로 ConsoleInComp를 기동합니다.
터미널을 기동하고 다음과 같이 2.에서 작성한 rtc.conf를 참조하는 형태로 ConsoleOutComp를 기동합니다.
$ /usr/share/OpenRTM-aist/examples/ConsoleOutComp -f ~/RTCwork/rtc.conf succeed. ================================================= Component Profile ------------------------------------------------- InstanceID: ConsoleOut0 Implementation: ConsoleOut Description: Console output component Version: 1.0 Maker: Noriaki Ando, AIST Category: example Other properties ================================================= ================================================= Port0 (name): in ------------------------------------------------- - properties - port.port_type: DataInPort dataport.data_type: TimedLong dataport.interface_type: CORBA_Any dataport.dataflow_type: Push, Pull dataport.subscription_type: Any -------------------------------------------------
터미널을 기동하고 다음과 같이 ConnectorComp를 기동합니다.
$ /usr/share/OpenRTM-aist/examples/ConnectorComp Subscription Type: Connector ID: f9626fe4-3243-21dd-0100-000c293a94a2 dataport.interface_type: CORBA_Any dataport.dataflow_type: Push dataport.subscription_type: dataport.corba_any.outport_ref: not a string value dataport.corba_any.inport_ref: not a string value $
자신이 빌드·인스톨 했을 경우는, {인스톨 디렉토리}/examples/SimpleIO/ConnectorComp 으로 ConnectorComp를 기동합니다.
5.ConnectorComp 의 기동 후, ConsoleInComp측의 터미널에
Please input number:
ConsoleInComp 측의 터미널에 숫자를 입력하면, ConsoleOutComp 측의 터미널에 입력한 수치가 나타납니다. 여기까지 되었다면 OpenRTM-aist가 정상적으로 인스톨 되고 있는 것을 확인할 수 있습니다.
컴포넌트의 템플릿 제네레이터를 사용하고 간단한 컴포넌트를 작성하는 테스트를 실시합니다. 템플릿 제네레이터 (rtc-template)를 사용합니다.
컴포넌트를 작성하는 디렉토리(임의의 디렉토리)를 작성하고, 컴포넌트를 작성해 컴파일 해 보겠습니다.
> cd > mkdir SampleComponent > cd SampleComponent
우선은 help를 보겠습니다.
> rtc-template --help
Usage: rtc-template [OPTIONS]
Options:
[-h] Print short help.
[--help] Print details help.
[--backend[=backend] or -b] Specify template code generator.
[--module-name[=name]] Your module name.
[--module-desc[=description]] Module description.
[--module-version[=version]] Module version.
[--module-vendor[=vendor]] Module vendor.
[--module-category[=category]] Module category.
[--module-comp-type[=component_type]] Component type.
[--module-act-type[=activity_type]] Component's activity type.
[--module-max-inst[=max_instance]] Number of maximum instance.
[--module-lang[=language]] Language.
[--config[=ParamName:Type:Default]] Configuration variable.
[--inport[=PortName:Type]] InPort's name and type.
[--outport[=PortName:Type]] OutPort's name and type
[--service[=PortName:Name:Type]] Service Provider Port
[--service-idl[=IDL_file]] IDL file name for service
[--consumer[=PortName:Name:Type]] Service Consumer Port
[--consumer-idl[=IDL_file]] IDL file name for consumer
[--idl-include=[path]] Search path for IDL compile
:
중략
:
Example:
rtc-template -bcxx --module-name=Sample --module-desc='Sample component' --module-version=0.1 --module-vendor=AIST --module-category=Generic --module-comp-type=DataFlowComponent --module-act-type=SPORADIC --module-max-inst=10 --config=int_param0:int:0 --config=int_param1:int:1 --config=double_param0:double:3.14 --config=double_param1:double:9.99 --config="str_param0:std::string:hoge" --config="str_param1:std::string:foo" --inport=Ref:TimedFloat --inport=Sens:TimedFloat --outport=Ctrl:TimedDouble --outport=Monitor:TimedShort --service=MySvcPort:myservice0:MyService --consumer=YourSvcPort:yourservice0:YourService --service-idl=MyService.idl --consumer-idl=YourService.idlrtc-template에 대해서 작성하고 싶은 컴포넌트의 설정을 인수로서 넘겨주면 컴포넌트의 양식을 작성합니다. 여기에서는, help의 표시의 마지막에 표시된 Example: 이하를 복사하고 테스트해 보겠습니다.|
interface MyService
{
void echo();
}; interface YourService
{
void echo();
};이러한 파일을 작성했다면,Example: 의 예를 복사&붙여넣기를 하는 등 커멘드로서 입력합니다.
> rtc-template -bcxx --module-name=Sample --module-desc='Sample component' --module-version=0.1 --module-vendor=AIST --module-category=Generic --module-comp-type=DataFlowComponent --module-act-type=SPORADIC --module-max-inst=10 --config=int_param0:int:0 --config=int_param1:int:1 --config=double_param0:double:3.14 --config=double_param1:double:9.99 --config="str_param0:std::string:hoge" --config="str_param1:std::string:foo" --inport=Ref:TimedFloat --inport=Sens:TimedFloat --outport=Ctrl:TimedDouble --outport=Monitor:TimedShort --service=MySvcPort:myservice0:MyService --consumer=YourSvcPort:yourservice0:YourService --service-idl=MyService.idl --consumer-idl=YourService.idl File "MyServiceSVC_impl.h" was generated. File "MyServiceSVC_impl.cpp" was generated. File "Sample.h" was generated. File "Sample.cpp" was generated. File "SampleComp.cpp" was generated. File "Makefile.Sample" was generated. File "SampleComp_vc8.vcproj" was generated. File "Sample_vc8.vcproj" was generated. File "SampleComp_vc9.vcproj" was generated. File "Sample_vc9.vcproj" was generated. File "Sample_vc8.sln" was generated. File "Sample_vc9.sln" was generated. File "copyprops.bat" was generated. File "user_config.vsprops" was generated. File "README.Sample" was generated. File "Sample.yaml" was generated. > ls Makefile.Sample Sample.h Sample_vc8.vcproj MyService.idl Sample.yaml Sample_vc9.sln MyServiceSVC_impl.cpp SampleComp.cpp Sample_vc9.vcproj MyServiceSVC_impl.h SampleComp_vc8.vcproj YourService.idl README.Sample SampleComp_vc9.vcproj copyprops.bat Sample.cpp Sample_vc8.sln user_config.vsprops
4.의 결과, 위와 같이 컴포넌트의 C++의 코드, 서비스의 구현 코드 및 Makefile 등(그 밖에 VC++관련의 파일=Windows용을 포함)이 작성됩니다. 여기서,
> make -f Makefile.Sample 혹은 > mv Makefile.Sample Makefile > make
로서 make 합니다.
> make -f Makefile.Sample
:
중략
:
g++ -o SampleComp Sample.o MyServiceSkel.o YourServiceStub.o MyServiceSVC_impl.o SampleComp.o `rtm-config --libs`
> ls
Makefile.Sample README.Sample Sample_vc9.sln
MyService.hh Sample.cpp Sample_vc9.vcproj
MyService.idl Sample.h YourService.hh
MyServiceDynSK.cc Sample.o YourService.idl
MyServiceSK.cc Sample.so YourServiceDynSK.cc
MyServiceSVC_impl.cpp Sample.yaml YourServiceSK.cc
MyServiceSVC_impl.h SampleComp YourServiceSkel.cpp
MyServiceSVC_impl.o SampleComp.cpp YourServiceSkel.h
MyServiceSkel.cpp SampleComp.o YourServiceStub.cpp
MyServiceSkel.h SampleComp_vc8.vcproj YourServiceStub.h
MyServiceSkel.o SampleComp_vc9.vcproj YourServiceStub.o
MyServiceStub.cpp Sample_vc8.sln copyprops.bat
MyServiceStub.h Sample_vc8.vcproj user_config.vsprops이것으로 loadable module판의 컴포넌트(Sample.so)와 실행 형식의 컴포넌트(SampleComp)가 작성되었습니다.
작성된 실행 형식의 컴포넌트를 실행해 보겠습니다. 먼저 그 준비를 합니다. 처음으로 CORBA 의 네임 서비스를 기동합니다. CORBA 의 네임 서비스는,
> rtm-naming [포트 번호]
로 기동할 수 있기 때문에 8.에서 작성하는 rtc.conf로 설정하는 포트 번호를 지정해 기동해 주십시오. 아무것도 지정하지 않으면 디폴트 포트(2809)를 사용합니다. 여기에서는 디폴트 포트를 사용하는 예를 들고 있습니다.
> rtm-naming Starting omniORB omniNames: rtm:2809 n-ando@rtm:/tmp/SampleComponent> Fri Apr 27 03:53:09 2007: Starting omniNames for the first time. Wrote initial log file. Read log file successfully. Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000060000000010102000e0000003135302e32392e39362e31363900611e0b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100 Checkpointing Phase 1: Prepare. Checkpointing Phase 2: Commit. Checkpointing completed.
$ rtm-naming Starting omniORB omniNames: localhost.localdomain: omniORB: Error: Unable to create an endpoint of this description: giop:tcp::2809 Failed to initialise the POAs. Is omniNames already running? $
이것은 해당 포트를 사용한 네임서버가 이미 기동하고 있는 것을 나타내고 있습니다. 이 경우는 그대로 다음의 7.에 진행되어 괜찮습니다.
다음에 컴포넌트를 조작하기 위한 GUI 툴:RtcLink를 기동합니다(RtcLink에 대한 자세한 것은RtcLink 를, 또 인스톨 방법 등은RtcLink·RtcTemplate의 인스톨을 참조해 주십시오).
corba.nameservers: localhost naming.formats: %n.rtc logger.log_level: PARANOID
*NOTES: corba.nameservers: rtm.or.jp:2809 (와)과 같이 corba.nameservers: 에는 호스트명 혹은 IP주소와 포토 번호(rtm.or.jp 는 호스트명, 2809는 포토 번호)를 줄 수 있습니다.
마지막으로, 컴포넌트를 기동합니다.
> ./SampleComp -f rtc.conf
혹은
> ./SampleComp (디폴트로 현재 디렉토리의 rtc.conf를 읽어들인다)
※이후의 설명은 편의상 OpenRTM-aist-0.4.0에 대해 쓰여져 있습니다. OpenRTM-aist-0.4.x에 대해서도 같은 순서로 인스톨 할 수 있습니다.
프로그램 메뉴에 등록되어 있는 샘플 프로그램은 디폴트로 로컬 호스트의 CORBA 네임서버를 사용하도록 설정되어 있습니다. 따라서, 다음의 어느 방법(인스톨 방법에 의해 다소 차이가 생깁니다)으로 우선 CORBA 네임서버를 기동할 필요가 있습니다.
| ConsoleInComp.exe | 콘솔로부터 입력된 수치를 OutPort로부터 출력한다. ConsoleOutComp.exe와 연결해 사용 |
| ConsoleOutComp.exe | InPort에 입력된 수치를 콘솔에 표시하는 컴포넌트. ConsoleInComp.exe와 연결해 사용 |
| SequenceInComp.exe | 랜덤인 수치(Short,Long,Float,Double과 그 순서형)을 출력하는 컴포넌트. SequenceOutComp.exe와 연결해 사용 |
| SequenceOutComp.exe | InPort에 입력되는 수치(Short,Long,Float,Double와 그 순서형)을 표시. SequenceInComp.exe와 연결해 사용 |
| MyServiceProviderComp.exe | MyService형의 서비스를 제공하는 컴포넌트. MyServiceConsumerComp.exe와 연결해 사용 |
| MyServiceConsumerComp.exe | MyService형의 서비스를 제공하는 컴포넌트. MyServiceProviderComp.exe와 연결해 사용 |
| ConfigSampleComp.exe | Configuration의 샘플. RtcLink로부터 Configuration를 변경해 Configuration의 거동을 이해하기 위한 샘플. |
| USBCameraAcquireComp.exe | USB 카메라로부터 화상을 취득해 OutPort로부터 출력하는 default 컴포넌트. USBCameraMonitor.exe와 연결해 사용 |
| USBCameraMonitor.exe | InPort에 입력되는 화상을 화면에 표시하는 컴포넌트. USBCameraAquire.exe와 연결해 사용 |
> rtc-template.py --help
Usage: rtc-template [OPTIONS]
Options:
[-h] Print short help.
[--help] Print details help.
[--backend[=backend] or -b] Specify template code generator.
[--module-name[=name]] Your module name.
[--module-desc[=description]] Module description.
[--module-version[=version]] Module version.
[--module-vendor[=vendor]] Module vendor.
[--module-category[=category]] Module category.
[--module-comp-type[=component_type]] Component type.
[--module-act-type[=activity_type]] Component's activity type.
[--module-max-inst[=max_instance]] Number of maximum instance.
[--module-lang[=language]] Language.
[--config[=ParamName:Type:Default]] Configuration variable.
[--inport[=PortName:Type]] InPort's name and type.
[--outport[=PortName:Type]] OutPort's name and type
[--service[=PortName:Name:Type]] Service Provider Port
[--service-idl[=IDL_file]] IDL file name for service
[--consumer[=PortName:Name:Type]] Service Consumer Port
[--consumer-idl[=IDL_file]] IDL file name for consumer
[--idl-include=[path]] Search path for IDL compile
:
중략
:
Example:
rtc-template -bcxx --module-name=Sample --module-desc='Sample component' --module-version=0.1 --module-vendor=AIST --module-category=Generic --module-comp-type=DataFlowComponent --module-act-type=SPORADIC --module-max-inst=10 --config=int_param0:int:0 --config=int_param1:int:1 --config=double_param0:double:3.14 --config=double_param1:double:9.99 --config="str_param0:std::string:hoge" --config="str_param1:std::string:foo" --inport=Ref:TimedFloat --inport=Sens:TimedFloat --outport=Ctrl:TimedDouble --outport=Monitor:TimedShort --service=MySvcPort:myservice0:MyService --consumer=YourSvcPort:yourservice0:YourService --service-idl=MyService.idl --consumer-idl=YourService.idlrtc-template에 대해서 작성하고 싶은 컴포넌트의 설정을 인수로서 건네주면, 컴포넌트의 양식을 작성합니다. 여기에서는 help의 표시의 마지막에 표시된Example:이하의 서비스 포트에 관한 기술 이외를 복사하고 시험해 보겠습니다.
※ Windows환경에서 CUI판의 rtc-template를 실행하는 경우, 서비스 포트에 관한 옵션은 사용할 수 없습니다.
※ Windows판 컴포넌트에서 서비스 포트를 사용하고 싶은 경우는 UNIX 환경에서 rtc-template를 실행 후에 Windows상의 컴파일러에서 컴포넌트를 빌드하거나, Eclipse판 RtcTemplate를 이용해 코드의 양식을 생성해 주십시오. Eclipse판 RtcTemplate에서는 Windows상에서도 서비스 포트를 가지는 컴포넌트의 양식을 생성하는 것이 가능해지고 있습니다.
커멘드 prompt로부터 커멘드 입력을 실시하는 일도 할 수 있습니다만, 이번은 이하와 같은 배치파일(gen.bat)을 임의의 폴더에 작성해 봅니다. NOTES: OpenRTM-aist-0.4.2에서는 -bvcproject 옵션은 불필요해졌습니다.
@echo off rtc-template.py -bcxx^ --module-name=Sample --module-desc="Sample component"^ --module-version=0.1 --module-vendor=AIST --module-category=Generic^ --module-comp-type=DataFlowComponent --module-act-type=SPORADIC^ --module-max-inst=10^ --config=int_param0:int:0 --config=int_param1:int:1^ --config=double_param0:double:3.14 --config=double_param1:double:9.99^ --config="str_param0:std::string:hoge"^ --config="str_param1:std::string:foo"^ --inport=Ref:TimedFloat --inport=Sens:TimedFloat^ --outport=Ctrl:TimedDouble --outport=Monitor:TimedShort pause
배치파일을 실행하면, 이하와 같은 메세지가 표시된 DOS창이 열려, 컴포넌트의 C++의 코드, VC++용 프로젝트 파일이 작성(OpenRTM-aist-0.4.2의 경우).
File "Sample.h" was generated. File "Sample.cpp" was generated. File "SampleComp.cpp" was generated. File "Makefile.Sample" was generated. File "SampleComp_vc8.vcproj" was generated. File "Sample_vc8.vcproj" was generated. File "SampleComp_vc9.vcproj" was generated. File "Sample_vc9.vcproj" was generated. File "Sample_vc8.sln" was generated. File "Sample_vc9.sln" was generated. File "copyprops.bat" was generated. File "user_config.vsprops" was generated. File "README.Sample" was generated. File "Sample.yaml" was generated. 계속하려면 아무 키나 눌러 주세요 . . .
copyprops.bat라고 하는 배치파일이 작업 폴더내에 생성되고 이것을 실행합니다.
>copyprops.bat
copy "(RTM_ROOT) \etc\rtm_config.vsprops" .
1 개의 파일을 복사했습니다.>copyprops.bat copy "(RTM_ROOT) \etc\rtm_config.vsprops" . 지정된 파일이 발견되지 않습니다.
여기서, Sample_vc8.sln(개발 환경이 VC2005의 경우)를, 혹은 Sample_vc9.sln(같이 VC2008의 경우)를 더블 클릭 하면 Visual Studio 등의 개발 환경이 기동됩니다. 「솔루션의 리빌드」를 실시하는 것으로 실행 형식의 컴포넌트SampleComp.exe가 작성됩니다(통상은 작업 폴더\SampleComp\Debug에 작성됩니다).
※프로젝트를 빌드하기 위해서는 Visual Studio 등의 VC++개발 환경이 인스톨 되어 있어야 합니다. VC++개발 환경의 인스톨에 대해서는 Windows계 시스템으로의 빌드 를 참조해 주십시오.
SampleComp.exe 의 동작을 확인하려면 , 이하의 순서를 따릅니다.
corba.nameservers: localhost naming.formats: %n.rtc
→ 참고: 샘플의 실행
$tar zxvf ORBexpressST.tar.gz
$ cd ./OIS/ORBexpress/ST_2.6.1/host/x86_linux_9.0/bin/ $ ./INSTALL_LICENSE
I have the authority to bind the Customer to this agreement. (Y/N) I have read and understand this agreement. (Y/N) I hereby agree to all of the terms of this agreement on behalf of the Customer. (Y/N) I additionally agree to personally honor the restrictions set forth in this agreement. (Y/N)
Enter your ORBexpress RT_2.4.0 License Key 05957······
$cd /usr/lib $su #ln -s libstdc++-libc6.2-2.so.3 libstdc++-libc6.1-1.so.2 #exit
# unzip p3006854_9204_LINUX.zip
Archive: p3006854_9204_LINUX.zip
creating: 3006854/
inflating: 3006854/rhel3_pre_install.sh
inflating: 3006854/README.txt
# cd 3006854
# sh rhel3_pre_install.sh
Applying patch...
Patch successfully applied
#Error occurred during initialization of VM Unable to load native library:/home/openrtm/OIS/ORBexpress/ST_2.6.1/host/x86_linux_9.0/jre-1.3.1/lib/i386/libjava.so: symbol__libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference
$./idl2cpp -help Usage is: idl2cpp [-help | options] input-file -a Generate typecodes & type Any support for user-defined IDL types [default=false] -bm Generate MSVC++ V6 and prior bug-compatible code (not for V7 and later) [default=false] -bo Generate g++ 2.7 bug-compatible code [default=false] -d<sym> Define pre-processor symbol <sym> -ea Generate servant to require only impls with _env arg [default=true] -ee Generate servant to allow impls both with and without _env arg [default=false] -ex Generate servant to require only impls without _env arg [default=false] -fi<n> Set formatting indent to <n> spaces [default=4] -fm<n> Set formatting margin to column <n> [default=80] -fh<ext> Set C++ header file extension to <ext> [default=h] -fx<ext> Set C++ source file extension to <ext> [default=cxx] -i<dir> Search <dir> for #included files -m Map IDL modules to C++ namespaces [default=false] -n Generate code for #included files [default=false] -pl Use POA policies on local invocations [default=false] -q Don't generate model _impl files [default=false] -r Generate client code only, implies -q [default=false] -s Syntax and semantic check only [default=false] -ts<size> Allocate temporaries larger than size on heap instead of stack [default=1000000] -u<sym> Undefine pre-processor symbol <sym> -v Print version number and license info -help Print this message $
우선 소스 코드 OpenRTM-aist-0.4.x-ORBexpress.tar.gz zip를 적당한 디렉토리에 전개합니다.
$tar xvzf OpenRTM-aist-0.4.x-ORBexpress.tar.gz $cd OpenRTM-aist-0.4.x-ORBexpress
OpenRTM-aist는 패키지의 빌드에 autoconf, automake를 사용하고 있습니다. 빌드의 방법은 다른 autoconf, automake를 사용한 패키지와 같은 방법으로 실시합니다. ./configure에게 주는 옵션에 ORBexpress를 인스톨 한 디렉토리를 지정합니다. 이하는, ORBexpress를 /home/openrtm/의 아래에 전개했을 경우의 것입니다.
$./configure --with-orbexpress=/home/openrtm/OIS/ORBexpress/ST_2.6.1
※디렉토리는 /OIS/ORBexpress/ST_2.6.1 까지 지정.
그 외 사용 가능한 옵션은
$./configure --help
configure가 정상적으로 종료한 것을 확인해 주십시오. 정상적으로 종료하면 make 합니다.
$make
인스톨 하기 위해서는 적어도
OpenRTM-aist-0.4.x-ORBexpress/rtm OpenRTM-aist-0.4.x-ORBexpress/rtm/idl OpenRTM-aist-0.4.x-ORBexpress/util/rtm-config OpenRTM-aist-0.4.x-ORBexpress/util/rtm-naming OpenRTM-aist-0.4.x-ORBexpress/util/rtc-template
이하의 디렉토리가 정상적으로 빌드 되고 있을 필요가 있습니다. 빌드가 정상적으로 종료되면 헤더 파일, 라이브러리, 유틸리티 커멘드군을 인스톨 합니다.
$su #make install
인스톨이 정상적으로 종료하면, 부속 샘플로 동작 테스트를 합니다. 샘플은,{prefix}* /share/OpenRTM-aist/examples에 있습니다(다만, 스스로 빌드·인스톨 했을 경우는 인스톨 디렉토리 이하의 /examples/<샘플 컴포넌트 세트명>에 있습니다). 샘플 컴포넌트 세트 SimpleIO를 사용하고, 샘플 컴포넌트와 OpenRTM-aist의 동작을 확인합니다.
{prefix}*: 통상은 Linux 라면 /usr 그 이외에서는 /usr/local인 경우가 대부분입니다.
샘플 컴포넌트 세트 SimpleIO:
RT 컴포넌트 ConsoleInComp, ConsoleOutComp와 이것들의 통신을 접속하는 ConnectorComp로 된 샘플 세트입니다. 이 세트는 ConsoleInComp에게 준 수치를 ConsoleOutComp에 표시시키는 「가장 간단한 I/O 데몬스트레이션」을 목적으로 한 샘플입니다. ConsoleInComp로부터 ConsoleOutComp에 접속해, 그 통신을 개시시키는 것이 ConnectorComp의 역할입니다.
◆ 편의상 샘플은 usr/share/OpenRTM-aist/examples 이하에 있는 것으로서 설명을 기술합니다.
$ rtm-naming 2809 tarting omniORB omniNames: localhost.localdomain:9876 $ Wed Jun 4 23:03:09 2008: Starting omniNames for the first time. Wrote initial log file. Read log file successfully. Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000001000000000000006400000001010200100000003139322e3136382e3130302e32333600942600000b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100 Checkpointing Phase 1: Prepare. Checkpointing Phase 2: Commit. Checkpointing completed.
*패스는{prefix} /bin/rtm-naming. 대부분, which rtm-naming 로 검색할 수 있습니다.
corba.nameservers:iiop:1.0@orbexpress:2809 corba.id:oeORB naming.formats: %n.rtc logger.log_level: PARANOID
corba.nameservers:iiop:1.0@orbexpress:2809 corba.endpoint:orbexpress:5012 corba.id:oeORB naming.formats: %n.rtc logger.log_level: PARANOID
corba.nameservers:iiop:1.0@orbexpress:2809 corba.endpoint:orbexpress:5013 corba.id:oeORB naming.formats: %n.rtc logger.log_level: PARANOID
$cd /usr/share/OpenRTM-aist/examples/SimpleIO $./gen_conf.sh
$/usr/share/OpenRTM-aist/examples/ConsoleInComp -f ~/RTCwork/rtcconin.conf [ manager: _orbexpress_31210: Server available [null class] / orbexpress_31210 ] [ manager: _orbexpress_31210: Configuration: tcp://orbexpress:5012 ] [ manager: _orbexpress_31210: NEW CONNECTION to 'tcp://orbexpress:2809' ] Creating a component: "ConsoleIn"....succeed. ================================================= Component Profile ------------------------------------------------- InstanceID: ConsoleIn0 Implementation: ConsoleIn Description: Console input component Version: 1.0 Maker: Noriaki Ando, AIST Category: example Other properties ================================================= ================================================= Port0 (name): out ------------------------------------------------- - properties - port.port_type: DataOutPort dataport.data_type: TimedLong dataport.interface_type: CORBA_Any dataport.dataflow_type: Push, Pull dataport.subscription_type: Flush, New, Periodic -------------------------------------------------
스스로 빌드·인스톨 했을 경우는, {인스톨 디렉토리}/examples/SimpleIO/로 이동하고 나서
${인스톨 디렉토리}/examples/SimpleIO/
$./ConsoleInComp -f rtcconin.conf그리고 ConsoleInComp를 기동합니다.
$/usr/share/OpenRTM-aist/examples/ConsoleOutComp -f ~/RTCwork/rtcconout.conf $./ConsoleOutComp -f rtcconout.conf [ manager: _orbexpress_31242: Server available [null class] / orbexpress_31242 ] [ manager: _orbexpress_31242: Configuration: tcp://orbexpress:5013 ] [ manager: _orbexpress_31242: NEW CONNECTION to 'tcp://orbexpress:2809' ] succeed. ================================================= Component Profile ------------------------------------------------- InstanceID: ConsoleOut0 Implementation: ConsoleOut Description: Console output component Version: 1.0 Maker: Noriaki Ando, AIST Category: example Other properties ================================================= ================================================= Port0 (name): in ------------------------------------------------- - properties - port.port_type: DataInPort dataport.data_type: TimedLong dataport.interface_type: CORBA_Any dataport.dataflow_type: Push, Pull dataport.subscription_type: Any -------------------------------------------------
자신이 빌드·인스톨 했을 경우는, {인스톨 디렉토리}/examples/SimpleIO/로 이동하고 나서
${인스톨 디렉토리}/examples/SimpleIO/
$./ConsoleOutComp -f rtcconout.conf$/usr/share/OpenRTM-aist/examples/ConnectorComp Subscription Type: [ : _orbexpress_32078: NEW CONNECTION to 'tcp://localhost:2809' ] [ : _orbexpress_32078: NEW CONNECTION to 'tcp://orbexpress:5012' ] [ : _orbexpress_32078: NEW CONNECTION to 'tcp://orbexpress:5013' ] Connector ID: 26123142-0000-2000-0100-000c29123441 dataport.interface_type: CORBA_Any dataport.dataflow_type: Push dataport.subscription_type: dataport.corba_any.outport_ref: not a string value dataport.corba_any.inport_ref: not a string value
스스로 빌드·인스톨 했을 경우는, {인스톨 디렉토리}/examples/SimpleIO/로 이동하고 나서
$cd {인스톨 디렉토리}/examples/SimpleIO/
$./ConnectorCompPlease input number:
컴포넌트의 템플릿 제네레이터를 사용하여 간단한 컴포넌트를 작성하는 테스트를 합니다. 템플릿 제네레이터(rtc-template)를 사용합니다.
> cd > mkdir SampleComponent > cd SampleComponent
> rtc-template --help
Usage: rtc-template [OPTIONS]
Options:
[-h] Print short help.
[--help] Print details help.
[--backend[=backend] or -b] Specify template code generator.
[--module-name[=name]] Your module name.
[--module-desc[=description]] Module description.
[--module-version[=version]] Module version.
[--module-vendor[=vendor]] Module vendor.
[--module-category[=category]] Module category.
[--module-comp-type[=component_type]] Component type.
[--module-act-type[=activity_type]] Component's activity type.
[--module-max-inst[=max_instance]] Number of maximum instance.
[--module-lang[=language]] Language.
[--config[=ParamName:Type:Default]] Configuration variable.
[--inport[=PortName:Type]] InPort's name and type.
[--outport[=PortName:Type]] OutPort's name and type
[--service[=PortName:Name:Type]] Service Provider Port
[--service-idl[=IDL_file]] IDL file name for service
[--consumer[=PortName:Name:Type]] Service Consumer Port
[--consumer-idl[=IDL_file]] IDL file name for consumer
[--idl-include=[path]] Search path for IDL compile
:
중략
:
Example:
rtc-template -bcxx --module-name=Sample --module-desc='Sample component' --module-version=0.1 --module-vendor=AIST --module-category=Generic --module-comp-type=DataFlowComponent --module-act-type=SPORADIC --module-max-inst=10 --config=int_param0:int:0 --config=int_param1:int:1 --config=double_param0:double:3.14 --config=double_param1:double:9.99 --config="str_param0:std::string:hoge" --config="str_param1:std::string:foo" --inport=Ref:TimedFloat --inport=Sens:TimedFloat --outport=Ctrl:TimedDouble --outport=Monitor:TimedShort --service=MySvcPort:myservice0:MyService --consumer=YourSvcPort:yourservice0:YourService --service-idl=MyService.idl --consumer-idl=YourService.idl interface MyService
{
void echo();
}; interface YourService
{
void echo();
};> rtc-template -bcxx --module-name=Sample --module-desc='Sample component' --module-version=0.1 --module-vendor=AIST --module-category=Generic --module-comp-type=DataFlowComponent --module-act-type=SPORADIC --module-max-inst=10 --config=int_param0:int:0 --config=int_param1:int:1 --config=double_param0:double:3.14 --config=double_param1:double:9.99 --config="str_param0:std::string:hoge" --config="str_param1:std::string:foo" --inport=Ref:TimedFloat --inport=Sens:TimedFloat --outport=Ctrl:TimedDouble --outport=Monitor:TimedShort --service=MySvcPort:myservice0:MyService --consumer=YourSvcPort:yourservice0:YourService --service-idl=MyService.idl --consumer-idl=YourService.idl File "MyServiceSVC_impl.h" was generated. File "MyServiceSVC_impl.cpp" was generated. File "Sample.h" was generated. File "Sample.cpp" was generated. File "SampleComp.cpp" was generated. File "Makefile.Sample" was generated. File "SampleComp_vc8.vcproj" was generated. File "Sample_vc8.vcproj" was generated. File "SampleComp_vc9.vcproj" was generated. File "Sample_vc9.vcproj" was generated. File "Sample_vc8.sln" was generated. File "Sample_vc9.sln" was generated. File "copyprops.bat" was generated. File "user_config.vsprops" was generated. File "README.Sample" was generated. File "Sample.yaml" was generated. > ls Makefile.Sample Sample.h Sample_vc8.vcproj MyService.idl Sample.yaml Sample_vc9.sln MyServiceSVC_impl.cpp SampleComp.cpp Sample_vc9.vcproj MyServiceSVC_impl.h SampleComp_vc8.vcproj YourService.idl README.Sample SampleComp_vc9.vcproj copyprops.bat Sample.cpp Sample_vc8.sln user_config.vsprops
> make -f Makefile.Sample 혹은 > mv Makefile.Sample Makefile > make
> make -f Makefile.Sample
:
중략
:
g++ -o SampleComp Sample.o MyServiceSkel.o YourServiceStub.o MyServiceSVC_impl.o SampleComp.o `rtm-config --libs`
> ls
Makefile.Sample README.Sample Sample_vc9.sln
MyService.hh Sample.cpp Sample_vc9.vcproj
MyService.idl Sample.h YourService.hh
MyServiceDynSK.cc Sample.o YourService.idl
MyServiceSK.cc Sample.so YourServiceDynSK.cc
MyServiceSVC_impl.cpp Sample.yaml YourServiceSK.cc
MyServiceSVC_impl.h SampleComp YourServiceSkel.cpp
MyServiceSVC_impl.o SampleComp.cpp YourServiceSkel.h
MyServiceSkel.cpp SampleComp.o YourServiceStub.cpp
MyServiceSkel.h SampleComp_vc8.vcproj YourServiceStub.h
MyServiceSkel.o SampleComp_vc9.vcproj YourServiceStub.o
MyServiceStub.cpp Sample_vc8.sln copyprops.bat
MyServiceStub.h Sample_vc8.vcproj user_config.vsprops> rtm-naming [포트 번호]
> rtm-naming Starting omniORB omniNames: rtm:2809 n-ando@rtm:/tmp/SampleComponent> Fri Apr 27 03:53:09 2007: Starting omniNames for the first time. Wrote initial log file. Read log file successfully. Root context is IOR:010000002b00000049444c3a6f6d672e6f72672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e300000010000000000000060000000010102000e0000003135302e32392e39362e31363900611e0b0000004e616d6553657276696365000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100 Checkpointing Phase 1: Prepare. Checkpointing Phase 2: Commit. Checkpointing completed.
$ rtm-naming Starting omniORB omniNames: localhost.localdomain: omniORB: Error: Unable to create an endpoint of this description: giop:tcp::2809 Failed to initialise the POAs. Is omniNames already running? $
corba.nameservers:iiop:1.0@orbexpress:2809 corba.endpoint:orbexpress:5010 corba.id:oeORB naming.formats: %n.rtc logger.log_level: PARANOID
corba.nameservers: rtm.or.jp:2809
> ./SampleComp -f rtc.conf 혹은 > ./SampleComp (디폴트로 커런트 디렉토리의 rtc.conf를 읽어들인다)
2008/6/20 片見