[openrtm-commit:02059] r2784 - trunk/OpenRTM-aist/src/lib/rtm

openrtm @ openrtm.org openrtm @ openrtm.org
2016年 10月 14日 (金) 14:07:27 JST


Author: miyamoto
Date: 2016-10-14 14:07:27 +0900 (Fri, 14 Oct 2016)
New Revision: 2784

Modified:
   trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp
Log:
[compat,RELENG_1_2]refs #3656

Modified: trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp	2016-10-14 00:40:26 UTC (rev 2783)
+++ trunk/OpenRTM-aist/src/lib/rtm/RTObject.cpp	2016-10-14 05:07:27 UTC (rev 2784)
@@ -2744,12 +2744,22 @@
         coil::Properties default_prop;
         default_prop.setDefaults(default_config);
         RTC::ExecutionContextBase* ec = NULL;
+
+        std::string& ec_type(default_prop["exec_cxt.periodic.type"]);
+        if (std::find(avail_ec.begin(), avail_ec.end(), ec_type)
+                == avail_ec.end())
+        {
+            RTC_WARN(("EC %s is not available.", ec_type.c_str()));
+            RTC_DEBUG(("Available ECs: %s",
+                       coil::flatten(avail_ec).c_str()));
+            return RTC::RTC_ERROR;
+        }
         ec = RTC::ExecutionContextFactory::instance().
-          createObject(default_prop["exec_cxt.periodic.type"].c_str());
+          createObject(ec_type.c_str());
         if (ec == NULL)
           {
             RTC_ERROR(("EC (%s) creation failed.",
-                       default_prop["exec_cxt.periodic.type"].c_str()));
+                       ec_type.c_str()));
             RTC_DEBUG(("Available EC list: %s",
                        coil::flatten(avail_ec).c_str()));
             return RTC::RTC_ERROR;
@@ -2760,7 +2770,7 @@
 
         if (prop == NULL)
           {
-            RTC_WARN(("No global EC options found."));
+            RTC_WARN(("No default EC options found."));
             return RTC::RTC_ERROR;
           }
 



More information about the openrtm-commit mailing list