[openrtm-commit:00744] r2334 - in trunk/OpenRTM-aist: . src/ext/ec/artlinux src/ext/ec/artlinux/example
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 3月 4日 (日) 23:59:22 JST
Author: n-ando
Date: 2012-03-04 23:59:21 +0900 (Sun, 04 Mar 2012)
New Revision: 2334
Added:
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.cpp
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.h
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.yaml
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSampleComp.cpp
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.ARTSample
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.am
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/README.ARTSample
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf
trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf1
Modified:
trunk/OpenRTM-aist/configure.ac
trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.cpp
trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.h
trunk/OpenRTM-aist/src/ext/ec/artlinux/Makefile.am
Log:
Now ARTLinux EC has been moved to new ECBase based EC.
Modified: trunk/OpenRTM-aist/configure.ac
===================================================================
--- trunk/OpenRTM-aist/configure.ac 2012-02-22 08:26:23 UTC (rev 2333)
+++ trunk/OpenRTM-aist/configure.ac 2012-03-04 14:59:21 UTC (rev 2334)
@@ -1459,7 +1459,8 @@
fi
AC_DEFINE([ARTLINUX], [TRUE], [ARTLinux is avaiable])
ARTLINUX="artlinux"
- ARTLIB="$art_syscalls_o_dir/art_syscalls.o"
+ PATH_NORM($art_syscalls_o_dir/art_syscalls.o)
+ ARTLIB=$n_path
echo 'RTM is compiled with ARTLinux'
fi
fi
@@ -1692,6 +1693,7 @@
src/ext/Makefile
src/ext/ec/Makefile
src/ext/ec/artlinux/Makefile
+ src/ext/ec/artlinux/example/Makefile
src/ext/ec/rtpreempt/Makefile
src/ext/ec/logical_time/Makefile
src/ext/ec/logical_time/example/Makefile
Modified: trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.cpp
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.cpp 2012-02-22 08:26:23 UTC (rev 2333)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.cpp 2012-03-04 14:59:21 UTC (rev 2334)
@@ -2,75 +2,658 @@
/*!
* @file ArtExecutionContext.cpp
* @brief ArtExecutionContext class
- * @date $Date$
+ * @date $Date: 2008-01-14 07:53:01 $
* @author Noriaki Ando <n-ando at aist.go.jp>
*
- * Copyright (C) 2007
- * Task-intelligence Research Group,
+ * Copyright (C) 2006-2008,2012
+ * Noriaki Ando
* Intelligent Systems Research Institute,
* National Institute of
* Advanced Industrial Science and Technology (AIST), Japan
* All rights reserved.
*
- * $Id$
+ * $Id: ArtExecutionContext.cpp 2307 2012-02-05 21:29:15Z n-ando $
*
*/
-/*
- * $Log$
- */
-
-#include "ArtExecutionContext.h"
-#include <rtm/ECFactory.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <time.h>
+#include <sched.h>
+#include <sys/mman.h>
#include <linux/art_task.h>
+#include <algorithm>
#include <iostream>
-namespace RTC
+#include <coil/Time.h>
+#include <coil/TimeValue.h>
+
+#include <rtm/RTObjectStateMachine.h>
+#include <ArtExecutionContext.h>
+
+#define MAX_SAFE_STACK (8*1024)
+#define NSEC_PER_SEC 1000000000
+#define DEEFAULT_PERIOD 0.000001
+
+namespace RTC_exp
{
- ArtExecutionContext::ArtExecutionContext()
- : PeriodicExecutionContext()
+ /*!
+ * @if jp
+ * @brief デフォルトコンストラクタ
+ * @else
+ * @brief Default constructor
+ * @endif
+ */
+ ArtExecutionContext::
+ ArtExecutionContext()
+ : ExecutionContextBase("artlinux_ec"),
+ rtclog("artlinux_ec"),
+ m_svc(false), m_nowait(false)
{
+ RTC_TRACE(("ArtExecutionContext()"));
+
+ // getting my reference
+ setObjRef(this->_this());
+
+ // profile initialization
+ setKind(RTC::PERIODIC);
+ setRate(1.0 / (double)DEEFAULT_PERIOD);
+
+ RTC_DEBUG(("Actual period: %d [sec], %d [usec]",
+ m_profile.getPeriod().sec(), m_profile.getPeriod().usec()));
}
+ /*!
+ * @if jp
+ * @brief デストラクタ
+ * @else
+ * @brief Destructor
+ * @endif
+ */
ArtExecutionContext::~ArtExecutionContext()
{
+ RTC_TRACE(("~ArtExecutionContext()"));
+ {
+ Guard guard(m_svcmutex);
+ m_svc = false;
+ }
+ {
+ Guard guard(m_workerthread.mutex_);
+ m_workerthread.running_ = true;
+ m_workerthread.cond_.signal();
+ }
+ wait();
}
+ void ArtExecutionContext::init(coil::Properties& props)
+ {
+ RTC_TRACE(("init()"));
+ ExecutionContextBase::init(props);
+ setPriority(props);
+ m_currPeriod = getPeriod();
+ RTC_DEBUG(("init() done"));
+ }
+
+
+ /*------------------------------------------------------------
+ * Start activity
+ * ACE_Task class method over ride.
+ *------------------------------------------------------------*/
+ /*!
+ * @if jp
+ * @brief ExecutionContext用アクティビティスレッドを生成する
+ * @else
+ * @brief Generate internal activity thread for ExecutionContext
+ * @endif
+ */
+ int ArtExecutionContext::open(void *args)
+ {
+ RTC_TRACE(("open()"));
+ activate();
+ return 0;
+ }
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext 用のスレッド実行関数
+ * @else
+ * @brief Thread execution function for ExecutionContext
+ * @endif
+ */
int ArtExecutionContext::svc(void)
{
- int usec(m_period.sec() * 1000000 + m_period.usec());
- if (art_enter(ART_PRIO_MAX-1, ART_TASK_PERIODIC, usec) == -1)
- {
- std::cerr << "fatal error: art_enter" << std::endl;
- }
+ RTC_TRACE(("svc()"));
+ if (!prepareThread()) { return -1; }
+ m_currPeriod = getPeriod();
+
+ int count(0);
+ coil::TimeValue t0, t1, t2, t3;
do
{
- std::for_each(m_comps.begin(), m_comps.end(), invoke_worker());
- // while (!m_running) {ACE_OS::sleep(tv);}
- if (art_wait() == -1)
- {
- std::cerr << "fatal error: art_wait " << std::endl;
- }
- } while (m_running);
+ ExecutionContextBase::invokeWorkerPreDo();
+ {
+ Guard guard(m_workerthread.mutex_);
+ while (!m_workerthread.running_)
+ {
+ m_workerthread.cond_.wait();
+ }
+ }
+ if (count > 1000) { t0 = coil::gettimeofday(); }
+ ExecutionContextBase::invokeWorkerDo();
+ ExecutionContextBase::invokeWorkerPostDo();
+ if (count > 1000) { t1 = coil::gettimeofday(); }
+ changeRate(); // if period changed: art_exit() -> art_enter()
+ if (count > 1000)
+ {
+ RTC_PARANOID(("Period: %f [s]", (double)m_currPeriod));
+ RTC_PARANOID(("Execution: %f [s]", (double)(t1 - t0)));
+ RTC_PARANOID(("Sleep: %f [s]",
+ (double)(m_currPeriod - (t1 - t0))));
+ }
+ if (count > 1000) { t2 = coil::gettimeofday(); }
+ if (m_nowait)
+ {
+ if (count > 1000) { count = 0; }
+ ++count; continue;
+ }
+ if (art_wait() == -1)
+ {
+ RTC_ERROR(("fatal error: art_wait"));
+ std::cerr << "fatal error: art_wait" << std::endl;
+ }
+ if (count > 1000)
+ {
+ t3 = coil::gettimeofday();
+ RTC_PARANOID(("Slept: %f [s]", (double)(t3 - t2)));
+ count = 0;
+ }
+ ++count;
+ } while (threadRunning());
if (art_exit() == -1)
{
- std::cerr << "fatal error: art_exit" << std::endl;
+ RTC_ERROR(("Fatal error: art_exit()"));
+ std::cerr << "fatal error: art_exit" << std::endl;
}
+ RTC_DEBUG(("Thread terminated."));
return 0;
}
-};
+ /*!
+ * @if jp
+ * @brief ExecutionContext 用のスレッド実行関数
+ * @else
+ * @brief Thread execution function for ExecutionContext
+ * @endif
+ */
+ int ArtExecutionContext::close(unsigned long flags)
+ {
+ RTC_TRACE(("close()"));
+ // At this point, this component have to be finished.
+ // Current state and Next state should be RTC_EXITING.
+ return 0;
+ }
+
+ //============================================================
+ // ExecutionContext CORBA operations
+ //============================================================
+ /*!
+ * @if jp
+ * @brief ExecutionContext 実行状態確認関数
+ * @else
+ * @brief Check for ExecutionContext running state
+ * @endif
+ */
+ CORBA::Boolean ArtExecutionContext::is_running()
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::isRunning();
+ }
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行を開始
+ * @else
+ * @brief Start the ExecutionContext
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::start()
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::start();
+ }
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行を停止
+ * @else
+ * @brief Stop the ExecutionContext
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::stop()
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::stop();
+ }
+
+
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行周期(Hz)を取得する
+ * @else
+ * @brief Get execution rate(Hz) of ExecutionContext
+ * @endif
+ */
+ CORBA::Double ArtExecutionContext::get_rate()
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::getRate();
+ }
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行周期(Hz)を設定する
+ * @else
+ * @brief Set execution rate(Hz) of ExecutionContext
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::set_rate(CORBA::Double rate)
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::setRate(rate);
+ }
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントを追加する
+ * @else
+ * @brief Add an RT-Component
+ * @endif
+ */
+ RTC::ReturnCode_t
+ ArtExecutionContext::add_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::addComponent(comp);
+ }
+
+ /*!
+ * @if jp
+ * @brief コンポーネントをコンポーネントリストから削除する
+ * @else
+ * @brief Remove the RT-Component from participant list
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ remove_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::removeComponent(comp);
+ }
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントをアクティブ化する
+ * @else
+ * @brief Activate an RT-Component
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ activate_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::activateComponent(comp);
+ }
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントを非アクティブ化する
+ * @else
+ * @brief Deactivate an RT-Component
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ deactivate_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::deactivateComponent(comp);
+ }
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントをリセットする
+ * @else
+ * @brief Reset the RT-Component
+ * @endif
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ reset_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::resetComponent(comp);
+ }
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントの状態を取得する
+ * @else
+ * @brief Get RT-Component's state
+ * @endif
+ */
+ RTC::LifeCycleState ArtExecutionContext::
+ get_component_state(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException)
+ {
+ RTC::LifeCycleState ret = ExecutionContextBase::getComponentState(comp);
+ return ret;
+ }
+
+ /*!
+ * @if jp
+ * @brief ExecutionKind を取得する
+ * @else
+ * @brief Get the ExecutionKind
+ * @endif
+ */
+ RTC::ExecutionKind ArtExecutionContext::get_kind()
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::getKind();
+ }
+
+ //------------------------------------------------------------
+ // ExecutionContextService interfaces
+ //------------------------------------------------------------
+ /*!
+ * @if jp
+ * @brief ExecutionContextProfile を取得する
+ * @else
+ * @brief Get the ExecutionContextProfile
+ * @endif
+ */
+ RTC::ExecutionContextProfile* ArtExecutionContext::get_profile()
+ throw (CORBA::SystemException)
+ {
+ return ExecutionContextBase::getProfile();
+ }
+
+
+ //============================================================
+ // protected functions
+ //============================================================
+ /*!
+ * @brief onStarted() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::onStarted()
+ {
+ // change EC thread state
+ {
+ Guard guard(m_svcmutex);
+ if (!m_svc)
+ {
+ m_svc = true;
+ this->open(0);
+ }
+ }
+ if (isAllNextState(RTC::INACTIVE_STATE))
+ {
+ Guard guard(m_workerthread.mutex_);
+ m_workerthread.running_ = false;
+ }
+ else
+ {
+ Guard guard(m_workerthread.mutex_);
+ m_workerthread.running_ = true;
+ m_workerthread.cond_.signal();
+ }
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onStopping() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::onStopping()
+ {
+ // stop thread
+ Guard guard(m_workerthread.mutex_);
+ m_workerthread.running_ = false;
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onWaitingActivated() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ onWaitingActivated(RTC_impl::RTObjectStateMachine* comp, long int count)
+ {
+ RTC_TRACE(("onWaitingActivated(count = %d)", count));
+ RTC_PARANOID(("curr: %s, next: %s",
+ getStateString(comp->getStates().curr),
+ getStateString(comp->getStates().next)));
+ // Now comp's next state must be ACTIVE state
+ // If worker thread is stopped, restart worker thread.
+ Guard guard(m_workerthread.mutex_);
+ if (m_workerthread.running_ == false)
+ {
+ m_workerthread.running_ = true;
+ m_workerthread.cond_.signal();
+ }
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onActivated() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ onActivated(RTC_impl::RTObjectStateMachine* comp, long int count)
+ {
+ RTC_TRACE(("onActivated(count = %d)", count));
+ RTC_PARANOID(("curr: %s, next: %s",
+ getStateString(comp->getStates().curr),
+ getStateString(comp->getStates().next)));
+ // count = -1; Asynch mode. Since onWaitingActivated is not
+ // called, onActivated() have to send restart singnal to worker
+ // thread.
+ // count > 0: Synch mode.
+
+ // Now comp's next state must be ACTIVE state
+ // If worker thread is stopped, restart worker thread.
+ Guard guard(m_workerthread.mutex_);
+ if (m_workerthread.running_ == false)
+ {
+ m_workerthread.running_ = true;
+ m_workerthread.cond_.signal();
+ }
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onWaitingDeactivated() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ onWaitingDeactivated(RTC_impl::RTObjectStateMachine* comp, long int count)
+ {
+ RTC_TRACE(("onWaitingDeactivated(count = %d)", count));
+ RTC_PARANOID(("curr: %s, next: %s",
+ getStateString(comp->getStates().curr),
+ getStateString(comp->getStates().next)));
+ if (isAllNextState(RTC::INACTIVE_STATE))
+ {
+ Guard guard(m_workerthread.mutex_);
+ if (m_workerthread.running_ == true)
+ {
+ m_workerthread.running_ = false;
+ RTC_TRACE(("All RTCs are INACTIVE. Stopping worker thread."));
+ }
+ }
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onDeactivated() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ onDeactivated(RTC_impl::RTObjectStateMachine* comp, long int count)
+ {
+ RTC_TRACE(("onDeactivated(count = %d)", count));
+ RTC_PARANOID(("curr: %s, next: %s",
+ getStateString(comp->getStates().curr),
+ getStateString(comp->getStates().next)));
+ if (isAllNextState(RTC::INACTIVE_STATE))
+ {
+ Guard guard(m_workerthread.mutex_);
+ if (m_workerthread.running_ == true)
+ {
+ m_workerthread.running_ = false;
+ RTC_TRACE(("All RTCs are INACTIVE. Stopping worker thread."));
+ }
+ }
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onWaitingReset() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ onWaitingReset(RTC_impl::RTObjectStateMachine* comp, long int count)
+ {
+ RTC_TRACE(("onWaitingReset(count = %d)", count));
+ RTC_PARANOID(("curr: %s, next: %s",
+ getStateString(comp->getStates().curr),
+ getStateString(comp->getStates().next)));
+ if (isAllNextState(RTC::INACTIVE_STATE))
+ {
+ Guard guard(m_workerthread.mutex_);
+ if (m_workerthread.running_ == true)
+ {
+ m_workerthread.running_ = false;
+ RTC_TRACE(("All RTCs are INACTIVE. Stopping worker thread."));
+ }
+ }
+ return RTC::RTC_OK;
+ }
+
+ /*!
+ * @brief onReset() template function
+ */
+ RTC::ReturnCode_t ArtExecutionContext::
+ onReset(RTC_impl::RTObjectStateMachine* comp, long int count)
+ {
+ RTC_TRACE(("onReset(count = %d)", count));
+ RTC_PARANOID(("curr: %s, next: %s",
+ getStateString(comp->getStates().curr),
+ getStateString(comp->getStates().next)));
+ if (isAllNextState(RTC::INACTIVE_STATE))
+ {
+ Guard guard(m_workerthread.mutex_);
+ if (m_workerthread.running_ == true)
+ {
+ m_workerthread.running_ = false;
+ RTC_TRACE(("All RTCs are INACTIVE. Stopping worker thread."));
+ }
+ }
+ return RTC::RTC_OK;
+ }
+
+ //============================================================
+ // private functions
+ //============================================================
+ /*!
+ * @if jp
+ * @brief スレッドの準備
+ * @else
+ * @brief Preparing thread
+ * @endif
+ */
+ bool ArtExecutionContext::prepareThread()
+ {
+ assert(m_priority <= ART_PRIO_MAX);
+ coil::TimeValue period(getPeriod());
+ int usec_period(period.sec() * 1000000 + period.usec());
+ if (art_enter(m_priority, ART_TASK_PERIODIC, usec_period) == -1)
+ {
+ return false;
+ std::cerr << "fatal error: art_enter" << std::endl;
+ }
+ return true;
+ }
+
+ /*!
+ * @if jp
+ * @brief 優先度の設定
+ * @else
+ * @brief Setting a priority
+ * @endif
+ */
+ void ArtExecutionContext::
+ setPriority(coil::Properties& prop)
+ {
+ RTC_TRACE(("setPriority()"));
+ getProperty(prop, "priority", m_priority);
+ RTC_DEBUG(("setPriority(): priority: %d", m_priority));
+ }
+
+ /*!
+ * @if jp
+ * @brief 実行周期の変更
+ * @else
+ * @brief Changing execution rate
+ * @endif
+ */
+ bool ArtExecutionContext::changeRate()
+ {
+ coil::TimeValue next_period(getPeriod());
+ if (m_currPeriod.sec() == next_period.sec() &&
+ m_currPeriod.usec() == next_period.usec()) { return true; }
+
+ RTC_PARANOID(("Period changed."));
+ if (art_exit() == -1)
+ {
+ RTC_PARANOID(("art_exit() failed."));
+ std::cerr << "error: art_exit" << std::endl;
+ return false;
+ }
+ int new_period(next_period.sec() * 1000000 + next_period.usec());
+ if (art_enter(m_priority, ART_TASK_PERIODIC, new_period) == -1)
+ {
+ RTC_PARANOID(("art_enter() failed."));
+ std::cerr << "error: art_enter" << std::endl;
+ return false;
+ }
+ m_currPeriod = next_period;
+ return true;
+ }
+
+}; // namespace RTC
+
extern "C"
{
- void ArtExecutionContextInit(RTC::Manager* manager)
+ /*!
+ * @if jp
+ * @brief ECFactoryへの登録のための初期化関数
+ * @else
+ * @brief Initialization function to register to ECFactory
+ * @endif
+ */
+
+ void ArtExecutionContextInit(RTC::Manager* manager)
{
- RTC::Manager::instance().registerECFactory("ArtExecutionContext",
- RTC::ECCreate<RTC::ArtExecutionContext>,
- RTC::ECDelete<RTC::ArtExecutionContext>);
-
+ RTC::ExecutionContextFactory::
+ instance().addFactory("ArtExecutionContext",
+ ::coil::Creator< ::RTC::ExecutionContextBase,
+ ::RTC_exp::ArtExecutionContext>,
+ ::coil::Destructor< ::RTC::ExecutionContextBase,
+ ::RTC_exp::ArtExecutionContext>);
+ RTC::ExecutionContextFactory::
+ instance().addFactory("artlinux_ec",
+ ::coil::Creator< ::RTC::ExecutionContextBase,
+ ::RTC_exp::ArtExecutionContext>,
+ ::coil::Destructor< ::RTC::ExecutionContextBase,
+ ::RTC_exp::ArtExecutionContext>);
}
};
+
Modified: trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.h
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.h 2012-02-22 08:26:23 UTC (rev 2333)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/ArtExecutionContext.h 2012-03-04 14:59:21 UTC (rev 2334)
@@ -5,8 +5,8 @@
* @date $Date$
* @author Noriaki Ando <n-ando at aist.go.jp>
*
- * Copyright (C) 2007
- * Task-intelligence Research Group,
+ * Copyright (C) 2007,2012
+ * Noriaki Ando
* Intelligent Systems Research Institute,
* National Institute of
* Advanced Industrial Science and Technology (AIST), Japan
@@ -16,35 +16,829 @@
*
*/
-/*
- * $Log$
- */
+#ifndef RTC_ARTEXECUTIONCONTEXT_H
+#define RTC_ARTEXECUTIONCONTEXT_H
-#ifndef ArtExecutionContext_h
-#define ArtExecutionContext_h
+#include <vector>
-#include <rtm/RTC.h>
+#include <coil/Task.h>
+#include <coil/Mutex.h>
+#include <coil/Condition.h>
+#include <rtm/ExecutionContextBase.h>
-#include <rtm/Manager.h>
-#include <rtm/PeriodicExecutionContext.h>
-
-namespace RTC
+namespace RTC_exp
{
+ /*!
+ * @if jp
+ * @class ArtExecutionContext
+ * @brief ArtExecutionContext クラス
+ *
+ * RT-Preempt kernel を利用した、リアルタイム実行コンテキストクラス。
+ * この実行コンテキストは、RT-Preempt Patch を適用した Linux kernel、
+ * 又は、これが組み込まれた Linux kernel によるリアルタイムスケジュー
+ * リング機能を利用した実行コンテキストである。
+ *
+ * この実行コンテキストを利用するには、rtc.conf に下記のように記述する。
+ *
+ * <pre>
+ * execution_contexts: rtpreempt_ec
+ * ec.rtpreempt_ec.rate: 1000
+ * ec.rtpreempt_ec.priority: 50
+ * manager.modules.load_path: <RTPreemptRC.so がある場所へのパス>
+ * manager.modules.preload: ArtExecutionContext.so
+ * </pre>
+ *
+ * さらに、実行時には root 権限が必要となるので、root としてコンポー
+ * ネントを実行する必要がある。
+ *
+ * このECに特有なオプションは以下のとおりである。
+ *
+ * - ec.rtpreempt_ec.priority: (default: 49) <br>
+ * スレッドの実行優先度 1 (最低) から 99 (最高)<br>
+ * Linux sched_setscheduler(2) を参照のこと。<br>
+ *
+ * - ec.rtpreempt_ec.sched_policy: (default: fifo)<br>
+ * スケジューリングのポリシ。<br>
+ * rr: ラウンドロビン, fifo: FIFO 型 (default: fifo)<br>
+ * Linux sched_setscheduler(2) を参照のこと。<br>
+ *
+ * - ec.rtpeempt_ec.wait_offset: (default: -10000)<br>
+ * ウェイト時間のオフセット。[ns] 単位で指定する。 <br>
+ * 1周期あたり数十 us 程度の定常的な遅れが発生する場合があるので、
+ * この値を調整することで、より正確な周期で実行させることができる。
+ *
+ * 注意事項: このECを比較的速い周期 (数十ms以上) で実行させる場合は、
+ * ログレベルを DEBUG よりも下 (logger.log_level: NORMAL 等) に設定し
+ * て実行する必要がある。また、logger.enable: NO に設定されていても、
+ * logger.log_level: PARANOID に設定されている場合には、onExecute()
+ * の実行に時間がかかり、デッドラインを守れなくなる可能性があるので注
+ * 意が必要である。
+ *
+ * @since 1.0.1
+ *
+ * @else
+ * @class ArtExecutionContext
+ * @brief ArtExecutionContext クラス
+ *
+ * This class is real-time ExecutionContext which utilizes RT-Prempt
+ * kernel. This ExecutionContext is a real-time ExecutionContext
+ * which utilizes real-time scheduler functionality of "RT-Preempt"
+ * Linux kernel (patched or originally embedded).
+ *
+ * Give the following configurations in your rtc.conf to use this EC.
+ * <pre>
+ * exec_cxt.periodic.type: ArtExecutionContext
+ * exec_cxt.periodic.rate: 1000
+ * exec_cxt.priority: 50
+ * manager.modules.load_path: <path to RTPreemptRC.so>
+ * manager.modules.preload: ArtExecutionContext.so
+ * </pre>
+ *
+ * Since this functionality requires root authority, your RTC which
+ * uses this EC have to be executed as root.
+ *
+ * The following ArtExecutionContext specific options are available.
+ *
+ * - exec_cxt.periodic.priority: (default: 49)<br>
+ * - exec_cxt.periodic.rtpreempt.priority: (default: 49)<br>
+ * Execution priority of threads from 1 (lowest) to 99 (highest)<br>
+ * See Linux sched_setscheduler(2).
+ *
+ * - exec_cxt.periodic.rtpreempt.sched_policy: (default: fifo)<br>
+ * Scheduling policy.<br>
+ * rr: round-robin, fifo: FIFO type scheduling (default: fifo)<br>
+ * See Linux sched_setscheduler(2).
+ *
+ * - exec_cxt.periodic.rtpreempt.wait_offset: (default: -10000)<br>
+ * Offset time of wait. It can be given [ns] unit. <br>
+ * Adjusting this value, If dozens micro seconds delay in one
+ * execution cycle constantly, more accurate periodic execution
+ * can be achieved.
+ *
+ * NOTICE: When performing comparatively quick cycle (tens of ms or
+ * more) using this EC, log-level have to be lower than DEBUG
+ * (logger.log_level: NORMAL or etc.). Moreover, even if
+ * "logger.enable=No" is set, if "logger.log_level=PRANOID" is set,
+ * execution of onExecute() takes longer time and it may cause
+ * deadline-miss. So caution is needed.
+ *
+ * @since 1.0.1
+ *
+ * @endif
+ */
class ArtExecutionContext
- : public virtual PeriodicExecutionContext
+ : public virtual POA_RTC::ExecutionContextService,
+ public virtual PortableServer::RefCountServantBase,
+ public RTC::ExecutionContextBase,
+ public coil::Task
{
+ typedef coil::Guard<coil::Mutex> Guard;
public:
+ /*!
+ * @if jp
+ * @brief デフォルトコンストラクタ
+ *
+ * デフォルトコンストラクタ
+ * プロファイルに以下の項目を設定する。
+ * - kind : PERIODIC
+ * - rate : 0.0
+ *
+ * @else
+ * @brief Default Constructor
+ *
+ * Default Constructor
+ * Set the following items to profile.
+ * - kind : PERIODIC
+ * - rate : 0.0
+ *
+ * @endif
+ */
ArtExecutionContext();
- virtual ~ArtExecutionContext();
+
+ /*!
+ * @if jp
+ * @brief デストラクタ
+ *
+ * デストラクタ
+ *
+ * @else
+ * @brief Destructor
+ *
+ * Destructor
+ *
+ * @endif
+ */
+ virtual ~ArtExecutionContext(void);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContextの処理を進める
+ *
+ * ExecutionContextの処理を1周期分進める。
+ *
+ * @else
+ * @brief Proceed with tick of ExecutionContext
+ *
+ * Proceed with tick of ExecutionContext for one period.
+ *
+ * @endif
+ */
+ void init(coil::Properties& props);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext用アクティビティスレッドを生成する
+ *
+ * Executioncontext 用の内部アクティビティスレッドを生成し起動する。
+ * これは coil::Task サービスクラスメソッドのオーバーライド。
+ *
+ * @param args 通常は0
+ *
+ * @return 生成処理実行結果
+ *
+ * @else
+ *
+ * @brief Generate internal activity thread for ExecutionContext
+ *
+ * Generate internal activity thread and run. This is coil::Task
+ * class method's override.
+ *
+ * @param args Usually give 0
+ *
+ * @return The generation result
+ *
+ * @endif
+ */
+ virtual int open(void *args);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext 用のスレッド実行関数
+ *
+ * ExecutionContext 用のスレッド実行関数。登録されたコンポーネント
+ * の処理を呼び出す。
+ *
+ * @return 実行結果
+ *
+ * @else
+ * @brief Thread execution function for ExecutionContext
+ *
+ * Thread execution function for ExecutionContext. Invoke the
+ * registered components operation.
+ *
+ * @return The execution result
+ *
+ * @endif
+ */
virtual int svc(void);
- };
-};
+ /*!
+ * @if jp
+ * @brief ExecutionContext 用のスレッド実行関数
+ *
+ * ExecutionContext 用のスレッド終了時に呼ばれる。コンポーネントオ
+ * ブジェクトの非アクティブ化、マネージャへの通知を行う。これは
+ * coil::Task サービスクラスメソッドのオーバーライド。
+ *
+ * @param flags 終了処理フラグ
+ *
+ * @return 終了処理結果
+ *
+ * @else
+ *
+ * @brief Thread execution function for ExecutionContext
+ *
+ * This function is invoked when activity thread for
+ * ExecutionContext exits. Deactivate the component object and
+ * notify it to manager. This is coil::Task class method's
+ * override.
+ *
+ * @param flags Flag of the close
+ *
+ * @return The close result
+ *
+ * @endif
+ */
+ virtual int close(unsigned long flags);
+
+ //============================================================
+ // ExecutionContext
+ //============================================================
+ /*!
+ * @if jp
+ * @brief ExecutionContext 実行状態確認関数
+ *
+ * この操作は ExecutionContext が Runnning 状態の場合に true を返す。
+ * Executioncontext が Running の間、当該 Executioncontext に参加し
+ * ている全てのアクティブRTコンポーネントが、ExecutionContext の実
+ * 行種類に応じて実行される。
+ *
+ * @return 状態確認関数(動作中:true、停止中:false)
+ *
+ * @else
+ *
+ * @brief Check for ExecutionContext running state
+ *
+ * This operation shall return true if the context is in the
+ * Running state. While the context is Running, all Active RTCs
+ * participating in the context shall be executed according to the
+ * context’s execution kind.
+ *
+ * @return Check state function (Running:true、Stopping:false)
+ *
+ * @endif
+ */
+ virtual CORBA::Boolean is_running(void)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行を開始
+ *
+ * ExecutionContext の実行状態を Runnning とするためのリクエストを
+ * 発行する。ExecutionContext の状態が遷移すると
+ * ComponentAction::on_startup が呼び出される。参加しているRTコンポー
+ * ネントが、初期化されるまで ExecutionContext を開始することはでき
+ * ない。ExecutionContext は複数回開始/停止を繰り返すことができる。
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Start the ExecutionContext
+ *
+ * Request that the context enter the Running state. Once the
+ * state transition occurs, the ComponentAction::on_startup
+ * operation will be invoked. An execution context may not be
+ * started until the RT-Components that participate in it have
+ * been initialized. An execution context may be started and
+ * stopped multiple times.
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t start(void)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行を停止
+ *
+ * ExecutionContext の状態を Stopped とするためのリクエストを発行す
+ * る。遷移が発生した場合は、ComponentAction::on_shutdown が呼び出
+ * される。参加しているRTコンポーネントが終了する前に
+ * ExecutionContext を停止する必要がある。ExecutionContext は複数回
+ * 開始/停止を繰り返すことができる。
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Stop the ExecutionContext
+ *
+ * Request that the context enter the Stopped state. Once the
+ * transition occurs, the ComponentAction::on_shutdown operation
+ * will be invoked. An execution context must be stopped before
+ * the RT components that participate in it are finalized. An
+ * execution context may be started and stopped multiple times.
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t stop(void)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行周期(Hz)を取得する
+ *
+ * Active 状態にてRTコンポーネントが実行される周期(単位:Hz)を取得す
+ * る。
+ *
+ * @return 処理周期(単位:Hz)
+ *
+ * @else
+ *
+ * @brief Get execution rate(Hz) of ExecutionContext
+ *
+ * This operation shall return the rate (in hertz) at which its
+ * Active participating RTCs are being invoked.
+ *
+ * @return Execution cycle(Unit:Hz)
+ *
+ * @endif
+ */
+ virtual CORBA::Double get_rate(void)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext の実行周期(Hz)を設定する
+ *
+ * Active 状態にてRTコンポーネントが実行される周期(単位:Hz)を設定す
+ * る。実行周期の変更は、DataFlowComponentAction の
+ * on_rate_changed によって各RTコンポーネントに伝達される。
+ *
+ * @param rate 処理周期(単位:Hz)
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Set execution rate(Hz) of ExecutionContext
+ *
+ * This operation shall set the rate (in hertz) at which this
+ * context’s Active participating RTCs are being called. If the
+ * execution kind of the context is PERIODIC, a rate change shall
+ * result in the invocation of on_rate_changed on any RTCs
+ * realizing DataFlowComponentAction that are registered with any
+ * RTCs participating in the context.
+ *
+ * @param rate Execution cycle(Unit:Hz)
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t set_rate(CORBA::Double rate)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントをアクティブ化する
+ *
+ * Inactive 状態にあるRTコンポーネントをActive に遷移させ、アクティ
+ * ブ化する。この操作が呼ばれた結果、on_activate が呼び出される。指
+ * 定したRTコンポーネントが参加者リストに含まれない場合は、
+ * BAD_PARAMETER が返される。指定したRTコンポーネントの状態が
+ * Inactive 以外の場合は、PRECONDITION_NOT_MET が返される。
+ *
+ * @param comp アクティブ化対象RTコンポーネント
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Activate an RT-component
+ *
+ * The given participant RTC is Inactive and is therefore not
+ * being invoked according to the execution context’s execution
+ * kind. This operation shall cause the RTC to transition to the
+ * Active state such that it may subsequently be invoked in this
+ * execution context. The callback on_activate shall be called as
+ * a result of calling this operation. This operation shall not
+ * return until the callback has returned, and shall result in an
+ * error if the callback does.
+ *
+ * @param comp The target RT-Component for activation
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t
+ activate_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントを非アクティブ化する
+ *
+ * Inactive 状態にあるRTコンポーネントを非アクティブ化し、Inactive
+ * に遷移させる。この操作が呼ばれた結果、on_deactivate が呼び出され
+ * る。指定したRTコンポーネントが参加者リストに含まれない場合は、
+ * BAD_PARAMETER が返される。指定したRTコンポーネントの状態が
+ * Active 以外の場合は、PRECONDITION_NOT_MET が返される。
+ *
+ * @param comp 非アクティブ化対象RTコンポーネント
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Deactivate an RT-component
+ *
+ * The given RTC is Active in the execution context. Cause it to
+ * transition to the Inactive state such that it will not be
+ * subsequently invoked from the context unless and until it is
+ * activated again. The callback on_deactivate shall be called as
+ * a result of calling this operation. This operation shall not
+ * return until the callback has returned, and shall result in an
+ * error if the callback does.
+ *
+ * @param comp The target RT-Component for deactivate
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t
+ deactivate_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントをリセットする
+ *
+ * Error 状態のRTコンポーネントの復帰を試みる。この操作が呼ばれた結
+ * 果、on_reset が呼び出される。指定したRTコンポーネントが参加者リ
+ * ストに含まれない場合は、BAD_PARAMETER が返される。指定したRTコン
+ * ポーネントの状態が Error 以外の場合は、PRECONDITION_NOT_MET が返
+ * される。
+ *
+ * @param comp リセット対象RTコンポーネント
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Reset the RT-component
+ *
+ * Attempt to recover the RTC when it is in Error. The
+ * ComponentAction::on_reset callback shall be invoked. This
+ * operation shall not return until the callback has returned, and
+ * shall result in an error if the callback does. If possible, the
+ * RTC developer should implement that callback such that the RTC
+ * may be returned to a valid state.
+ *
+ * @param comp The target RT-Component for reset
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t
+ reset_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントの状態を取得する
+ *
+ * 指定したRTコンポーネントの状態(LifeCycleState)を取得する。指定し
+ * たRTコンポーネントが参加者リストに含まれない場合は、
+ * UNKNOWN_STATE が返される。
+ *
+ * @param comp 状態取得対象RTコンポーネント
+ *
+ * @return 現在の状態(LifeCycleState)
+ *
+ * @else
+ *
+ * @brief Get RT-component's state
+ *
+ * This operation shall report the LifeCycleState of the given
+ * participant RTC. UNKNOWN_STATE will be returned, if the given
+ * RT-Component is not inclued in the participant list.
+ *
+ * @param comp The target RT-Component to get the state
+ *
+ * @return The current state of the target RT-Component(LifeCycleState)
+ *
+ * @endif
+ */
+ virtual RTC::LifeCycleState
+ get_component_state(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief ExecutionKind を取得する
+ *
+ * 本 ExecutionContext の ExecutionKind を取得する
+ *
+ * @return ExecutionKind
+ *
+ * @else
+ *
+ * @brief Get the ExecutionKind
+ *
+ * This operation shall report the execution kind of the execution
+ * context.
+ *
+ * @return ExecutionKind
+ *
+ * @endif
+ */
+ virtual RTC::ExecutionKind get_kind(void)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントを追加する
+ *
+ * 指定したRTコンポーネントを参加者リストに追加する。追加されたRTコ
+ * ンポーネントは attach_context が呼ばれ、Inactive 状態に遷移する。
+ * 指定されたRTコンポーネントがnullの場合は、BAD_PARAMETER が返され
+ * る。指定されたRTコンポーネントが DataFlowComponent 以外の場合は、
+ * BAD_PARAMETER が返される。
+ *
+ * @param comp 追加対象RTコンポーネント
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Add an RT-component
+ *
+ * The operation causes the given RTC to begin participating in
+ * the execution context. The newly added RTC will receive a call
+ * to LightweightRTComponent::attach_context and then enter the
+ * Inactive state. BAD_PARAMETER will be invoked, if the given
+ * RT-Component is null or if the given RT-Component is other than
+ * DataFlowComponent.
+ *
+ * @param comp The target RT-Component for add
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t
+ add_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief RTコンポーネントを参加者リストから削除する
+ *
+ * 指定したRTコンポーネントを参加者リストから削除する。削除された
+ * RTコンポーネントは detach_context が呼ばれる。指定されたRTコンポー
+ * ネントが参加者リストに登録されていない場合は、BAD_PARAMETER が返
+ * される。
+ *
+ * @param comp 削除対象RTコンポーネント
+ *
+ * @return ReturnCode_t 型のリターンコード
+ *
+ * @else
+ *
+ * @brief Remove the RT-Component from participant list
+ *
+ * This operation causes a participant RTC to stop participating
+ * in the execution context. The removed RTC will receive a call
+ * to LightweightRTComponent::detach_context. BAD_PARAMETER will
+ * be returned, if the given RT-Component is not participating in
+ * the participant list.
+ *
+ * @param comp The target RT-Component for delete
+ *
+ * @return The return code of ReturnCode_t type
+ *
+ * @endif
+ */
+ virtual RTC::ReturnCode_t
+ remove_component(RTC::LightweightRTObject_ptr comp)
+ throw (CORBA::SystemException);
+
+ /*!
+ * @if jp
+ * @brief ExecutionContextProfile を取得する
+ *
+ * 本 ExecutionContext のプロファイルを取得する。
+ *
+ * @return ExecutionContextProfile
+ *
+ * @else
+ *
+ * @brief Get the ExecutionContextProfile
+ *
+ * This operation provides a profile “descriptor” for the execution
+ * context.
+ *
+ * @return ExecutionContextProfile
+ *
+ * @endif
+ */
+ virtual RTC::ExecutionContextProfile* get_profile(void)
+ throw (CORBA::SystemException);
+
+ protected:
+ /*!
+ * @brief onStarted() template function
+ */
+ virtual RTC::ReturnCode_t onStarted();
+ /*!
+ * @brief onStopping() template function
+ */
+ virtual RTC::ReturnCode_t onStopping();
+ /*!
+ * @brief onWaitingActivated() template function
+ */
+ virtual RTC::ReturnCode_t
+ onWaitingActivated(RTC_impl::RTObjectStateMachine* comp, long int count);
+ /*!
+ * @brief onActivated() template function
+ */
+ virtual RTC::ReturnCode_t
+ onActivated(RTC_impl::RTObjectStateMachine* comp, long int count);
+ /*!
+ * @brief onWaitingDeactivated() template function
+ */
+ virtual RTC::ReturnCode_t
+ onWaitingDeactivated(RTC_impl::RTObjectStateMachine* comp,
+ long int count);
+ /*!
+ * @brief onDeactivated() template function
+ */
+ virtual RTC::ReturnCode_t
+ onDeactivated(RTC_impl::RTObjectStateMachine* comp, long int count);
+ /*!
+ * @brief onWaitingReset() template function
+ */
+ virtual RTC::ReturnCode_t
+ onWaitingReset(RTC_impl::RTObjectStateMachine* comp, long int count);
+ /*!
+ * @brief onReset() template function
+ */
+ virtual RTC::ReturnCode_t
+ onReset(RTC_impl::RTObjectStateMachine* comp, long int count);
+
+ bool threadRunning()
+ {
+ Guard guard(m_svcmutex);
+ return m_svc;
+ }
+
+ /*!
+ * @if jp
+ * @brief あるキーを持つプロパティを取得する
+ *
+ * @param ExecutionContext 用のスレッド実行関数。
+ * 登録されたコンポーネントの処理を呼び出す。
+ *
+ * @return 実行結果
+ *
+ * @else
+ * @brief Thread execution function for ExecutionContext
+ *
+ * Thread execution function for ExecutionContext.
+ * Invoke the registered components operation.
+ *
+ * @return The execution result
+ *
+ * @endif
+ */
+ template <class T>
+ void getProperty(coil::Properties& prop, const char* key, T& value)
+ {
+ if (prop.findNode(key) != 0)
+ {
+ T tmp;
+ if (coil::stringTo(tmp, prop[key].c_str()))
+ {
+ value = tmp;
+ }
+ }
+ }
+
+ private:
+ /*!
+ * @if jp
+ * @brief スレッドの準備
+ * @else
+ * @brief Preparing thread
+ * @endif
+ */
+ bool prepareThread();
+ /*!
+ * @if jp
+ * @brief 優先度の設定
+ * @else
+ * @brief Setting a priority
+ * @endif
+ */
+ void setPriority(coil::Properties& prop);
+
+ /*!
+ * @if jp
+ * @brief 実行周期の変更
+ * @else
+ * @brief Changing execution rate
+ * @endif
+ */
+ bool changeRate();
+
+ protected:
+ /*!
+ * @if jp
+ * @brief ロガーストリーム
+ * @else
+ * @brief Logger stream
+ * @endif
+ */
+ RTC::Logger rtclog;
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext のスレッド実行フラグ
+ * @else
+ * @brief The thread running flag of ExecutionContext
+ * @endif
+ */
+ bool m_svc;
+ coil::Mutex m_svcmutex;
+
+ /*!
+ * @if jp
+ * @brief worker 用状態変数クラス
+ * @else
+ * @brief Condition variable class for worker
+ * @endif
+ */
+ struct WorkerThreadCtrl
+ {
+ WorkerThreadCtrl() : cond_(mutex_), running_(false) {};
+ coil::Mutex mutex_;
+ coil::Condition<coil::Mutex> cond_;
+ bool running_;
+ };
+
+ /*!
+ * @if jp
+ * @brief svn用の状態変数
+ * @else
+ * @brief A condition variable for external triggered worker
+ * @endif
+ */
+ WorkerThreadCtrl m_workerthread;
+
+ /*!
+ * @if jp
+ * @brief ExecutionContext 即時実行(wait無し実行)フラグ
+ * @else
+ * @brief Flag of ExecutionContext to run immediately
+ * (to run without waiting)
+ * @endif
+ */
+ bool m_nowait;
+
+ private:
+ int m_priority;
+ int m_policy;
+ int m_waitoffset;
+ coil::TimeValue m_currPeriod;
+ }; // class ArtExecutionContext
+}; // namespace RTC
+
+#ifdef WIN32
+#pragma warning( default : 4290 )
+#endif
+
+
extern "C"
{
+ /*!
+ * @if jp
+ * @brief ECFactoryへの登録のための初期化関数
+ * @else
+ * @brief Initialization function to register to ECFactory
+ * @endif
+ */
void ArtExecutionContextInit(RTC::Manager* manager);
};
-#endif // ArtExecutionContext_h
-
+#endif // RTC_RTPREEMPTEC_H
Modified: trunk/OpenRTM-aist/src/ext/ec/artlinux/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/Makefile.am 2012-02-22 08:26:23 UTC (rev 2333)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/Makefile.am 2012-03-04 14:59:21 UTC (rev 2334)
@@ -5,8 +5,10 @@
## $Id: Makefile.am 1429 2009-07-06 08:28:25Z hakuta $
##---------------------------------------------------------------------------
-ARTLIB = /usr/lib/art_syscalls.o
+SUBDIRS = example
+ARTLIB = @ARTLIB@
+
AM_CPPFLAGS=-I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/coil/include -I$(top_srcdir)/src/lib/rtm/idl
AM_LDFLAGS=-L$(top_builddir) -L$(top_builddir)/src/lib/rtm -L$(top_builddir)/src/lib/rtm/idl
@@ -21,7 +23,7 @@
ArtExecutionContext_la_SOURCES = ArtExecutionContext.cpp ArtExecutionContext.h
ArtExecutionContext_la_LDFLAGS = -module -shared
ArtExecutionContext_la_FLAGS = -L$(top_builddir)/src/lib/rtm/.lib
-ArtExecutionContext_la_LIBADD = $(top_builddir)/src/lib/rtm/libRTC.la
+ArtExecutionContext_la_LIBADD = $(top_builddir)/src/lib/rtm/libRTC.la $(ARTLIB)
clean:
- rm -rf *~ *.o *.so
\ No newline at end of file
+ rm -rf *~ *.o *.so
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.cpp
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.cpp (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.cpp 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,172 @@
+// -*- C++ -*-
+/*!
+ * @file ARTSample.cpp
+ * @brief Realtime periodic execution example component
+ * $Date$
+ *
+ * $Id$
+ */
+#include "ARTSample.h"
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* rtsample_spec[] =
+ {
+ "implementation_id", "ARTSample",
+ "type_name", "ARTSample",
+ "description", "Realtime periodic execution example component",
+ "version", "1.0",
+ "vendor", "Noriaki Ando, AIST",
+ "category", "example",
+ "activity_type", "PERIODIC",
+ "kind", "DataFlowComponent",
+ "max_instance", "10",
+ "language", "C++",
+ "lang_type", "compile",
+ // Configuration variables
+ ""
+ };
+// </rtc-template>
+
+ARTSample::ARTSample(RTC::Manager* manager)
+ // <rtc-template block="initializer">
+ : RTC::DataFlowComponentBase(manager)
+ // </rtc-template>
+{
+}
+
+ARTSample::~ARTSample()
+{
+}
+
+
+RTC::ReturnCode_t ARTSample::onInitialize()
+{
+ // Registration: InPort/OutPort/Service
+ // <rtc-template block="registration">
+ // Set InPort buffers
+
+ // Set OutPort buffer
+
+ // Set service provider to Ports
+
+ // Set service consumers to Ports
+
+ // Set CORBA Service Ports
+
+ // </rtc-template>
+
+ // <rtc-template block="bind_config">
+ // Bind variables and configuration variable
+
+ // </rtc-template>
+ return RTC::RTC_OK;
+}
+
+
+/*
+RTC::ReturnCode_t ARTSample::onFinalize()
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t ARTSample::onStartup(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t ARTSample::onShutdown(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+RTC::ReturnCode_t ARTSample::onActivated(RTC::UniqueId ec_id)
+{
+ m_tm.tick();
+ return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t ARTSample::onDeactivated(RTC::UniqueId ec_id)
+{
+ double tm_max, tm_min, tm_mean, tm_stddev;
+ m_tm.getStatistics(tm_max, tm_min, tm_mean, tm_stddev);
+ std::cout << "max: " << tm_max * 1000 << " [ms]" << std::endl;
+ std::cout << "min: " << tm_min * 1000 << " [ms]" << std::endl;
+ std::cout << "mean: " << tm_mean * 1000 << " [ms]" << std::endl;
+ std::cout << "stddev: " << tm_stddev * 1000 << " [ms]" << std::endl;
+ return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t ARTSample::onExecute(RTC::UniqueId ec_id)
+{
+ static int count;
+ m_tm.tack();
+ m_tm.tick();
+
+ if (count > 1000)
+ {
+ count = 0;
+ double tm_max, tm_min, tm_mean, tm_stddev;
+ m_tm.getStatistics(tm_max, tm_min, tm_mean, tm_stddev);
+ std::cout << "max: " << tm_max * 1000 << " [ms]" << std::endl;
+ std::cout << "min: " << tm_min * 1000 << " [ms]" << std::endl;
+ std::cout << "mean: " << tm_mean * 1000 << " [ms]" << std::endl;
+ std::cout << "stddev: " << tm_stddev * 1000 << " [ms]" << std::endl;
+ }
+
+ ++count;
+ return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t ARTSample::onAborting(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t ARTSample::onError(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t ARTSample::onReset(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t ARTSample::onStateUpdate(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+/*
+RTC::ReturnCode_t ARTSample::onRateChanged(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+
+extern "C"
+{
+
+ void ARTSampleInit(RTC::Manager* manager)
+ {
+ coil::Properties profile(rtsample_spec);
+ manager->registerFactory(profile,
+ RTC::Create<ARTSample>,
+ RTC::Delete<ARTSample>);
+ }
+
+};
+
+
+
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.h
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.h (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.h 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+/*!
+ * @file ARTSample.h * @brief Realtime periodic execution example component * @date $Date$
+ *
+ * $Id$
+ */
+#ifndef RTSAMPLE_H
+#define RTSAMPLE_H
+
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+
+#include <coil/TimeMeasure.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+class ARTSample : public RTC::DataFlowComponentBase
+{
+ public:
+ ARTSample(RTC::Manager* manager);
+ ~ARTSample();
+
+ // The initialize action (on CREATED->ALIVE transition)
+ // formaer rtc_init_entry()
+ virtual RTC::ReturnCode_t onInitialize();
+
+ // The finalize action (on ALIVE->END transition)
+ // formaer rtc_exiting_entry()
+ // virtual RTC::ReturnCode_t onFinalize();
+
+ // The startup action when ExecutionContext startup
+ // former rtc_starting_entry()
+ // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+ // The shutdown action when ExecutionContext stop
+ // former rtc_stopping_entry()
+ // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+ // The activated action (Active state entry action)
+ // former rtc_active_entry()
+ virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+ // The deactivated action (Active state exit action)
+ // former rtc_active_exit()
+ virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+ // The execution action that is invoked periodically
+ // former rtc_active_do()
+ virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+ // The aborting action when main logic error occurred.
+ // former rtc_aborting_entry()
+ // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+ // The error action in ERROR state
+ // former rtc_error_do()
+ // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+ // The reset action that is invoked resetting
+ // This is same but different the former rtc_init_entry()
+ // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+
+ // The state update action that is invoked after onExecute() action
+ // no corresponding operation exists in OpenRTm-aist-0.2.0
+ // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+ // The action that is invoked when execution context's rate is changed
+ // no corresponding operation exists in OpenRTm-aist-0.2.0
+ // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+ // Configuration variable declaration
+ // <rtc-template block="config_declare">
+
+ // </rtc-template>
+
+ // DataInPort declaration
+ // <rtc-template block="inport_declare">
+
+ // </rtc-template>
+
+ // DataOutPort declaration
+ // <rtc-template block="outport_declare">
+
+ // </rtc-template>
+
+ // CORBA Port declaration
+ // <rtc-template block="corbaport_declare">
+
+ // </rtc-template>
+
+ // Service declaration
+ // <rtc-template block="service_declare">
+
+ // </rtc-template>
+
+ // Consumer declaration
+ // <rtc-template block="consumer_declare">
+
+ // </rtc-template>
+
+ private:
+ coil::TimeMeasure m_tm;
+
+};
+
+
+extern "C"
+{
+ DLL_EXPORT void ARTSampleInit(RTC::Manager* manager);
+};
+
+#endif // RTSAMPLE_H
+
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.yaml
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.yaml (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSample.yaml 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,118 @@
+rtcProfile:
+ version: "1.0"
+ id: RTC:Noriaki Ando, AIST.example.RTSample:1.0
+ basicInfo:
+ name: RTSample
+ description: Realtime periodic execution example component
+ version: 1.0
+ vendor: Noriaki Ando, AIST
+ category: example
+ componentType: DataFlowComponent
+ activityType: PERIODIC
+ componentKind: DataFlowComponent
+ maxInstances: 10
+ abstract:
+ executionRate: 1000.0
+ executionType: PeriodicExecutionContext
+ creationDate:
+ year: 2010
+ month: 2
+ day: 19
+ hour: 18
+ minute: 27
+ second: 3
+ updateDate:
+ year:
+ month:
+ day:
+ hour:
+ minute:
+ second:
+ "rtcDoc::doc":
+ algorithm:
+ creator:
+ description:
+ inout:
+ license:
+ reference:
+ "rtcExt::versionUpLog":
+ language:
+ actions:
+ onInitialize:
+ implemented: True
+ "rtcDoc::doc":
+ description: onInitialize description
+ postCondition: onInitialize Post_condition
+ preCondition: onInitialize Pre_condition
+ onActivated:
+ implemented: True
+ "rtcDoc::doc":
+ description: onActivated description
+ postCondition: onActivated Post_condition
+ preCondition: onActivated Pre_condition
+ onDeactivated:
+ implemented: True
+ "rtcDoc::doc":
+ description: onDeactivated description
+ postCondition: onDeactivated Post_condition
+ preCondition: onDeactivated Pre_condition
+ onAborting:
+ implemented: True
+ "rtcDoc::doc":
+ description: onAborting description
+ postCondition: onAborting Post_condition
+ preCondition: onAborting Pre_condition
+ onError:
+ implemented: True
+ "rtcDoc::doc":
+ description: onError description
+ postCondition: onError Post_condition
+ preCondition: onError Pre_condition
+ onReset:
+ implemented: True
+ "rtcDoc::doc":
+ description: onReset description
+ postCondition: onReset Post_condition
+ preCondition: onReset Pre_condition
+ onFinalize:
+ implemented: True
+ "rtcDoc::doc":
+ description: onFinalize description
+ postCondition: onFinalize Post_condition
+ preCondition: onFinalize Pre_condition
+ onStartup:
+ implemented: True
+ "rtcDoc::doc":
+ description: onStartup description
+ postCondition: onStartup Post_condition
+ preCondition: onStartup Pre_condition
+ onRateChanged:
+ implemented: True
+ "rtcDoc::doc":
+ description: onRateChanged description
+ postCondition: onRateChanged Post_condition
+ preCondition: onRateChanged Pre_condition
+ onShutdown:
+ implemented: True
+ "rtcDoc::doc":
+ description: onShutdown description
+ postCondition: onShutdown Post_condition
+ preCondition: onShutdown Pre_condition
+ onExecute:
+ implemented: True
+ "rtcDoc::doc":
+ description: onExecute description
+ postCondition: onExecute Post_condition
+ preCondition: onExecute Pre_condition
+ onStateUpdate:
+ implemented: True
+ "rtcDoc::doc":
+ description: onStateUpdate description
+ postCondition: onStateUpdate Post_condition
+ preCondition: onStateUpdate Pre_condition
+ dataPorts:
+ servicePorts:
+ configurationSet:
+ configuration:
+ parameters:
+
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSampleComp.cpp
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSampleComp.cpp (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/ARTSampleComp.cpp 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,94 @@
+// -*- C++ -*-
+/*!
+ * @file ARTSampleComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * $Id$
+ */
+#include <rtm/RTC.h>
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include "ARTSample.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+ ARTSampleInit(manager);
+ RTC::RtcBase* comp;
+
+ // Create a component
+ comp = manager->createComponent("ARTSample");
+ RTC::ExecutionContextList_var eclist = comp->get_owned_contexts();
+ if (eclist->length() < 1) { return; }
+ eclist[0]->activate_component(comp->getObjRef());
+
+ // Example
+ // The following procedure is examples how handle RT-Components.
+ // These should not be in this function.
+
+ // Get the component's object reference
+// RTC::RTObject_var rtobj;
+// rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+ // Get the port list of the component
+// PortList* portlist;
+// portlist = rtobj->get_ports();
+
+ // getting port profiles
+// std::cout << "Number of Ports: ";
+// std::cout << portlist->length() << std::endl << std::endl;
+// for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+// {
+// Port_ptr port;
+// port = (*portlist)[i];
+// std::cout << "Port" << i << " (name): ";
+// std::cout << port->get_port_profile()->name << std::endl;
+//
+// RTC::PortInterfaceProfileList iflist;
+// iflist = port->get_port_profile()->interfaces;
+// std::cout << "---interfaces---" << std::endl;
+// for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+// {
+// std::cout << "I/F name: ";
+// std::cout << iflist[i].instance_name << std::endl;
+// std::cout << "I/F type: ";
+// std::cout << iflist[i].type_name << std::endl;
+// const char* pol;
+// pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+// std::cout << "Polarity: " << pol << std::endl;
+// }
+// std::cout << "---properties---" << std::endl;
+// NVUtil::dump(port->get_port_profile()->properties);
+// std::cout << "----------------" << std::endl << std::endl;
+// }
+
+ return;
+}
+
+int main (int argc, char** argv)
+{
+ RTC::Manager* manager;
+ manager = RTC::Manager::init(argc, argv);
+
+ // Initialize manager
+ manager->init(argc, argv);
+
+ // Set module initialization proceduer
+ // This procedure will be invoked in activateManager() function.
+ manager->setModuleInitProc(MyModuleInit);
+
+ // Activate manager and register to naming service
+ manager->activateManager();
+
+ // run the manager in blocking mode
+ // runManager(false) is the default.
+ manager->runManager();
+
+ // If you want to run the manager in non-blocking mode, do like this
+ // manager->runManager(true);
+
+ return 0;
+}
+
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,668 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# src/ext/ec/artlinux/example/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+
+
+pkgdatadir = $(datadir)/OpenRTM-aist
+pkgincludedir = $(includedir)/OpenRTM-aist
+pkglibdir = $(libdir)/OpenRTM-aist
+pkglibexecdir = $(libexecdir)/OpenRTM-aist
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+example_PROGRAMS = ARTSampleComp$(EXEEXT)
+subdir = src/ext/ec/artlinux/example
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/libtool.m4 $(top_srcdir)/openrtm.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/lib/rtm/config_rtc.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(exampledir)" \
+ "$(DESTDIR)$(sourcedir)"
+PROGRAMS = $(example_PROGRAMS)
+am_ARTSampleComp_OBJECTS = ARTSampleComp.$(OBJEXT) ARTSample.$(OBJEXT)
+ARTSampleComp_OBJECTS = $(am_ARTSampleComp_OBJECTS)
+ARTSampleComp_DEPENDENCIES = $(top_builddir)/src/lib/rtm/libRTC.la \
+ $(top_builddir)/src/lib/coil/lib/libcoil.la
+ARTSampleComp_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(ARTSampleComp_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/src/lib/rtm
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(ARTSampleComp_SOURCES)
+DIST_SOURCES = $(ARTSampleComp_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(example_DATA) $(source_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/n-ando/OpenRTM-aist/missing --run aclocal-1.11
+AMTAR = ${SHELL} /home/n-ando/OpenRTM-aist/missing --run tar
+AR = ar
+ARTLIB = /usr/lib/art_syscalls.o
+ARTLINUX = artlinux
+AS = as
+AUTOCONF = ${SHELL} /home/n-ando/OpenRTM-aist/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/n-ando/OpenRTM-aist/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/n-ando/OpenRTM-aist/missing --run automake-1.11
+AWK = gawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+COSNAMES = /usr/bin/omniNames
+CPP = gcc -E
+CPPFLAGS = -Wall -fPIC -O2
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -Wall -fPIC -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL =
+DUMPBIN =
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+EXEEXT =
+FGREP = /bin/grep -F
+GREP = /bin/grep
+IDLC = /usr/bin/omniidl
+IDL_FLAGS = -bcxx -Wba -nf
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /usr/bin/ld
+LDFLAGS = -luuid -ldl -export-dynamic
+LDSO =
+LDSOLIBS = -lomniORB4 -lomnithread -lomniDynamic4
+LDSOOPTS =
+LIBOBJS =
+LIBRARY =
+LIBS = -lpthread -lomniORB4 -lomnithread -lomniDynamic4
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO =
+LN_S = ln -s
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /home/n-ando/OpenRTM-aist/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT =
+OBJDUMP = objdump
+OBJEXT = o
+ORB = omniORB
+OTOOL =
+OTOOL64 =
+PACKAGE = OpenRTM-aist
+PACKAGE_BUGREPORT = n-ando at aist.go.jp
+PACKAGE_NAME = OpenRTM-aist
+PACKAGE_STRING = OpenRTM-aist 1.1.0
+PACKAGE_TARNAME = OpenRTM-aist
+PACKAGE_URL =
+PACKAGE_VERSION = 1.1.0
+PATH_SEPARATOR = :
+PYTHON_FLAGS =
+RANLIB = ranlib
+RTM_DESCRIPTION = An OMG RTC compliant middleware for robots.
+RTM_MAJOR_VERSION = 1
+RTM_MINOR_VERSION = 1
+RTM_REVISION_NUM = 0
+RTM_SHORT_VERSION = 110
+RTM_VERSION = 1.1.0
+RTPREEMPTEC = rtpreempt
+SED = /bin/sed
+SET_MAKE =
+SHELL = /bin/bash
+SOEXT =
+STRIP = strip
+TARGET =
+UNITTEST =
+VERSION = 1.1.0
+WRAPPERS =
+abs_builddir = /home/n-ando/OpenRTM-aist/src/ext/ec/artlinux/example
+abs_srcdir = /home/n-ando/OpenRTM-aist/src/ext/ec/artlinux/example
+abs_top_builddir = /home/n-ando/OpenRTM-aist
+abs_top_srcdir = /home/n-ando/OpenRTM-aist
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = tar --format=posix -chf - "$$tardir"
+am__untar = tar -xf -
+bindir = ${exec_prefix}/bin
+build = i686-pc-linux-gnu
+build_alias =
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+coil_includedir = ${prefix}/include/coil-1.1
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = i686-pc-linux-gnu
+host_alias =
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/n-ando/OpenRTM-aist/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+lt_ECHO = echo
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+pkgconfigdir = ${libdir}/pkgconfig
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+rtm_datadir = ${datarootdir}/openrtm-1.1
+rtm_docdir = ${datarootdir}/openrtm-1.1/doc
+rtm_ecdir = ${exec_prefix}/lib/openrtm-1.1/ec
+rtm_exampledir = ${datarootdir}/openrtm-1.1/example
+rtm_idldir = ${prefix}/include/openrtm-1.1/rtm/idl
+rtm_includedir = ${prefix}/include/openrtm-1.1
+rtm_libdir = ${exec_prefix}/lib/openrtm-1.1
+rtm_rtcdir = ${exec_prefix}/lib/openrtm-1.1/rtc
+rtm_rtmdir = ${exec_prefix}/lib/openrtm-1.1/rtm
+rtm_sdodir = ${exec_prefix}/lib/openrtm-1.1/sdo
+rtm_svcdir = ${exec_prefix}/lib/openrtm-1.1/svc
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+subdirs = src/lib/coil
+sysconfdir = ${prefix}/etc
+target_alias =
+top_build_prefix = ../../../../../
+top_builddir = ../../../../..
+top_srcdir = ../../../../..
+AUTOMAKE_OPTIONS = 1.4
+AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/coil/include -I$(top_srcdir)/src/lib/rtm/idl
+AM_LDFLAGS = -L$(top_builddir) -L$(top_builddir)/src/lib/rtm -L$(top_builddir)/src/lib/rtm/idl
+
+#------------------------------------------------------------
+# Targets
+#------------------------------------------------------------
+# Targets directories
+exampledir = $(rtm_exampledir)
+socompdir = $(exampledir)/rtc
+sourcedir = $(exampledir)/src/ARTSample
+example_DATA = rtc.conf
+ARTSampleComp_SOURCES = ARTSampleComp.cpp ARTSample.cpp ARTSample.h
+ARTSampleComp_LDADD = $(top_builddir)/src/lib/rtm/libRTC.la \
+ $(top_builddir)/src/lib/coil/lib/libcoil.la
+
+ARTSampleComp_LDFLAGS = -L$(top_builddir)/src/lib/rtm/.libs
+
+# Example sources
+source_DATA = $(ALL_SRC) $(EXTRA_DIST)
+
+#------------------------------------------------------------
+# Extra distributed files
+#------------------------------------------------------------
+EXTRA_DIST = rtc.conf
+ALL_SRC = $(ARTSampleComp_SOURCES)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ext/ec/artlinux/example/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/ext/ec/artlinux/example/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-examplePROGRAMS: $(example_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)"
+ @list='$(example_PROGRAMS)'; test -n "$(exampledir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(exampledir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(exampledir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-examplePROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(example_PROGRAMS)'; test -n "$(exampledir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(exampledir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(exampledir)" && rm -f $$files
+
+clean-examplePROGRAMS:
+ @list='$(example_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ARTSampleComp$(EXEEXT): $(ARTSampleComp_OBJECTS) $(ARTSampleComp_DEPENDENCIES)
+ @rm -f ARTSampleComp$(EXEEXT)
+ $(ARTSampleComp_LINK) $(ARTSampleComp_OBJECTS) $(ARTSampleComp_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/ARTSample.Po
+include ./$(DEPDIR)/ARTSampleComp.Po
+
+.cpp.o:
+ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+# source='$<' object='$@' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+# $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-exampleDATA: $(example_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(exampledir)" || $(MKDIR_P) "$(DESTDIR)$(exampledir)"
+ @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(exampledir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(exampledir)" || exit $$?; \
+ done
+
+uninstall-exampleDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(example_DATA)'; test -n "$(exampledir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(exampledir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(exampledir)" && rm -f $$files
+install-sourceDATA: $(source_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(sourcedir)" || $(MKDIR_P) "$(DESTDIR)$(sourcedir)"
+ @list='$(source_DATA)'; test -n "$(sourcedir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sourcedir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(sourcedir)" || exit $$?; \
+ done
+
+uninstall-sourceDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(source_DATA)'; test -n "$(sourcedir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sourcedir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sourcedir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(exampledir)" "$(DESTDIR)$(sourcedir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-examplePROGRAMS clean-generic clean-libtool \
+ clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-exampleDATA install-examplePROGRAMS \
+ install-sourceDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-exampleDATA uninstall-examplePROGRAMS \
+ uninstall-sourceDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+ clean-examplePROGRAMS clean-generic clean-libtool clean-local \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exampleDATA \
+ install-examplePROGRAMS install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-sourceDATA install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-exampleDATA \
+ uninstall-examplePROGRAMS uninstall-sourceDATA
+
+
+#------------------------------------------------------------
+# File list for deb/ports packages
+#------------------------------------------------------------
+#lst:
+# echo $(ALL_SRC) > src.lst
+# echo $(EXTRA_DIST) > other.lst
+
+clean-local:
+ rm -f *.bak *.rpo *.sym lib*.*_pure_* *.lst
+ rm -f Makefile.old *core *~ *.so *.log
+ rm -f $(example_PROGRAMS)
+ rm -rf idl
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.ARTSample
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.ARTSample (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.ARTSample 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,76 @@
+# -*- Makefile -*-
+#
+# @file Makefile.ARTSample# @brief RTComponent makefile for "ARTSample component"
+# @date $Date$
+#
+# This file is generated by rtc-template with the following argments.
+#
+# /usr/bin/rtc-template -bcxx --module-name=ARTSample \
+# --module-type=DataFlowComponent \
+# --module-desc=Realtime periodic execution example component \
+# --module-version=1.0 --module-vendor=Noriaki Ando, AIST \
+# --module-category=example --module-comp-type=DataFlowComponent \
+# --module-act-type=PERIODIC --module-max-inst=10
+#
+#
+# $Id$
+#
+CXX = `rtm-config --cxx`
+CXXFLAGS = -I. \
+ -I../../../../lib/ \
+ -I../../../../lib/rtm/idl \
+ -I../../../../lib/coil/include \
+ `rtm-config --cflags`
+LDFLAGS = \
+ -L../../../../lib/rtm/.libs -lRTC \
+ -L../../../../lib/coil/lib/.libs -lcoil \
+ `rtm-config --libs`
+SHFLAGS = -shared
+
+IDLC = `rtm-config --idlc`
+IDLFLAGS = `rtm-config --idlflags` -I`rtm-config --prefix`/include/rtm/idl
+WRAPPER = rtm-skelwrapper
+WRAPPER_FLAGS = --include-dir="" --skel-suffix=Skel --stub-suffix=Stub
+
+SKEL_OBJ =
+STUB_OBJ =
+IMPL_OBJ =
+OBJS = ARTSample.o $(SKEL_OBJ) $(STUB_OBJ) $(IMPL_OBJ)
+
+.SUFFIXES : .so
+
+all: ARTSample.so ARTSampleComp
+
+
+.cpp.o:
+ rm -f $@
+ $(CXX) $(CXXFLAGS) -c -o $@ $<
+
+.o.so:
+ rm -f $@
+ $(CXX) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+
+ARTSampleComp: ARTSampleComp.o $(OBJS)
+ $(CXX) -o $@ $(OBJS) ARTSampleComp.o $(LDFLAGS)
+
+
+clean: clean_objs clean_skelstub
+ rm -f *~
+
+clean_objs:
+ rm -f $(OBJS) ARTSampleComp.o ARTSample.so ARTSampleComp
+
+clean_skelstub:
+ rm -f *Skel.h *Skel.cpp
+ rm -f *Stub.h *Stub.cpp
+
+
+
+ARTSample.so: $(OBJS)
+ARTSample.o: ARTSample.h
+ARTSampleComp.o: ARTSampleComp.cpp ARTSample.cpp ARTSample.h
+
+
+
+# end of Makefile
+
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.am
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.am (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/Makefile.am 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,51 @@
+## -*- Makefile -*-
+##---------------------------------------------------------------------------
+## Makefile.am for ConsoleIn/ConsoleOut components
+##
+## $Id: Makefile.am 2086 2011-05-09 04:46:15Z fsi-katami $
+##---------------------------------------------------------------------------
+
+AUTOMAKE_OPTIONS = 1.4
+
+AM_CPPFLAGS=-I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/coil/include -I$(top_srcdir)/src/lib/rtm/idl
+AM_LDFLAGS=-L$(top_builddir) -L$(top_builddir)/src/lib/rtm -L$(top_builddir)/src/lib/rtm/idl
+
+#------------------------------------------------------------
+# Targets
+#------------------------------------------------------------
+# Targets directories
+exampledir = $(rtm_exampledir)
+socompdir = $(exampledir)/rtc
+sourcedir = $(exampledir)/src/ARTSample
+
+# Standalone RTCs
+example_PROGRAMS = ARTSampleComp
+example_DATA = rtc.conf
+
+ARTSampleComp_SOURCES = ARTSampleComp.cpp ARTSample.cpp ARTSample.h
+ARTSampleComp_LDADD = $(top_builddir)/src/lib/rtm/libRTC.la \
+ $(top_builddir)/src/lib/coil/lib/libcoil.la
+ARTSampleComp_LDFLAGS = -L$(top_builddir)/src/lib/rtm/.libs
+
+# Example sources
+source_DATA = $(ALL_SRC) $(EXTRA_DIST)
+
+#------------------------------------------------------------
+# Extra distributed files
+#------------------------------------------------------------
+EXTRA_DIST = rtc.conf
+
+ALL_SRC = $(ARTSampleComp_SOURCES)
+
+#------------------------------------------------------------
+# File list for deb/ports packages
+#------------------------------------------------------------
+#lst:
+# echo $(ALL_SRC) > src.lst
+# echo $(EXTRA_DIST) > other.lst
+
+clean-local:
+ rm -f *.bak *.rpo *.sym lib*.*_pure_* *.lst
+ rm -f Makefile.old *core *~ *.so *.log
+ rm -f $(example_PROGRAMS)
+ rm -rf idl
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/README.ARTSample
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/README.ARTSample (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/README.ARTSample 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,165 @@
+#======================================================================
+# RTComponent: RTSample specificatioin
+#
+# OpenRTM-aist-1.0.0
+#
+# Date: Fri Feb 19 18:27:04 2010
+#
+# This file is generated by rtc-template with the following argments.
+#
+# /usr/bin/rtc-template -bcxx --module-name=ARTSample \
+# --module-type=DataFlowComponent \
+# --module-desc=Realtime periodic execution example component \
+# --module-version=1.0 --module-vendor=Noriaki Ando, AIST \
+# --module-category=example --module-comp-type=DataFlowComponent \
+# --module-act-type=PERIODIC --module-max-inst=10
+#
+#======================================================================
+# Basic Information
+#======================================================================
+# <rtc-template block="module">
+Basic Information:
+ Description: Realtime periodic execution example component
+ Version: 1.0
+ Author: Noriaki Ando, AIST
+ Category: example
+ Comp. Type: DataFlowComponent
+ Act. Type: PERIODIC
+ MAX Inst.: 10
+ Lang:
+ Lang Type:
+
+# </rtc-template>
+#======================================================================
+# Activity definition
+#======================================================================
+# <rtc-template block="actions">
+Actions:
+ onInitialize:
+ Description:
+ onInitialize description
+ PreCondition:
+ onInitialize Pre_condition
+ PostCondition:
+ onInitialize Post_condition
+
+ onFinalize:
+ Description:
+ onFinalize description
+ PreCondition:
+ onFinalize Pre_condition
+ PostCondition:
+ onFinalize Post_condition
+
+ onActivated:
+ Description:
+ onActivated description
+ PreCondition:
+ onActivated Pre_condition
+ PostCondition:
+ onActivated Post_condition
+
+ onDeactivated:
+ Description:
+ onDeactivated description
+ PreCondition:
+ onDeactivated Pre_condition
+ PostCondition:
+ onDeactivated Post_condition
+
+ onAborting:
+ Description:
+ onAborting description
+ PreCondition:
+ onAborting Pre_condition
+ PostCondition:
+ onAborting Post_condition
+
+ onError:
+ Description:
+ onError description
+ PreCondition:
+ onError Pre_condition
+ PostCondition:
+ onError Post_condition
+
+ onReset:
+ Description:
+ onReset description
+ PreCondition:
+ onReset Pre_condition
+ PostCondition:
+ onReset Post_condition
+
+ onExecute:
+ Description:
+ onExecute description
+ PreCondition:
+ onExecute Pre_condition
+ PostCondition:
+ onExecute Post_condition
+
+ onStateUpdate:
+ Description:
+ onStateUpdate description
+ PreCondition:
+ onStateUpdate Pre_condition
+ PostCondition:
+ onStateUpdate Post_condition
+
+ onShutdown:
+ Description:
+ onShutdown description
+ PreCondition:
+ onShutdown Pre_condition
+ PostCondition:
+ onShutdown Post_condition
+
+ onStartup:
+ Description:
+ onStartup description
+ PreCondition:
+ onStartup Pre_condition
+ PostCondition:
+ onStartup Post_condition
+
+ onRateChanged:
+ Description:
+ onRateChanged description
+ PreCondition:
+ onRateChanged Pre_condition
+ PostCondition:
+ onRateChanged Post_condition
+
+
+# </rtc-template>
+#======================================================================
+# InPorts definition
+#======================================================================
+# <rtc-template block="inport">
+InPorts:
+
+# </rtc-template>
+#======================================================================
+# OutPorts definition
+#======================================================================
+# <rtc-template block="outport">
+OutPorts:
+
+# </rtc-template>
+#======================================================================
+# Service definition
+#======================================================================
+# <rtc-template block="service">
+ServicePorts:
+
+
+# </rtc-template>
+#======================================================================
+# Configuration definition
+#======================================================================
+# <rtc-template block="configuration">
+Configuration:
+
+# </rtc-template>
+
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,11 @@
+corba.nameservers: localhost
+naming.formats: %h.host_cxt/%n1000hz-p30.rtc
+logger.enable: YES
+logger.log_level: PARANOID
+logger.file_name: rtc%p.log
+exec_cxt.periodic.type: artlinux_ec
+exec_cxt.periodic.rate: 1000
+exec_cxt.periodic.priority: 30
+manager.modules.load_path: ../.libs
+manager.modules.preload: ArtExecutionContext.so
+manager.modules.abs_path_allowed: yes
Added: trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf1
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf1 (rev 0)
+++ trunk/OpenRTM-aist/src/ext/ec/artlinux/example/rtc.conf1 2012-03-04 14:59:21 UTC (rev 2334)
@@ -0,0 +1,13 @@
+corba.nameservers: localhost
+naming.formats: %h.host_cxt/%n500hz-p10.rtc
+logger.enable: YES
+logger.log_level: DEBUG
+logger.file_name: /tmp/rtc%p.log
+exec_cxt.periodic.type: RTPreemptEC
+exec_cxt.periodic.rate: 500
+exec_cxt.periodic.priority: 10
+exec_cxt.periodic.rtpreempt.wait_offset: -22000
+exec_cxt.periodic.rtpreempt.sched_policy: rr
+manager.modules.load_path: ../
+manager.modules.preload: RTPreemptEC.so
+manager.modules.abs_path_allowed: yes
openrtm-commit メーリングリストの案内