diff --git a/CMakeLists.txt b/CMakeLists.txt index c8d991d59..a5f358bde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -303,6 +303,8 @@ if(UNIX) set(OPENRTM_IDL_DIR "${OPENRTM_DIR}/include/openrtm-1.1/rtm/idl") elseif(OPENRTM_VERSION STREQUAL OPENRTM_VERSION120 OR OPENRTM_VERSION STREQUAL OPENRTM_VERSION121 OR OPENRTM_VERSION STREQUAL OPENRTM_VERSION122) set(OPENRTM_IDL_DIR "${OPENRTM_DIR}/include/openrtm-1.2/rtm/idl") + elseif(OPENRTM_VERSION STREQUAL OPENRTM_VERSION202) + set(OPENRTM_IDL_DIR "${OPENRTM_DIR}/include/openrtm-2.0/rtm/idl") else() set(OPENRTM_IDL_DIR "${OPENRTM_DIR}/include/rtm/idl") endif() diff --git a/cmake_modules/FindOpenRTM.cmake b/cmake_modules/FindOpenRTM.cmake index da8be52e6..23aadb038 100644 --- a/cmake_modules/FindOpenRTM.cmake +++ b/cmake_modules/FindOpenRTM.cmake @@ -12,6 +12,7 @@ set(OPENRTM_VERSION112 "1.1.2") set(OPENRTM_VERSION120 "1.2.0") set(OPENRTM_VERSION121 "1.2.1") set(OPENRTM_VERSION122 "1.2.2") +set(OPENRTM_VERSION202 "2.0.2") set(OPENRTM_PKG_CONFIG_FOUND FALSE) #Additional threshold OpenRTM versions switching processing set(OPENRTM_DEFAULT_VERSION ${OPENRTM_VERSION100}) @@ -19,13 +20,13 @@ set(OPENRTM_DEFAULT_VERSION ${OPENRTM_VERSION100}) if(UNIX) if(OPENRTM_DIR) string(REGEX REPLACE "/$" "" OPENRTM_DIR ${OPENRTM_DIR}) - set(OPENRTM_CONFIG_EXECUTABLE ${OPENRTM_DIR}/bin/rtm-config) + set(OPENRTM_CONFIG_EXECUTABLE ${OPENRTM_DIR}/bin/rtm2-config) if(NOT EXISTS ${OPENRTM_CONFIG_EXECUTABLE}) set(OPENRTM_CONFIG_EXECUTABLE) - message(FATAL_ERROR "rtm-config was not found in ${OPENRTM_DIR}/bin. Please set OPENRTM_DIR correctly.") + message(FATAL_ERROR "rtm2-config was not found in ${OPENRTM_DIR}/bin. Please set OPENRTM_DIR correctly.") endif() else() - find_program(OPENRTM_CONFIG_EXECUTABLE rtm-config DOC "The location of the rtm-config script") + find_program(OPENRTM_CONFIG_EXECUTABLE rtm2-config DOC "The location of the rtm2-config script") mark_as_advanced(OPENRTM_CONFIG_EXECUTABLE) endif() @@ -58,6 +59,10 @@ if(UNIX) list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/openrtm-1.2/rtm/idl") list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/openrtm-1.2") list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/coil-1.2") + elseif(OPENRTM_VERSION STREQUAL OPENRTM_VERSION202) + list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/openrtm-2.0/rtm/idl") + list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/openrtm-2.0") + list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/coil-2.0") else() list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/rtm/idl") list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include") diff --git a/hrplib/hrpCorba/CMakeLists.txt b/hrplib/hrpCorba/CMakeLists.txt index bab5787e3..7f8bd7a36 100644 --- a/hrplib/hrpCorba/CMakeLists.txt +++ b/hrplib/hrpCorba/CMakeLists.txt @@ -84,7 +84,7 @@ set(given_headers ORBwrap.h) install(FILES ${given_headers} ${idl_h_files} DESTINATION ${RELATIVE_HEADERS_INSTALL_PATH}/hrpCorba) execute_process( - COMMAND python -c "import sys; print('%s.%s'%(sys.version_info[0:2]))" + COMMAND python3 -c "import sys; print('%s.%s'%(sys.version_info[0:2]))" OUTPUT_VARIABLE python_version OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/hrplib/hrpModel/BodyCustomizerInterface.cpp b/hrplib/hrpModel/BodyCustomizerInterface.cpp index 19b3207f2..ea482c8d1 100644 --- a/hrplib/hrpModel/BodyCustomizerInterface.cpp +++ b/hrplib/hrpModel/BodyCustomizerInterface.cpp @@ -61,7 +61,7 @@ namespace { NameToInterfaceMap customizerRepository; bool pluginLoadingFunctionsCalled = false; - inline string toNativePathString(const filesystem::path& path) { + inline string toNativePathString(const boost::filesystem::path& path) { #if (BOOST_VERSION <= 103301) return path.native_file_string(); #elif (BOOST_VERSION < 104600) @@ -175,21 +175,21 @@ int hrp::loadBodyCustomizers(const std::string pathString, BodyInterface* bodyIn } } #elif (BOOST_VERSION >= 105000) - filesystem::path pluginPath(pathString, (void *)filesystem::native); + boost::filesystem::path pluginPath(pathString, (void *)boost::filesystem::native); - if(filesystem::exists(pluginPath)){ + if(boost::filesystem::exists(pluginPath)){ - if(!filesystem::is_directory(pluginPath)){ + if(!boost::filesystem::is_directory(pluginPath)){ if(loadCustomizerDll(bodyInterface, toNativePathString(pluginPath))){ numLoaded++; } } else { regex pluginNamePattern(string(".+Customizer") + DLLSFX); - filesystem::directory_iterator end; + boost::filesystem::directory_iterator end; - for(filesystem::directory_iterator it(pluginPath); it != end; ++it){ - const filesystem::path& filepath = *it; - if(!filesystem::is_directory(filepath)){ + for(boost::filesystem::directory_iterator it(pluginPath); it != end; ++it){ + const boost::filesystem::path& filepath = *it; + if(!boost::filesystem::is_directory(filepath)){ if(regex_match(filepath.filename().string(), pluginNamePattern)){ if(loadCustomizerDll(bodyInterface, toNativePathString(filepath))){ numLoaded++; @@ -262,8 +262,8 @@ int hrp::loadBodyCustomizers(BodyInterface* bodyInterface) #ifndef _WIN32 Dl_info info; if(dladdr((void*)&hrp::findBodyCustomizer, &info)){ - filesystem::path customizerPath = - filesystem::path(info.dli_fname).branch_path().branch_path() / OPENHRP_RELATIVE_SHARE_DIR / "customizer"; + boost::filesystem::path customizerPath = + boost::filesystem::path(info.dli_fname).branch_path().branch_path() / OPENHRP_RELATIVE_SHARE_DIR / "customizer"; numLoaded += loadBodyCustomizers(customizerPath.string(), bodyInterface); } #else diff --git a/hrplib/hrpRTM/SimulationExecutionContext.cpp b/hrplib/hrpRTM/SimulationExecutionContext.cpp index 3a45b72e6..2743bd6eb 100644 --- a/hrplib/hrpRTM/SimulationExecutionContext.cpp +++ b/hrplib/hrpRTM/SimulationExecutionContext.cpp @@ -6,7 +6,7 @@ namespace RTC { - ReturnCode_t SimulationExecutionContext::start() throw (CORBA::SystemException) + ReturnCode_t SimulationExecutionContext::start() { ReturnCode_t ret = OpenHRPExecutionContext::start(); @@ -19,7 +19,7 @@ namespace RTC } - ReturnCode_t SimulationExecutionContext::stop() throw (CORBA::SystemException) + ReturnCode_t SimulationExecutionContext::stop() { #if (defined(OPENRTM_VERSION042) || defined(OPENRTM_VERSION110)) && !defined(OPENRTM_VERSION_TRUNK) if (!m_running) return RTC::PRECONDITION_NOT_MET; diff --git a/hrplib/hrpRTM/SimulationExecutionContext.h b/hrplib/hrpRTM/SimulationExecutionContext.h index b5741fec0..d1fc66af1 100644 --- a/hrplib/hrpRTM/SimulationExecutionContext.h +++ b/hrplib/hrpRTM/SimulationExecutionContext.h @@ -11,8 +11,8 @@ namespace RTC class SimulationExecutionContext : public virtual OpenHRPExecutionContext { public: - virtual ReturnCode_t start() throw (CORBA::SystemException); - virtual ReturnCode_t stop() throw (CORBA::SystemException); + virtual ReturnCode_t start(); + virtual ReturnCode_t stop(); static OpenHRP::ClockGenerator_var m_cg; }; }; diff --git a/hrplib/hrpUtil/UrlUtil.cpp b/hrplib/hrpUtil/UrlUtil.cpp index c1ef34de8..82f0d61d6 100644 --- a/hrplib/hrpUtil/UrlUtil.cpp +++ b/hrplib/hrpUtil/UrlUtil.cpp @@ -69,12 +69,12 @@ void hrp::getPathFromUrl(string& refUrl, const string& rootDir, string srcUrl) } } #elif (BOOST_VERSION >= 105000) - filesystem::path filepath( deleteURLScheme(srcUrl), (void *)filesystem::native); + boost::filesystem::path filepath( deleteURLScheme(srcUrl), (void *)boost::filesystem::native); if(exists(filepath)){ // 元が絶対パス // - refUrl = filesystem::system_complete(filepath).string(); + refUrl = boost::filesystem::system_complete(filepath).string(); }else{ // 元が相対パス // - filesystem::path filepath(rootDir + deleteURLScheme(srcUrl), (void *)filesystem::native); - if(filesystem::exists(filepath)){ + boost::filesystem::path filepath(rootDir + deleteURLScheme(srcUrl), (void *)boost::filesystem::native); + if(boost::filesystem::exists(filepath)){ refUrl = system_complete(filepath).string(); } } diff --git a/hrplib/hrpUtil/VrmlParser.cpp b/hrplib/hrpUtil/VrmlParser.cpp index 55c71b6e0..0dec4f434 100644 --- a/hrplib/hrpUtil/VrmlParser.cpp +++ b/hrplib/hrpUtil/VrmlParser.cpp @@ -468,7 +468,7 @@ void VrmlParser::load(const string& filename) void VrmlParserImpl::load(const string& filename) { - filesystem::path localPath(filename); + boost::filesystem::path localPath(filename); localPath.normalize(); #if (BOOST_VERSION < 104600) @@ -764,17 +764,17 @@ VrmlNodePtr VrmlParserImpl::readInlineNode(VrmlNodeCategory nodeCategory) VrmlNodePtr VrmlParserImpl::newInlineSource(string& io_filename) { - filesystem::path localPath; + boost::filesystem::path localPath; string chkFile(""); if( isFileProtocol( io_filename ) ) { - localPath = filesystem::path( deleteURLScheme(io_filename) ); + localPath = boost::filesystem::path( deleteURLScheme(io_filename) ); localPath.normalize(); // Relative path check & translate to absolute path if ( ! exists(localPath) ){ - filesystem::path parentPath( scanner->filename ); + boost::filesystem::path parentPath( scanner->filename ); #if BOOST_VERSION < 103600 localPath = parentPath.branch_path() / localPath; #else diff --git a/server/ControllerBridge/BridgeConf.cpp b/server/ControllerBridge/BridgeConf.cpp index d62c0ad55..3b1de55b1 100644 --- a/server/ControllerBridge/BridgeConf.cpp +++ b/server/ControllerBridge/BridgeConf.cpp @@ -178,7 +178,7 @@ void BridgeConf::parseOptions() vector values = vmap["module"].as >(); for(size_t i=0; i < values.size(); ++i){ string modulePath( values[i] ); - if( filesystem::extension(filesystem::path( modulePath )).empty() ) + if( boost::filesystem::extension(boost::filesystem::path( modulePath )).empty() ) { modulePath += string( SUFFIX_SHARED_EXT ); } @@ -326,7 +326,7 @@ void BridgeConf::addModuleInfo(const std::string& value) } else { ModuleInfo info; info.fileName = parameters[0]; - info.componentName = filesystem::basename(filesystem::path(info.fileName)); + info.componentName = boost::filesystem::basename(boost::filesystem::path(info.fileName)); if(parameters.size() == 1){ info.initFuncName = info.componentName + "Init"; } else { diff --git a/server/ModelLoader/ModelLoader_impl.cpp b/server/ModelLoader/ModelLoader_impl.cpp index 55f2ff5a9..12bd9d311 100644 --- a/server/ModelLoader/ModelLoader_impl.cpp +++ b/server/ModelLoader/ModelLoader_impl.cpp @@ -157,7 +157,6 @@ static void changetoBoundingBox(POA_OpenHRP::BodyInfo* bodyInfo, unsigned int* d } BodyInfo_ptr ModelLoader_impl::loadBodyInfo(const char* url) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException) { OpenHRP::ModelLoader::ModelLoadOption option; option.readImage = false; @@ -168,7 +167,6 @@ BodyInfo_ptr ModelLoader_impl::loadBodyInfo(const char* url) } BodyInfo_ptr ModelLoader_impl::loadBodyInfoEx(const char* url, const OpenHRP::ModelLoader::ModelLoadOption& option) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException) { POA_OpenHRP::BodyInfo* bodyInfo = loadBodyInfoFromModelFile(replaceProjectDir(std::string(url)), option); if(option.AABBdata.length()){ @@ -184,7 +182,6 @@ BodyInfo_ptr ModelLoader_impl::loadBodyInfoEx(const char* url, const OpenHRP::Mo } BodyInfo_ptr ModelLoader_impl::getBodyInfoEx(const char* url0, const OpenHRP::ModelLoader::ModelLoadOption& option) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException) { string url(url0); @@ -217,7 +214,6 @@ BodyInfo_ptr ModelLoader_impl::getBodyInfoEx(const char* url0, const OpenHRP::Mo } BodyInfo_ptr ModelLoader_impl::getBodyInfo(const char* url) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException) { OpenHRP::ModelLoader::ModelLoadOption option; option.readImage = false; @@ -282,7 +278,6 @@ POA_OpenHRP::BodyInfo* ModelLoader_impl::loadBodyInfoFromModelFile(const string SceneInfo_ptr ModelLoader_impl::loadSceneInfo(const char* url) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException) { cout << "loading " << url << endl; diff --git a/server/ModelLoader/ModelLoader_impl.h b/server/ModelLoader/ModelLoader_impl.h index 84067fd0f..34460654c 100644 --- a/server/ModelLoader/ModelLoader_impl.h +++ b/server/ModelLoader/ModelLoader_impl.h @@ -44,20 +44,15 @@ class ModelLoader_impl : public POA_OpenHRP::ModelLoader virtual PortableServer::POA_ptr _default_POA(); - virtual BodyInfo_ptr getBodyInfo(const char* url) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException); + virtual BodyInfo_ptr getBodyInfo(const char* url); - virtual BodyInfo_ptr getBodyInfoEx(const char* url, const OpenHRP::ModelLoader::ModelLoadOption& option ) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException); + virtual BodyInfo_ptr getBodyInfoEx(const char* url, const OpenHRP::ModelLoader::ModelLoadOption& option ); - virtual BodyInfo_ptr loadBodyInfo(const char* url) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException); + virtual BodyInfo_ptr loadBodyInfo(const char* url); - virtual BodyInfo_ptr loadBodyInfoEx(const char* url, const OpenHRP::ModelLoader::ModelLoadOption& option) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException); + virtual BodyInfo_ptr loadBodyInfoEx(const char* url, const OpenHRP::ModelLoader::ModelLoadOption& option); - virtual SceneInfo_ptr loadSceneInfo(const char* url) - throw (CORBA::SystemException, OpenHRP::ModelLoader::ModelLoaderException); + virtual SceneInfo_ptr loadSceneInfo(const char* url); virtual void clearData();