[openrtm-users 01161] Re: Clean-up of OpenRTM application
kurihara shinji
shinji.kurihara @ aist.go.jp
2010年 3月 12日 (金) 11:39:25 JST
Hello,
I am going to resend it now because I forgot to attach the patch file. (Manager.cpp.diff)
Regards,
Shinji Kurihara
On Wed, 10 Mar 2010 14:14:21 +0900
kurihara shinji <shinji.kurihara @ aist.go.jp> wrote:
> Hello,
>
> Please try to apply the patch attached to the mailing list "[openrtm-users 01149]".
> or
> Please check out the source of the latest version from the following repositories.
>
> http://openrtp.jp/openrtm/svn/OpenRTM-aist/branches/RELENG_1_0/OpenRTM-aist
>
>
> Regards,
> Shinji Kurihara
>
> On Mon, 08 Mar 2010 18:04:32 +0100
> Steffen Wittmeier <steffen.wittmeier @ in.tum.de> wrote:
>
> > Hi,
> >
> > I am building a robot simulator application based on OpenRTM components
> > (so that the simulator can smoothly be integrated with the real robot
> > which also uses RTCs).
> >
> > The simulator GUI is using Qt and the main window as well as the
> > individual widgets are derived from QMainWindow and QWidget,
> > respectively, as well as from RTC::DataFlowComponentBase. Hence, every
> > widget is a RTC and a GUI widget at the same time.
> >
> > This approach works quite well and I can even delete individual
> > widgets/RTC at run-time by catching the widget close event and calling
> > exit() on the component.
> >
> > However, I am having troubles with cleaning-up the application on
> > closing. I am always getting the following error:
> >
> > terminate called after throwing an instance of 'omni_thread_fatal'
> > Aborted
> >
> > What would be the right way of destructing the RTCs? I already updated
> > to OpenRTM 1.0 as the destructors were not called when I used OpenRTM 0.42.
> >
> > Any help is appreciated...
> >
> >
> > Here's a snapshot of the code that I am using:
> > int
> > main(int argc, char** argv)
> > {
> > RTC::Manager* manager;
> > manager = RTC::Manager::init(argc, argv);
> >
> > // Initialize manager
> > manager->init(argc, argv);
> >
> > // Set module initialization procedure
> > // that's where I create the basic components of the GUI
> > // (MainWindow, Model, Controller, LogManager)
> > manager->setModuleInitProc(createComponents);
> >
> > // Activate manager and register to naming service
> > manager->activateManager();
> >
> > // run the manager in non-blocking mode
> > manager->runManager(true);
> >
> > // Qt main loop
> > application.exec();
> >
> > // when the main loop exits, clean up components
> > // compMainWindow, compEcceosController, etc. are handles
> > // to the component, they are of type RTC::RtcBase*
> > if (compMainWindow != 0)
> > {
> > std::cout << "Exiting main window" << std::endl;
> > compMainWindow->exit();
> > }
> >
> > if (compEcceosController != 0)
> > {
> > std::cout << "Exiting controller" << std::endl;
> > compEcceosController->exit();
> > }
> >
> > if (compEcceosModel != 0)
> > {
> > std::cout << "Exiting model" << std::endl;
> > compEcceosModel->exit();
> > }
> >
> > if (compLogManager != 0)
> > {
> > std::cout << "Exiting log manager" << std::endl;
> > //compLogManager->exit();
> > }
> >
> > manager->terminate();
> >
> > return 0;
> > }
> >
>
>
> --
> ----------
> 栗原 眞二 <shinji.kurihara @ aist.go.jp>
>
> 独立行政法人産業技術総合研究所
> 知能システム研究部門 統合知能研究グループ
> 〒305-8568
> 茨城県つくば市梅園1-1-1 中央第2
>
> TEL: 029-861-5956
>
--
----------
栗原 眞二 <shinji.kurihara @ aist.go.jp>
独立行政法人産業技術総合研究所
知能システム研究部門 統合知能研究グループ
〒305-8568
茨城県つくば市梅園1-1-1 中央第2
TEL: 029-861-5956
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: Manager.cpp.diff
型: text/x-diff
サイズ: 2288 バイト
説明: 無し
URL: <http://www.openrtm.org/pipermail/openrtm-users/attachments/20100312/7a9cf661/attachment-0001.diff>
openrtm-users メーリングリストの案内