Skip to content

Commit

Permalink
OpenRTM1.1.1対応
Browse files Browse the repository at this point in the history
  • Loading branch information
hattori committed Jul 14, 2014
1 parent 8827cab commit 17c598a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,15 @@ elseif( OPENRTM_VERSION STREQUAL OPENRTM_VERSION110 )
else()
set(OPENHRP_RTM_IDL_DIR "${OpenHRP_SOURCE_DIR}/idl/OpenRTM/${OPENRTM_VERSION}")
endif()

if( OPENRTM_VERSION STREQUAL OPENRTM_VERSION042 )
set(ADDITIONAL_SYMBOL "OPENRTM_VERSION_042")
elseif( OPENRTM_VERSION STREQUAL OPENRTM_VERSION100 OR OPENRTM_VERSION STREQUAL OPENRTM_VERSION110 )
set(ADDITIONAL_SYMBOL "OPENRTM_VERSION110")
endif()

if(UNIX)
if(OPENRTM_VERSION STREQUAL OPENRTM_VERSION110)
if(OPENRTM_VERSION STREQUAL OPENRTM_VERSION110 OR OPENRTM_VERSION STREQUAL OPENRTM_VERSION111)
set(OPENRTM_IDL_DIR "${OPENRTM_DIR}/include/openrtm-1.1/rtm/idl")
else()
set(OPENRTM_IDL_DIR "${OPENRTM_DIR}/include/rtm/idl")
Expand Down
3 changes: 2 additions & 1 deletion cmake_modules/FindOpenRTM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(OPENRTM_VERSION100 "1.0.0")
set(OPENRTM_VERSION101 "1.0.1")
set(OPENRTM_VERSION102 "1.0.2")
set(OPENRTM_VERSION110 "1.1.0")
set(OPENRTM_VERSION111 "1.1.1")
set(OPENRTM_PKG_CONFIG_FOUND FALSE)
#Additional threshold OpenRTM versions switching processing
set(OPENRTM_DEFAULT_VERSION ${OPENRTM_VERSION100})
Expand Down Expand Up @@ -45,7 +46,7 @@ if(UNIX)

if(RESULT EQUAL 0)
if(OPENRTM_DIR)
if(OPENRTM_VERSION STREQUAL OPENRTM_VERSION110)
if(OPENRTM_VERSION STREQUAL OPENRTM_VERSION110 OR OPENRTM_VERSION STREQUAL OPENRTM_VERSION111)
list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/openrtm-1.1/rtm/idl")
list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/openrtm-1.1")
list(APPEND OPENRTM_INCLUDE_DIRS "${OPENRTM_DIR}/include/coil-1.1")
Expand Down
31 changes: 27 additions & 4 deletions hrplib/hrpRTM/SimulationExecutionContext.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include <rtm/CorbaNaming.h>
#if !defined(OPENRTM_VERSION042) && !defined(OPENRTM_VERSION110)
#include <rtm/Manager.h>
#endif
#include "SimulationExecutionContext.h"

namespace RTC
Expand All @@ -18,6 +21,7 @@ namespace RTC

ReturnCode_t SimulationExecutionContext::stop() throw (CORBA::SystemException)
{
#if defined(OPENRTM_VERSION042) || defined(OPENRTM_VERSION110)

This comment has been minimized.

Copy link
@fkanehiro

fkanehiro May 27, 2016

Owner

@hattorishizuko さん、ここっていつもtrueになるような気がするのですが、そんなことないでしょうか。

if (!m_running) return RTC::PRECONDITION_NOT_MET;

OpenRTM::ExtTrigExecutionContextService_var extTrigExecContext =
Expand All @@ -31,13 +35,22 @@ namespace RTC
std::for_each(m_comps.begin(), m_comps.end(), invoke_on_shutdown());

// change EC thread state
#ifdef OPENRTM_VERSION_042
#ifdef OPENRTM_VERSION_042
m_state = false;
#else
#else
//m_running = false;
m_svc = false;
#endif
#endif
return RTC::RTC_OK;
#else
ReturnCode_t ret = OpenHRPExecutionContext::stop();
if (ret == RTC_OK){
OpenRTM::ExtTrigExecutionContextService_var extTrigExecContext =
OpenRTM::ExtTrigExecutionContextService::_narrow(this->getObjRef());
m_cg->unsubscribe(extTrigExecContext);
}
return RTC::RTC_OK;
#endif
}

OpenHRP::ClockGenerator_var SimulationExecutionContext::m_cg;
Expand All @@ -51,10 +64,20 @@ void SimulationECInit(RTC::Manager* manager)
try{
CORBA::Object_ptr obj = cn.resolve("ClockGenerator");
RTC::SimulationExecutionContext::m_cg = OpenHRP::ClockGenerator::_narrow(obj);


#if defined(OPENRTM_VERSION042) || defined(OPENRTM_VERSION110)
manager->registerECFactory("SimulationEC",
RTC::ECCreate<RTC::SimulationExecutionContext>,
RTC::ECDelete<RTC::OpenHRPExecutionContext>);
#else
RTC::ExecutionContextFactory::
instance().addFactory("SimulationEC",
::coil::Creator< ::RTC::ExecutionContextBase,
::RTC::SimulationExecutionContext>,
::coil::Destructor< ::RTC::ExecutionContextBase,
::RTC::OpenHRPExecutionContext>);
#endif

}catch(RTC::CorbaNaming::NotFound& ex){
std::cerr << "SimultationExecutionContext: can not find ClockGenerator"
<< std::endl;
Expand Down

0 comments on commit 17c598a

Please sign in to comment.