diff --git a/cmake b/cmake index 5c8c19f491f2c6f8488f5f37ff81d711d69dbb3f..8f68dc14b0dbc92ea376794d6c7d71f9a8648098 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 5c8c19f491f2c6f8488f5f37ff81d711d69dbb3f +Subproject commit 8f68dc14b0dbc92ea376794d6c7d71f9a8648098 diff --git a/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl b/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl index a339420f497a4b07a1f1211a288597dd4d98a3e8..8582d7b35771193c4651a153bce08315fb1c9b97 100644 --- a/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl +++ b/idl/hpp/corbaserver/rbprm/rbprmbuilder.idl @@ -18,7 +18,7 @@ #ifndef HPP_RBPRM_CORBA_BUILDER_IDL # define HPP_RBPRM_CORBA_BUILDER_IDL -# include <hpp/corbaserver/common.idl> +# include <hpp/common.idl> module hpp { diff --git a/script/scenarios/demos/run.sh b/script/scenarios/demos/run.sh index c249455bcb37f8e2ae1c60795925cc6660ab54f3..6c19fae83f59f6c36f9314521e7fd7def6090e51 100755 --- a/script/scenarios/demos/run.sh +++ b/script/scenarios/demos/run.sh @@ -1,8 +1,8 @@ #!/bin/bash -gepetto-viewer-server & +gepetto-gui & hpp-rbprm-server & ipython -i --no-confirm-exit ./$1 -pkill -f 'gepetto-viewer-server' +pkill -f 'gepetto-gui' pkill -f 'hpp-rbprm-server' diff --git a/script/scenarios/demos/rund.sh b/script/scenarios/demos/rund.sh index eab7645220a9bb27f8fee067d65204a90e897868..bd7311a825b4b075321eafaadd5d31522f8f5c0c 100755 --- a/script/scenarios/demos/rund.sh +++ b/script/scenarios/demos/rund.sh @@ -1,6 +1,6 @@ #!/bin/bash -gepetto-viewer-server & +gepetto-gui & ipython -i --no-confirm-exit ./$1 -pkill -f 'gepetto-viewer-server' +pkill -f 'gepetto-gui' diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 786dbdbf630ca66a74043fff6ea3651060801e40..24c7008ec2162f3eb613417bbad617b69125ab37 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,10 +20,6 @@ SET(IDL_SOURCES rbprmbuilder ) -SET(HPP_CORBASERVER_IDL_SOURCES - common -) - OMNIIDL_INCLUDE_DIRECTORIES( ${HPP_CORBASERVER_DATAROOTDIR}/idl ${CMAKE_SOURCE_DIR}/idl ) @@ -33,46 +29,33 @@ FINDPYTHON(2.7 EXACT REQUIRED) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src) FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm) -FOREACH(IDL ${IDL_SOURCES}) - GENERATE_IDL_CPP (${IDL} - ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm - ) - GENERATE_IDL_PYTHON (${IDL} - ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm - ) -ENDFOREACH() FOREACH(IDL ${IDL_SOURCES}) GENERATE_IDL_CPP (hpp/corbaserver/rbprm/${IDL} - ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm) - GENERATE_IDL_PYTHON (hpp/corbaserver/rbprm/${IDL} - ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm) + ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm + HEADER_SUFFIX -idl.hh) + GENERATE_IDL_PYTHON (${IDL} + ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm + ENABLE_DOCSTRING + STUBS hpp_stubs.rbprm + ARGUMENTS + -Wbmodules=hpp_idl + -Wbextern=common:hpp_stubs + ) INSTALL( - FILES ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/${IDL}.hh + FILES ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/${IDL}-idl.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hpp/corbaserver/rbprm) - INSTALL( - FILES ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/${IDL}_idl.py - DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm) -ENDFOREACH() - -FOREACH(IDL ${HPP_CORBASERVER_IDL_SOURCES}) - GENERATE_IDL_CPP (${IDL} - ${HPP_CORBASERVER_DATAROOTDIR}/idl/hpp/corbaserver - ) - GENERATE_IDL_PYTHON (${IDL} - ${HPP_CORBASERVER_DATAROOTDIR}/idl/hpp/corbaserver - ) - INSTALL(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${IDL}_idl.py - DESTINATION ${PYTHON_SITELIB}/hpp/corbaserver/rbprm) ENDFOREACH() +INSTALL( + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/hpp_idl/hpp/corbaserver/rbprm + DESTINATION ${PYTHON_SITELIB}/hpp_idl/hpp/corbaserver) +INSTALL( + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/hpp_stubs/rbprm + DESTINATION ${PYTHON_SITELIB}/hpp_stubs) ADD_LIBRARY(${LIBRARY_NAME} SHARED - common.hh - commonSK.cc - ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/rbprmbuilder.hh - ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/rbprmbuilderSK.cc + ${ALL_IDL_CPP_STUBS} rbprmbuilder.impl.cc rbprmbuilder.impl.hh server.cc diff --git a/src/hpp/corbaserver/rbprm/__init__.py b/src/hpp/corbaserver/rbprm/__init__.py index 5191ae20a4eaabf4ef102cf57bff1d81ffb0d5f4..32c1be5fec19deb386b588745a7a265145f5e529 100644 --- a/src/hpp/corbaserver/rbprm/__init__.py +++ b/src/hpp/corbaserver/rbprm/__init__.py @@ -1,7 +1 @@ -import omniORB -omniORB.updateModule("hpp.corbaserver.rbprm") - -import rbprmbuilder_idl - from client import Client - diff --git a/src/hpp/corbaserver/rbprm/client.py b/src/hpp/corbaserver/rbprm/client.py index eb3dd49d4fa17b8a06446a53f7627b89835c711d..1e0fc144ffeefb42d8c955ee9cf23d11bb32767a 100755 --- a/src/hpp/corbaserver/rbprm/client.py +++ b/src/hpp/corbaserver/rbprm/client.py @@ -17,51 +17,29 @@ # hpp-manipulation-corba. If not, see # <http://www.gnu.org/licenses/>. -from omniORB import CORBA -import CosNaming +from hpp.corbaserver.client import Client as _Parent +from hpp_idl.hpp.corbaserver.rbprm import RbprmBuilder -from hpp.corbaserver.rbprm import RbprmBuilder - -class CorbaError(Exception): - """ - Raised when a CORBA error occurs. - """ - def __init__(self, value): - self.value = value - def __str__(self): - return repr(self.value) - -class Client: +class Client (_Parent): """ Connect and create clients for hpp-rbprm library. """ - def __init__(self): + + defaultClients = { + 'rbprmbuilder' : RbprmBuilder, + } + + def __init__(self, url = None, context = "corbaserver"): """ Initialize CORBA and create default clients. + :param url: URL in the IOR, corbaloc, corbalocs, and corbanames formats. + For a remote corba server, use + url = "corbaloc:iiop:<host>:<port>/NameService" """ - import sys - self.orb = CORBA.ORB_init (sys.argv, CORBA.ORB_ID) - obj = self.orb.resolve_initial_references("NameService") - self.rootContext = obj._narrow(CosNaming.NamingContext) - if self.rootContext is None: - raise CorbaError ('failed to narrow the root context') - - # client of Rbprm interface - name = [CosNaming.NameComponent ("hpp", "corbaserver"), - CosNaming.NameComponent ("rbprm", "rbprmbuilder")] - - try: - obj = self.rootContext.resolve (name) - except CosNaming.NamingContext.NotFound, ex: - raise CorbaError ('failed to find rbprm service.') - try: - client = obj._narrow (RbprmBuilder) - except KeyError: - raise CorbaError ('invalid service name rbprm') - - if client is None: - # This happens when stubs from client and server are not synchronized. - raise CorbaError ( - 'failed to narrow client for service rbprm') - self.rbprm = client + self._initOrb (url) + self._makeClients ("rbprm", self.defaultClients, context) + # self.rbprmbuilder is created by self._makeClients + # The old code stored the object as self.rbprm + # Make it backward compatible. + self.rbprm = self.rbprmbuilder diff --git a/src/rbprmbuilder.impl.cc b/src/rbprmbuilder.impl.cc index b82a0a66a9ab0afeef0834642922e01bf732dc72..cb25f6efcbe1a5303e7ed89ac3205b49c7781427 100644 --- a/src/rbprmbuilder.impl.cc +++ b/src/rbprmbuilder.impl.cc @@ -17,7 +17,7 @@ //#include <hpp/fcl/math/transform.h> #include <hpp/util/debug.hh> -#include <hpp/corbaserver/rbprm/rbprmbuilder.hh> +#include <hpp/corbaserver/rbprm/rbprmbuilder-idl.hh> #include "rbprmbuilder.impl.hh" #include "hpp/rbprm/rbprm-device.hh" #include "hpp/rbprm/rbprm-validation.hh" diff --git a/src/rbprmbuilder.impl.hh b/src/rbprmbuilder.impl.hh index 9e9ff7b3e93036aad80766a16f18ea47984945e9..4abbbb68380334045b06bfe887aa0724039cd5f6 100644 --- a/src/rbprmbuilder.impl.hh +++ b/src/rbprmbuilder.impl.hh @@ -20,7 +20,7 @@ # include <hpp/core/problem-solver.hh> # include <hpp/core/path.hh> -# include "rbprmbuilder.hh" +# include "hpp/corbaserver/rbprm/rbprmbuilder-idl.hh" # include <hpp/rbprm/rbprm-device.hh> # include <hpp/rbprm/rbprm-fullbody.hh> # include <hpp/rbprm/rbprm-shooter.hh>