[openrtm-users 00850] Re: SimpleIO の run.sh のエラー

Masayuki Shimizu masayuki.shimizu @ aist.go.jp
2009年 6月 25日 (木) 19:56:22 JST


産総研 栗原様

ご対応ありがとうございます。
ご教示頂いた方法でポート接続ができました。

# ポート接続を自作プログラムで行っている
場合は、プログラムの変更が必要そうですね。
そのためにも、0.4.2と1.0.0のバージョン判別を
できる方法が必須かと思います。

静岡大 清水

--- kurihara shinji <shinji.kurihara @ aist.go.jp> wrote:

> 静岡大学 清水様
> 
> お世話になっております。
> 産総研 栗原です。
> 
> ご指摘のエラーに関してですが、SimpleIO/ConnectorComp.cpp
の
> バグが原因でした。
> 
> 具体的には、下記の3点の修正が必要です。
>
 ・"Flush","New","Periodic"を全て小文字の"new","flush","periodic"
>   に変更。
> 
>  ・"dataport.interface_type"の"CORBA_Any"を"corba_cdr"
に変更。
> 
>  ・"dataport.push_interval"を"dataport.push_rate"に変
更。
> 
>
修正したものを添付させて頂いておりますので、examples/SimpleIO/
> ConnectorComp.cppと置き換えてご使用ください。
> 
> ご迷惑をお掛けしまして大変申し訳ございません。
> 
> 
> 以上、宜しくお願い致します。
> 
> 
> 
> 
> On Wed, 24 Jun 2009 13:35:25 +0900 (JST)
> Masayuki Shimizu <masayuki.shimizu @ aist.go.jp>
> wrote:
> 
> > OpenRTM-aist開発者の皆様
> > 
> > 1.0.0-RC1のexample/SimpleIOの
> > run.shを起動すると、
> > lt-ConnectorComp: ConnectorComp.cpp:129 int
> main(int,
> > char**): Assertion 'ret == RTC::RTC_OK' failed.
> > というエラーが出ます。
> > ポートのconnectがエラーとなっているようですが、
> >
> トレースが面倒なので、このような症状の経験があれば、
> > 原因とその対処法を教えてください。
> > 
> > 使用環境は、Fedora Core 5, omniORB-4.1.2です。
> > ダウンロードしたOpenRTM-aist-1.0.0-RC1を
> > $ ./configure --prefix=/usr
> > $ make
> > とした後、example/SimpleIO内で
> > $ sh run.sh
> > をしただけで、他には手を加えてません。
> > 
> > なお、現在のシステムには0.4.2がインストールされて
> > いるため、1.0.0はインストールせずに使ってます。
> > RtcLinkも0.4.2のままなので、
> > RtcLink等からのポート接続は試してません。
> > 
> > #
> ところで、0.4.2と1.0.0の共存は出来るのでしょうか?
> > もし可能であれば、方法を教えて頂けると助かります。
> > (RTCヘッダファイル、ライブラリ、RtcLink等)
> > 
> > 以上、よろしくお願いいたします。
> > 
> > 静岡大 清水
> > 
> > --------------------
> > Masayuki Shimizu
> > Assistant Professor
> > Dept. of Mechanical Engineering, Shizuoka Univ.
> > 3-5-1, Johoku, Naka-ku, Hamamatsu 432-8561, JAPAN
> > TEL/FAX: +81-53-478-1061
> > Email: tmsimiz @ ipc.shizuoka.ac.jp
> > 
> 
> 
> -- 
> ----------
> 栗原 眞二 <shinji.kurihara @ aist.go.jp>
> 
> 独立行政法人産業技術総合研究所
>   知能システム研究部門 統合知能研究グループ
>   〒305-8568
>   茨城県つくば市梅園1-1-1 中央第2
> 
>   TEL: 029-861-5956
> > // -*- C++ -*-
> /*!
>  * @file ConnectorComp.cpp
>  * @brief connector application
>  * @date $Date: 2008-01-13 07:24:08 $
>  *
>  * Copyright (c) 2003-2007 Noriaki Ando
> <n-ando @ aist.go.jp>
>  *          Task-intelligence Research Group,
>  *          Intelligent System Research Institute,
>  *          National Institute of Industrial Science
> (AIST), Japan
>  *          All rights reserved.
>  *
>  * $Id: ConnectorComp.cpp 778 2008-07-29 04:59:25Z
> n-ando $
>  */
> 
> #include <iostream>
> #include <vector>
> #include <string>
> #include <rtm/CorbaNaming.h>
> #include <rtm/RTObject.h>
> #include <rtm/NVUtil.h>
> #include <rtm/CORBA_SeqUtil.h>
> #include <rtm/CorbaConsumer.h>
> #include <assert.h>
> 
> 
> using namespace RTC;
> 
> void usage()
> {
>   std::cout << std::endl;
>   std::cout << "usage: ConnectorComp [options]" <<
> std::endl;
>   std::cout << std::endl;
>   std::cout << "  --flush         ";
>   std::cout << ": Set subscription type flush" <<
> std::endl;
>   std::cout << "  --new           ";
>   std::cout << ": Set subscription type new" <<
> std::endl;
>   std::cout << "  --periodic [Hz] ";
>   std::cout << ": Set subscription type periodic" <<
> std::endl;	
>   std::cout << std::endl;
> }
> 
> int main (int argc, char** argv)
> {
>   int _argc(0);
>   char** _argv(0);
> 
>   std::string subs_type;
>   std::string period;
>   for (int i = 1; i < argc; ++i)
>     {
>       std::string arg(argv[i]);
>       if (arg == "--flush")         subs_type =
> "flush";
>       else if (arg == "--new")      subs_type =
> "new";
>       else if (arg == "--periodic")
> 	{
> 	  subs_type = "periodic";
> 	  if (++i < argc) period = argv[i];
> 	  else            period = "1.0";
> 	}
>       else if (arg == "--help")
> 	{
> 	  usage();
> 	  exit(1);
> 	}
>       else
> 	{
> 	  subs_type = "flush";
> 	}
>     }
>   
>   std::cout << "Subscription Type: " << subs_type <<
> std::endl;
>   if (period != "")
>     std::cout << "Period: " << period << " [Hz]" <<
> std::endl;
> 
> 
>   CORBA::ORB_var orb = CORBA::ORB_init(_argc,
> _argv);
>   CorbaNaming naming(orb, "localhost:9876");
> 
>   CorbaConsumer<RTObject> conin, conout;
>   PortServiceList_var pin;
>   PortServiceList_var pout;
> 
>   // find ConsoleIn0 component
>   conin.setObject(naming.resolve("ConsoleIn0.rtc"));
> 
>   // get ports
>   pin = conin->get_ports();
>   pin[(CORBA::ULong)0]->disconnect_all();
>   assert(pin->length() > 0);
>   // activate ConsoleIn0
>   ExecutionContextList_var eclisti;
>   eclisti = conin->get_owned_contexts();
>  
>
eclisti[(CORBA::ULong)0]->activate_component(RTObject::_duplicate(conin._ptr()));
> 
>   // find ConsoleOut0 component
>  
> conout.setObject(naming.resolve("ConsoleOut0.rtc"));
>   // get ports
>   pout = conout->get_ports();
>   pout[(CORBA::ULong)0]->disconnect_all();
>   assert(pout->length() > 0);
>   // activate ConsoleOut0
>   ExecutionContextList_var eclisto;
>   eclisto = conout->get_owned_contexts();
>  
>
eclisto[(CORBA::ULong)0]->activate_component(RTObject::_duplicate(conout._ptr()));
> 
>   // connect ports
>   ConnectorProfile prof;
>   prof.connector_id = "";
>   prof.name = CORBA::string_dup("connector0");
>   prof.ports.length(2);
>   prof.ports[0] = pin[(CORBA::ULong)0];
>   prof.ports[1] = pout[(CORBA::ULong)0];
>   CORBA_SeqUtil::push_back(prof.properties,
> 			   NVUtil::newNV("dataport.interface_type",
> 					 "corba_cdr"));
>   CORBA_SeqUtil::push_back(prof.properties,
> 			   NVUtil::newNV("dataport.dataflow_type",
> 					 "Push"));
>   CORBA_SeqUtil::push_back(prof.properties,
> 			   NVUtil::newNV("dataport.subscription_type",
> 					 subs_type.c_str()));
>   if (period != "")
>   CORBA_SeqUtil::push_back(prof.properties,
> 			   //			  
> NVUtil::newNV("dataport.push_interval",
> 			   NVUtil::newNV("dataport.push_rate",
> 					 period.c_str()));
>   ReturnCode_t ret;
>   ret = pin[(CORBA::ULong)0]->connect(prof);
>   assert(ret == RTC::RTC_OK);
> 
>   std::cout << "Connector ID: " << prof.connector_id
> << std::endl;
>   NVUtil::dump(prof.properties);
> 
>   orb->destroy();
>   exit(1);
> }
> 
> 




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