Project

General

Profile

機能 #3653

[FSM4RTC] HRTMのラッパーライブラリを作成する。

Added by n-ando over 4 years ago. Updated almost 4 years ago.

Status:
終了
Priority:
通常
Assignee:
Start date:
10/07/2016
Due date:
% Done:

100%

Estimated time:

Description

HRTM付属のサンプルコンポーネントがコンパイルできるように、libHRTMに相当するライブラリをlibRTCで実装する。

クリップボード02.png (20.1 KB) クリップボード02.png n-ando, 10/14/2016 10:06 AM
2178

Associated revisions

Revision 2763 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,2.0] Some dummy headers have been added for HRTM porting. refs #3653

Revision 2765 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,2.0] libRTC wrapper lib for libHRTM has been implemented. It still has some bugs. refs #3653

Revision 2770 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,2.0,win32] libHRTM source and build proj file prepared for win32. refs #3653

Revision 2770 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,2.0,win32] libHRTM source and build proj file prepared for win32. refs #3653

Revision 2772 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,2.0,win32] libHRTM source and build proj file prepared for win32. refs #3653

Revision 2772 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,2.0,win32] libHRTM source and build proj file prepared for win32. refs #3653

Revision 2783 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,bugfix] Manager/ComponentManager initialization bug has been fixed. refs #3653

Revision 2783 (diff)
Added by n-ando over 4 years ago

[FSM4RTC,bugfix] Manager/ComponentManager initialization bug has been fixed. refs #3653

Revision 3113 (diff)
Added by n-ando about 3 years ago

merged changes from branches/FSM4RTC/OpenRTM-aist r2763:
[FSM4RTC,HRTM,->RELENG_2_0] Some dummy headers have been added for HRTM porting. refs #3653
[FSM4RTC,HRTM,->RELENG_2_0] Fsm example code from hrtm has been added for HRTM porting. refs #3655
[FSM4RTC,HRTM,->RELENG_2_0] libRTC wrapper lib for libHRTM has been implemented. It still has some bugs. refs #3653
[FSM4RTC,HRTM,->RELENG_2_0] Fsm component build complete, but it still has some bugs. refs #3655
[FSM4RTC,compat,->RELENG_2_0] Ignore Makefile and Makefile.in
[FSM4RTC,compat,->RELENG_2_0] ignore Makefile and Makefile.in
[FSM4RTC,compat,->RELENG_2_0] ignore Makefile and Makefile.in

Revision 3113 (diff)
Added by n-ando about 3 years ago

merged changes from branches/FSM4RTC/OpenRTM-aist r2763:
[FSM4RTC,HRTM,->RELENG_2_0] Some dummy headers have been added for HRTM porting. refs #3653
[FSM4RTC,HRTM,->RELENG_2_0] Fsm example code from hrtm has been added for HRTM porting. refs #3655
[FSM4RTC,HRTM,->RELENG_2_0] libRTC wrapper lib for libHRTM has been implemented. It still has some bugs. refs #3653
[FSM4RTC,HRTM,->RELENG_2_0] Fsm component build complete, but it still has some bugs. refs #3655
[FSM4RTC,compat,->RELENG_2_0] Ignore Makefile and Makefile.in
[FSM4RTC,compat,->RELENG_2_0] ignore Makefile and Makefile.in
[FSM4RTC,compat,->RELENG_2_0] ignore Makefile and Makefile.in

Revision 3114 (diff)
Added by n-ando about 3 years ago

merged changes from branches/FSM4RTC/OpenRTM-aist r2770, Makefile.ams confliction resolved:
[FSM4RTC,win32,->RELENG_2_0] libHRTM source and build proj file prepared for win32. refs #3653
[FSM4RTC,win32,->RELENG_2_0] Fsm example win32 proj file prepared. refs #3655
[FSM4RTC,win32,->RELENG_2_0] libHRTM source and build proj file prepared for win32. refs #3653

Revision 3114 (diff)
Added by n-ando about 3 years ago

merged changes from branches/FSM4RTC/OpenRTM-aist r2770, Makefile.ams confliction resolved:
[FSM4RTC,win32,->RELENG_2_0] libHRTM source and build proj file prepared for win32. refs #3653
[FSM4RTC,win32,->RELENG_2_0] Fsm example win32 proj file prepared. refs #3655
[FSM4RTC,win32,->RELENG_2_0] libHRTM source and build proj file prepared for win32. refs #3653

Revision 3115 (diff)
Added by n-ando about 3 years ago

