[openrtm-users 00018] Re: RTコンポーネントの過渡状態のアクティビティオペレーションについて

Noriaki Ando n-ando @ aist.go.jp
2005年 8月 26日 (金) 13:52:22 JST


ルメア様

コメントありがとうございます。

> I basically agree with what you wrote, however, I have one question and one
> comment concerning the MyMobileRobot interface :
> 
> > MyMobileRobot.idl (ロボットサービスのインターフェースを定義する)
> > ------------------------------------------------------------
> > #include "RTCService.idl"
> >
> > interface MyMobileRobot
> > {
> >   void set_mode(int mode);
> >   void brake(bool mode);
> >   float get_battery_level();
> > };
> 
> Question : Why do you have to include RTCService.idl, Is it the base
> interface of MyMobileRobot ?

すみません。間違えました。

#include "RTCService.idl"

interface MyMobileRobot
 : RTCService
{
  void set_mode(int mode);
  void brake(bool mode);
  float get_battery_level();
};

MyMobileRobot は RTCService を継承します。

RTCServiceは以下のようになっています。

interface RTCService
{
  attribute RTCServiceProfile profile;
};

ちなみに、RTCServiceProfile は以下のとおりです。
struct RTCServiceProfile
{
  string name;
  string interfaceType;
  string idlDefinition;
  NVList properties;
  RTCService serviceRef;
};

ここで、RTCServiceProfile を RTCService に持たせるかどうか少し迷ったのですが、
RT-Middleware ではコンポーネントにできるだけ自分自身の情報を持たせて、
それ自身で完結するようにする方針を採っているので、その方針に従って
プロファイルをサービス自身に持たせました。

> Comment : In the case of the get_battery_level method, I would recommend to
> use an OutPort instead because I am sure that in some application, you will
> need the push capability of the OutPort to let other component know as soon
> as possible that the Batteries are flat.
> In general, I think that as far as access to data is concerned, you should
> always use the OutPort (even if it's a bit heavier) because you never know
> how the component will be used in the future.

たしかに、バッテリーに関してはOutPortのほうがよかったかもしれません。
何をインターフェースにして、何をOutPortやInPortにするかの判断は
むずかしいですね。
これは、あくまで実装側に任されているので、インターフェースや
フレームワークレベルでユーザに強要することはできません。
何かガイドライン的なものを示せるといいのですが。

          安藤慶昭@独立行政法人産業技術総合研究所 研究員
                    知能システム研究部門 タスクインテリジェンス研究グループ
                    〒305-8568 茨城県つくば市梅園1-1-1 中央第2
                    TEL: 029-861-5981 FAX: 029-861-5971
                    n-ando @ aist.go.jp, n-ando @ ieee.org



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