[openrtm-commit:02882] r1065 - in branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . executionContext
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 10月 25日 (水) 14:55:58 JST
Author: kawauchi
Date: 2017-10-25 14:55:58 +0900 (Wed, 25 Oct 2017)
New Revision: 1065
Modified:
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java
branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
Log:
[merge] r1061-1063 have been merged from trunk.
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java 2017-10-20 07:32:59 UTC (rev 1064)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DefaultConfiguration.java 2017-10-25 05:55:58 UTC (rev 1065)
@@ -76,6 +76,7 @@
"manager.modules.C++.load_paths", "./",
"manager.modules.Python.load_paths", "./",
"manager.modules.Java.load_paths", "./",
+ "manager.modules.search_auto", "YES",
"manager.supported_languages", "C++, Python, Java",
"manager.modules.C++.suffixes", "",
"manager.modules.Python.suffixes", "py",
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-10-20 07:32:59 UTC (rev 1064)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/Manager.java 2017-10-25 05:55:58 UTC (rev 1065)
@@ -1768,6 +1768,11 @@
"Factory not found: "
+ comp_id.getProperty("implementaion_id"));
+ if (!StringUtil.toBool(
+ prop.getProperty("manager.modules.search_auto"),
+ "YES", "NO", true)) {
+ return null;
+ }
// automatic module loading
Vector<Properties> mp = m_module.getLoadableModules();
rtcout.println(Logbuf.INFO,
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java 2017-10-20 07:32:59 UTC (rev 1064)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObjectStateMachine.java 2017-10-25 05:55:58 UTC (rev 1065)
@@ -73,14 +73,14 @@
*/
private class onActivated implements StateAction {
public void doAction(StateHolder state) {
- // call Servant
- if (m_rtobjPtr != null) {
- if (m_rtobjPtr.on_activated(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- }
- return;
- }
- // call Object reference
+ // call Servant
+ if (m_rtobjPtr != null) {
+ if (m_rtobjPtr.on_activated(m_id) != ReturnCode_t.RTC_OK) {
+ m_sm.goTo(LifeCycleState.ERROR_STATE);
+ }
+ return;
+ }
+ // call Object reference
if (!m_ca) {
return;
}
@@ -148,14 +148,14 @@
*/
private class onStateUpdate implements StateAction {
public void doAction(StateHolder state) {
- // call Servant
- if (m_rtobjPtr != null) {
- if (m_rtobjPtr.on_state_update(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- }
- return;
- }
- // call Object reference
+ // call Servant
+ if (m_rtobjPtr != null) {
+ if (m_rtobjPtr.on_state_update(m_id) != ReturnCode_t.RTC_OK) {
+ m_sm.goTo(LifeCycleState.ERROR_STATE);
+ }
+ return;
+ }
+ // call Object reference
if (!m_dfc) {
return;
}
@@ -222,14 +222,14 @@
*/
private class onReset implements StateAction {
public void doAction(StateHolder state) {
- // call Servant
- if (m_rtobjPtr != null) {
- if (m_rtobjPtr.on_reset(m_id) != ReturnCode_t.RTC_OK) {
- m_sm.goTo(LifeCycleState.ERROR_STATE);
- }
- return;
- }
- // call Object reference
+ // call Servant
+ if (m_rtobjPtr != null) {
+ if (m_rtobjPtr.on_reset(m_id) != ReturnCode_t.RTC_OK) {
+ m_sm.goTo(LifeCycleState.ERROR_STATE);
+ }
+ return;
+ }
+ // call Object reference
if (!m_ca) {
return;
}
@@ -342,7 +342,7 @@
if (!m_ca) {
return;
}
- m_caVar.on_error(m_id);
+ m_caVar.on_aborting(m_id);
}
/**
*
@@ -420,23 +420,24 @@
/**
*
*/
- public void onRateChanged(){
+ public ReturnCode_t onRateChanged(){
// call Servant
if (m_rtobjPtr != null) {
- if (m_rtobjPtr.on_rate_changed(m_id) != ReturnCode_t.RTC_OK) {
+ ReturnCode_t ret = m_rtobjPtr.on_rate_changed(m_id);
+ if (!ret.equals(ReturnCode_t.RTC_OK)) {
m_sm.goTo(LifeCycleState.ERROR_STATE);
}
- return;
+ return ret;
}
// call Object reference
if (!m_dfc) {
- return;
+ return ReturnCode_t.RTC_ERROR;
}
- if (m_dfcVar.on_rate_changed(m_id) != ReturnCode_t.RTC_OK) {
+ ReturnCode_t ret = m_dfcVar.on_rate_changed(m_id);
+ if (!ret.equals(ReturnCode_t.RTC_OK)) {
m_sm.goTo(LifeCycleState.ERROR_STATE);
- return;
}
- return;
+ return ret;
}
// FsmParticipantAction
@@ -532,13 +533,14 @@
if (m_caVar==null) {
return;
}
- m_ca = true;
- Manager manager = Manager.instance();
- try {
- m_rtobjPtr = (RTObject_impl)manager.getPOA().reference_to_servant(comp);
- } catch (Exception ex) {
+ m_ca = true;
+ Manager manager = Manager.instance();
+ try {
+ m_rtobjPtr = (RTObject_impl)manager.getPOA().reference_to_servant(comp);
+ } catch (Exception ex) {
+ m_rtobjPtr = null;
- }
+ }
}
protected void setDataFlowComponentAction(final LightweightRTObject comp){
if(comp._is_a(DataFlowComponentActionHelper.id())) {
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2017-10-20 07:32:59 UTC (rev 1064)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExecutionContextWorker.java 2017-10-25 05:55:58 UTC (rev 1065)
@@ -10,6 +10,7 @@
import jp.go.aist.rtm.RTC.util.TimeValue;
import jp.go.aist.rtm.RTC.log.Logbuf;
+import RTC.ExecutionContextListHolder;
import RTC.ExecutionContextService;
import RTC.LifeCycleState;
import RTC.LightweightRTObject;
@@ -164,6 +165,32 @@
}
/**
+ * {@.ja ExecutionContext の周期が変化した}
+ * {@.en Changing execution rate of the ExecutionContext}
+ * <p>
+ * @return
+ * {@.ja ReturnCode_t 型のリターンコード}
+ * {@.en The return code of ReturnCode_t type}
+ *
+ *
+ * RTC::ReturnCode_t rateChanged(void);
+ */
+ public ReturnCode_t rateChanged(){
+ rtcout.println(Logbuf.TRACE, "rateChanged()");
+ ReturnCode_t ret = ReturnCode_t.RTC_OK;
+ synchronized (m_mutex){
+ for (RTObjectStateMachine comp: m_comps) {
+ ReturnCode_t tmp = comp.onRateChanged();
+ if(!tmp.equals(ReturnCode_t.RTC_OK)){
+ ret = tmp;
+ }
+ }
+ }
+ return ret;
+
+ }
+
+ /**
* {@.ja RTコンポーネントをアクティブ化する}
* {@.en Activate an RT-component}
* <p>
@@ -210,8 +237,8 @@
"Component is in INACTIVE state. Going to ACTIVE state.");
rtobjhldr.rtobjsm.goTo(LifeCycleState.ACTIVE_STATE);
rtcout.println(Logbuf.DEBUG,"activateComponent() done.");
- return ReturnCode_t.RTC_OK;
}
+ return ReturnCode_t.RTC_OK;
}
public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj,
TimeValue timeout,
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java 2017-10-20 07:32:59 UTC (rev 1064)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/ExtTrigExecutionContext.java 2017-10-25 05:55:58 UTC (rev 1065)
@@ -515,6 +515,15 @@
rtcout.println(Logbuf.ERROR, "Setting execution rate failed. " + rate);
return ret;
}
+
+ ret = m_worker.rateChanged();
+ if (ret != ReturnCode_t.RTC_OK)
+ {
+ rtcout.println(Logbuf.ERROR,
+ "Invoking on_rate_changed() for each RTC failed.");
+ return ret;
+ }
+
ret = onSetRate(rate);
if (ret != ReturnCode_t.RTC_OK)
{
Modified: branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2017-10-20 07:32:59 UTC (rev 1064)
+++ branches/RELENG_1_2/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/executionContext/PeriodicExecutionContext.java 2017-10-25 05:55:58 UTC (rev 1065)
@@ -18,6 +18,7 @@
import jp.go.aist.rtm.RTC.util.TimeValue;
import jp.go.aist.rtm.RTC.util.equalFunctor;
import OpenRTM.DataFlowComponent;
+import RTC.ExecutionContextListHolder;
import RTC.ExecutionContextService;
import RTC.ExecutionContextServiceHelper;
import RTC.ExecutionContextServicePOA;
@@ -100,7 +101,7 @@
rtcout.println(Logbuf.TRACE, "PeriodicExecutionContext.setObjRef()");
m_worker.setECRef(ref);
m_profile.setObjRef(ref);
- m_ref = ref;
+ m_ref = ref;
}
/**
@@ -578,6 +579,15 @@
rtcout.println(Logbuf.ERROR, "Setting execution rate failed. " + rate);
return ret;
}
+
+ ret = m_worker.rateChanged();
+ if (ret != ReturnCode_t.RTC_OK)
+ {
+ rtcout.println(Logbuf.ERROR,
+ "Invoking on_rate_changed() for each RTC failed.");
+ return ret;
+ }
+
ret = onSetRate(rate);
if (ret != ReturnCode_t.RTC_OK)
{
@@ -1720,7 +1730,31 @@
*
*/
public ReturnCode_t setRate(double rate) {
- return m_profile.setRate(rate);
+ rtcout.println(Logbuf.TRACE, "setRate("+rate+")");
+ ReturnCode_t ret = m_profile.setRate(rate);
+ if(!ret.equals(ReturnCode_t.RTC_OK)){
+ rtcout.println(Logbuf.ERROR, "Setting execution rate failed. "
+ +rate);
+ return ret;
+ }
+
+ ret = m_worker.rateChanged();
+ if(!ret.equals(ReturnCode_t.RTC_OK)){
+ rtcout.println(Logbuf.ERROR,
+ "Invoking on_rate_changed() for each RTC failed.");
+ return ret;
+ }
+
+ ret = onSetRate(rate);
+ if(!ret.equals(ReturnCode_t.RTC_OK)){
+ rtcout.println(Logbuf.ERROR,
+ "onSetRate("+rate+" failed.");
+ return ret;
+ }
+
+
+ rtcout.println(Logbuf.INFO,"setRate("+rate+") done");
+ return ret;
}
/**
* {@.ja ExecutionContext の実行周期(Hz)を取得する}
More information about the openrtm-commit
mailing list