merged changes from branches/FSM4RTC/OpenRTM-aist r2773, no confliction:
[FSM4RTC,compat,->RELENG_2_0] Some Makefile.am bugs are fixed.
[FSM4RTC,HRTM,bugfix,->RELENG_2_0] Manager/ComponentManager initialization bug has been fixed. refs #3653
[FSM4RTC,->RELENG_2_0] FSM action listener added. refs #3680
[FSM4RTC,incompat,->RELENG_2_0] renameed FsmStructureAction->FsmStructure, FsmProfileListener added. refs #3680
[FSM4RTC,incompat,->RELENG_2_0] FSM listeners add/remove operations are added to RTObject. refs #3681
[FSM4RTC,ext,example,->RELENG_2_0] Now component observer is connected to the FSM state change operation. refs #3591
[FSM4RTC,HRTM,,->RELENG_2_0] updateFsmStatus now calls RTObject::onFsmStateChanged(). refs #3681
[compat,formatting,->RELENG_1_2,->RELENG_2_0] Braces added.
[incompat,->RELENG_1_2,->RELENG_2_0] std::ostream operations have been added to NVUtil.

Revision 3115 (diff)
Added by n-ando about 3 years ago

merged changes from branches/FSM4RTC/OpenRTM-aist r2773, no confliction:
[FSM4RTC,compat,->RELENG_2_0] Some Makefile.am bugs are fixed.
[FSM4RTC,HRTM,bugfix,->RELENG_2_0] Manager/ComponentManager initialization bug has been fixed. refs #3653
[FSM4RTC,->RELENG_2_0] FSM action listener added. refs #3680
[FSM4RTC,incompat,->RELENG_2_0] renameed FsmStructureAction->FsmStructure, FsmProfileListener added. refs #3680
[FSM4RTC,incompat,->RELENG_2_0] FSM listeners add/remove operations are added to RTObject. refs #3681
[FSM4RTC,ext,example,->RELENG_2_0] Now component observer is connected to the FSM state change operation. refs #3591
[FSM4RTC,HRTM,,->RELENG_2_0] updateFsmStatus now calls RTObject::onFsmStateChanged(). refs #3681
[compat,formatting,->RELENG_1_2,->RELENG_2_0] Braces added.
[incompat,->RELENG_1_2,->RELENG_2_0] std::ostream operations have been added to NVUtil.

History

#1 Updated by n-ando over 4 years ago

  • % Done changed from 0 to 30

以下のファイルを追加

  • component_manager.h
  • data_flow_component.h
  • defs.h
  • in_port.h
  • logger.h
  • out_port.h
  • properties.h
  • statechart.h
  • utils.h
  • version.h
  • component_manager.cpp
  • data_flow_component.cpp
  • logger.cpp
  • properties.cpp
  • statechart.cpp

#2 Updated by n-ando over 4 years ago

Fsmが落ちる問題→2回初期化が行われている?

Oct 06 22:20:07.539 TRACE: manager: Manager::initORB()
Oct 06 22:20:07.543 TRACE: manager: Manager::initNaming()
Oct 06 22:20:07.557 TRACE: manager: Manager::initFactories()
Oct 06 22:20:07.559 TRACE: manager: Manager::registerFactory(PeriodicECSharedComposite)
Oct 06 22:20:07.559 TRACE: manager: Manager::initExecContext()
Oct 06 22:20:07.559 TRACE: manager: Manager::initComposite()
Oct 06 22:20:07.559 TRACE: manager: Manager::initManagerServant()
2回目
Oct 06 22:20:07.564 TRACE: manager: Manager::initORB()
Oct 06 22:20:07.564 TRACE: manager: Manager::initNaming()
Oct 06 22:20:07.568 TRACE: manager: Manager::initFactories()
Oct 06 22:20:07.568 TRACE: manager: Manager::registerFactory(PeriodicECSharedComposite)
Oct 06 22:20:07.568 TRACE: manager: Manager::initExecContext()
Oct 06 22:20:07.568 TRACE: manager: Manager::initComposite()
Oct 06 22:20:07.568 TRACE: manager: Manager::initManagerServant()
ここまで
Oct 06 22:20:07.569 TRACE: manager: Manager::initLocalService()
Oct 06 22:20:07.569 TRACE: manager: Manager::activateManager()
Oct 06 22:20:07.569 TRACE: manager: Manager::registerFactory(Fsm)

#3 Updated by n-ando over 4 years ago

  • Status changed from 新規 to 担当
  • % Done changed from 30 to 60

ComponentManager 初期化処理の変更

