[openrtm-users 00639] Re: OprnRTM-0.4.2でIDLファイルを追加できない。

yosuke enomoto blitzunddonnert @ gmail.com
2008年 10月 20日 (月) 11:46:59 JST


榎本です.

Linux環境下では、rtc-templete-0.4.2において、「標準以外のデータ型をInPort/OutPortで使うには」を行いますと、
生成されるソースファイルに足りない部分があり、makeに失敗する現象が起きています.
しかしながら、rtc-templete-0.4.1で生成したソースファイルであれば、makeする事ができます.

そこで、ソースファイル群の差分をとり調べたところ、ver0.4.2で生成したファイル群のうち。
(RTC名).hとMakefile.(RTC名)に以下の部分について書き加える事でmakeに成功したしました.

1. (RTC名).hに #include "(IDL名)Stub.h" を書き加える。
2. Makefile.(RTC名)の27行目を SKEL_OBJ = を下記に書き換える。
	SKEL_OBJ =  (IDL名)Stub.o
3.Makefile.(RTC名)の58行目以降に下記を書き加える.
	(IDL名)Stub.cpp : (IDL名).idl
		$(IDLC) $(IDLFLAGS) (IDL名).idl
		$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=(IDL名).idl
	(IDL名)Stub.h : (IDL名).idl
		$(IDLC) $(IDLFLAGS) (IDL名).idl
		$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=(IDL名).idl
4.Makefile.(RTC名)の62行目の(RTC名).o: (RTC名).hを下記に書き換える.
	(RTC名).o: (RTC名).h  (IDL名)Stub.h
5.Makefile.(RTC名)の最終行に下記を書き加える。
	(IDL名)Stub.o: (IDL名)Stub.cpp (IDL名)Stub.h

参考資料として、rtc-templete-0.4.2で生成したファイル群(0.4.1_files.tar.gz
)・rtc-templete-0.4.1で生成したファイル群(0.4.2_files.tar.gz)・rtc-templete-0.4.2で生成したファイルに書き加えたもの(0.4.2_change_files.tar.gz)を添付します.
添付いたしますファイル群では(RTC名)=ConsoleIn、(IDL名)=TimedImageとします。

宜しくお願い致します.

2008/07/17 14:26 Masaharu Shimizu <shimi @ furo.org>:
> 未来ロボット技術研究センターの清水です。
>
> Ubuntu 7.10+OpenRTM-0.4.2でも下記引用と同様の現象が発生しております。
>
> ちなみに、
> 0.4.1のrtc-templateから作成されたソースは0.4.2においてコンパイルできました。
>
> 以上、宜しく御願いいたします。
>
> yosuke enomoto さんは書きました:
>> 榎本です。
>>
>> http://www.is.aist.go.jp/rt/OpenRTM-aist/html/FAQ2FRTE382B3E383B3E3839DE383BCE3838DE383B3E38388E4BD9CE68890.html#vfed5000
>> のページの「標準以外のデータ型をInPort/OutPortで使うには」を参考に
>> generator.sh,TimedImage.idl(ファイルを添付します)を作成し,
>> # sh generator.sh
>> # make -f Makefile.ConsoleIn
>> を実行してみたところ、
>> Fedora8+OpenRTM-0.4.2の環境ではmakeの時以下のようなエラーが出てしまいます.
>>
>> # make -f Makefile.ConsoleIn
>> rm -f ConsoleIn.o
>> g++ `rtm-config --cflags` -I. -c -o ConsoleIn.o ConsoleIn.cpp
>> ConsoleIn.h:97: error: 'TimedImage' does not name a type
>> ConsoleIn.h:98: error: 'TimedImage' was not declared in this scope
>> ConsoleIn.h:98: error: template argument 1 is invalid
>> ConsoleIn.cpp: In constructor 'ConsoleIn::ConsoleIn(RTC::Manager*)':
>> ConsoleIn.cpp:32: error: 'm_out' was not declared in this scope
>> ConsoleIn.cpp:32: error: member initializer expression list treated as
>> compound expression
>> ConsoleIn.cpp:41: error: no matching function for call to
>> 'ConsoleIn::registerOutPort(const char [4], int&)'
>> make: *** [ConsoleIn.o] エラー 1
>>
>> しかしながら、Fedora7+OpenRTM-0.4.1の環境ではエラーが発生せず,makeが通すことができました.
>>
>> OpenRTM-0.4.2にてIDLを付けた際にrtc-templateが作るファイルが
>> 0.4.1とは少し違っているようです。
>>
>> 宜しくお願い致します。
>>
>
>
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: 0.4.1_files.tar.gz
型:         application/x-gzip
サイズ:     3905 バイト
説明:       無し
URL:        <http://www.openrtm.org/pipermail/openrtm-users/attachments/20081020/418043f9/attachment-0003.bin>
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: 0.4.2_change_files.tar.gz
型:         application/x-gzip
サイズ:     7219 バイト
説明:       無し
URL:        <http://www.openrtm.org/pipermail/openrtm-users/attachments/20081020/418043f9/attachment-0004.bin>
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: 0.4.2_files.tar.gz
型:         application/x-gzip
サイズ:     7187 バイト
説明:       無し
URL:        <http://www.openrtm.org/pipermail/openrtm-users/attachments/20081020/418043f9/attachment-0005.bin>


openrtm-users メーリングリストの案内