[openrtm-users 00176] Re: Return type for two components. OmniORB.

Ando Noriaki n-ando @ aist.go.jp
2007年 8月 6日 (月) 10:39:13 JST


Hello

> I have a WAVE Component that plays *.Wav file and another component caller
> component that uses WAVE component via  service port.
>
> Interface is looks like below.
>
> Interface WavePlayer{
>
> void playWaveFile(string filename);
> }
>
>
> When I start my Caller Comp and WaveComp in 2 different terminals,
> playWaveFile plays in the the terminal where Wave Comp started.
>
> I want payWaveFile to be played in CallerComp's terminal.

You mean you want get .wav file in CallerComp's node?

> In order to do so, I think I need to return a value for playWaveFile. But
> omniORB doesn't have such feature.
>
> Is there any other way, I can do it??????????????????????

If you want to send ".wav" file to player component from caller
component, you can give ".wav" file data as an argument like this.

typedef sequence<octet> FileData;
interface WavePlayer
{
  void playWaveFile(in FileData data);
};


and call this operations in caller component like this,

FileData data;
data.length( set_length_of_the_wav_file );

for (int i(0); i < length_of_the_wav_file; ++i)
{
  data[i] = // copy wav file data
  // you can also use memcpy() to copy data, because
  // CORBA sequence data area is continuously allocated.
}

wavplayer->playWaveFile(data);


-- 
安藤慶昭@独立行政法人産業技術総合研究所 研究員
                   知能システム研究部門 タスクインテリジェンス研究グループ
                   〒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 メーリングリストの案内