ComponentManagerの初期化処理を変更。ComponentManagerの初期化関数 instance() 内で static 変数 RTC::Manager::manager に ComponentManager のsingleton インスタンスへのポインタを代入。RTC::Manager の二重初期化を回避したことで、ほぼFsmCompが動くようになった。

--- hrtm/component_manager.cpp  (リビジョン 2768)
+++ hrtm/component_manager.cpp  (作業コピー)
@@ -56,6 +56,7 @@
   }
   ComponentManager& ComponentManager::instance(int argc, char** argv)
   {
+
     // DCL for singleton
     if (!manager)
       {
@@ -63,6 +64,8 @@
         if (!manager)
           {
             manager = new ComponentManager();
+            RTC::Manager::manager = manager;
+            printf("init ComponentManager: %x\n", manager);
             manager->initManager(argc, argv);
             manager->initLogger();
             manager->initORB();

h.2 ログの比較

FsmComp と ConsoleOutComp のログの先頭部分を比較。
時間はdiffを取るときに邪魔なので削除済み。
コンポーネント名やコンフィグの違い以外は、処理順序に違いなしなので、Manager初期化問題は解決とする。

--- consout_clean.log   2016-10-13 22:14:44.358732000 +0900
+++ fsm_clean.log       2016-10-13 22:14:57.642732000 +0900
@@ -15,7 +15,7 @@
   - instance_name: manager
   - name: manager
   - naming_formats: %h.host_cxt/%n.mgr
-  - pid: 27892
+  - pid: 27776
   - refstring_path: /var/log/rtcmanager.ref
   - modules
     - load_path: ./
@@ -56,7 +56,7 @@
   - hostname: ubuntu1404
 - logger
   - enable: YES
-  - file_name: ./rtc27892.log
+  - file_name: fsm.log
   - date_format: %b %d %H:%M:%S.%Q
   - log_level: PARANOID
   - stream_lock: NO
@@ -68,7 +68,7 @@
 - naming
   - enable: YES
   - type: corba
-  - formats: %h.host_cxt/%n.rtc
+  - formats: %n.rtc
   - update
     - enable: YES
     - interval: 10.0
@@ -86,7 +86,7 @@
 - exec_cxt
   - periodic
     - type: PeriodicExecutionContext
-    - rate: 1000
+    - rate: 1.0
   - sync_transition: YES
   - transition_timeout: 0.5
 - sdo
@@ -95,13 +95,12 @@
       - enabled_service: ALL
     - consumer
       - enabled_service: ALL
-- example
-  - ConsoleOut
-    - config_file: consout.conf
-  - ConsoleIn
-    - config_file: consin.conf
-  - ConfigSample
-    - config_file: configsample.conf
+- logging
+  - loggers
+    - root
+      - level: trace
+    - HRTM
+      - level: trace
 - config_file: ./rtc.conf

 ESC[0mESC[32mOct 13 DEBUG: manager: ESC[0mcorba.endpoint:
@@ -142,11 +141,11 @@
 ESC[0mESC[32mOct 13 DEBUG: manager: ESC[0m- enabled_services: ALL
 - modules:

-ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mManager::registerFactory(ConsoleOut)
-ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mManager::createComponent(ConsoleOut)
+ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mManager::registerFactory(Fsm)
+ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mManager::createComponent(Fsm)
 ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mRTC basic propfile vendor:
 ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mRTC basic propfile category:
-ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mRTC basic propfile implementation_id: ConsoleOut
+ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mRTC basic propfile implementation_id: Fsm
 ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mRTC basic propfile version:
 ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mManager::getORB()
 ESC[0mESC[36mOct 13 TRACE: manager: ESC[0mManager::getPOA()

#4 Updated by n-ando over 4 years ago

FsmCompのactivate/deactivateをRTSystemEditorで行うと、「エラーが発生しました」とのダイアログが出る。
FsmComp自体は正常にactivate/deactivateされる。

#5 Updated by n-ando over 4 years ago

  • File クリップボード02.png added
  • Status changed from 担当 to 解決
  • % Done changed from 60 to 100

FsmCompのECの周期が1.0に設定されていたため、RTSystemEditorのタイムアウトに引っかかった模様。
設定でRT Name Service View でタイムアウト待ち時間を2000ms程度にすると、エラーは出なくなった。
まずは、FsmCompが動くようになったので、本件はこれにて終了とする。

#6 Updated by n-ando over 4 years ago

  • File deleted (クリップボード02.png)

#8 Updated by n-ando almost 4 years ago

  • Status changed from 解決 to 終了

Also available in: Atom PDF