Unverified Commit 15b94f1d authored by stonneau's avatar stonneau Committed by GitHub
Browse files

Merge pull request #22 from jmirabel/devel

Update to changes in hpp-corbaserver. 
parents 197ad257 e4b0b86f
Subproject commit 320c636960b03b3bad7c7a08bd2e104951f42bc3 Subproject commit 8f68dc14b0dbc92ea376794d6c7d71f9a8648098
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#ifndef HPP_RBPRM_CORBA_BUILDER_IDL #ifndef HPP_RBPRM_CORBA_BUILDER_IDL
# define HPP_RBPRM_CORBA_BUILDER_IDL # define HPP_RBPRM_CORBA_BUILDER_IDL
# include <hpp/corbaserver/common.idl> # include <hpp/common.idl>
module hpp module hpp
{ {
......
#!/bin/bash #!/bin/bash
gepetto-viewer-server & gepetto-gui &
hpp-rbprm-server & hpp-rbprm-server &
ipython -i --no-confirm-exit ./$1 ipython -i --no-confirm-exit ./$1
pkill -f 'gepetto-viewer-server' pkill -f 'gepetto-gui'
pkill -f 'hpp-rbprm-server' pkill -f 'hpp-rbprm-server'
#!/bin/bash #!/bin/bash
gepetto-viewer-server & gepetto-gui &
ipython -i --no-confirm-exit ./$1 ipython -i --no-confirm-exit ./$1
pkill -f 'gepetto-viewer-server' pkill -f 'gepetto-gui'
...@@ -20,10 +20,6 @@ SET(IDL_SOURCES ...@@ -20,10 +20,6 @@ SET(IDL_SOURCES
rbprmbuilder rbprmbuilder
) )
SET(HPP_CORBASERVER_IDL_SOURCES
common
)
OMNIIDL_INCLUDE_DIRECTORIES( OMNIIDL_INCLUDE_DIRECTORIES(
${HPP_CORBASERVER_DATAROOTDIR}/idl ${CMAKE_SOURCE_DIR}/idl ${HPP_CORBASERVER_DATAROOTDIR}/idl ${CMAKE_SOURCE_DIR}/idl
) )
...@@ -33,46 +29,33 @@ FINDPYTHON(2.7 EXACT REQUIRED) ...@@ -33,46 +29,33 @@ FINDPYTHON(2.7 EXACT REQUIRED)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/src)
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm) 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}) FOREACH(IDL ${IDL_SOURCES})
GENERATE_IDL_CPP (hpp/corbaserver/rbprm/${IDL} GENERATE_IDL_CPP (hpp/corbaserver/rbprm/${IDL}
${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm) ${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm
GENERATE_IDL_PYTHON (hpp/corbaserver/rbprm/${IDL} HEADER_SUFFIX -idl.hh)
${CMAKE_SOURCE_DIR}/idl/hpp/corbaserver/rbprm) 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( 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) 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() 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 ADD_LIBRARY(${LIBRARY_NAME} SHARED
common.hh ${ALL_IDL_CPP_STUBS}
commonSK.cc
${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/rbprmbuilder.hh
${CMAKE_CURRENT_BINARY_DIR}/hpp/corbaserver/rbprm/rbprmbuilderSK.cc
rbprmbuilder.impl.cc rbprmbuilder.impl.cc
rbprmbuilder.impl.hh rbprmbuilder.impl.hh
server.cc server.cc
......
import omniORB
omniORB.updateModule("hpp.corbaserver.rbprm")
import rbprmbuilder_idl
from client import Client from client import Client
...@@ -17,51 +17,29 @@ ...@@ -17,51 +17,29 @@
# hpp-manipulation-corba. If not, see # hpp-manipulation-corba. If not, see
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
from omniORB import CORBA from hpp.corbaserver.client import Client as _Parent
import CosNaming from hpp_idl.hpp.corbaserver.rbprm import RbprmBuilder
from hpp.corbaserver.rbprm import RbprmBuilder class Client (_Parent):
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:
""" """
Connect and create clients for hpp-rbprm library. 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. 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._initOrb (url)
self.orb = CORBA.ORB_init (sys.argv, CORBA.ORB_ID) self._makeClients ("rbprm", self.defaultClients, context)
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.rbprmbuilder is created by self._makeClients
# The old code stored the object as self.rbprm
# Make it backward compatible.
self.rbprm = self.rbprmbuilder
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
//#include <hpp/fcl/math/transform.h> //#include <hpp/fcl/math/transform.h>
#include <hpp/util/debug.hh> #include <hpp/util/debug.hh>
#include <hpp/corbaserver/rbprm/rbprmbuilder.hh> #include <hpp/corbaserver/rbprm/rbprmbuilder-idl.hh>
#include "rbprmbuilder.impl.hh" #include "rbprmbuilder.impl.hh"
#include "hpp/rbprm/rbprm-device.hh" #include "hpp/rbprm/rbprm-device.hh"
#include "hpp/rbprm/rbprm-validation.hh" #include "hpp/rbprm/rbprm-validation.hh"
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# include <hpp/core/problem-solver.hh> # include <hpp/core/problem-solver.hh>
# include <hpp/core/path.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-device.hh>
# include <hpp/rbprm/rbprm-fullbody.hh> # include <hpp/rbprm/rbprm-fullbody.hh>
# include <hpp/rbprm/rbprm-shooter.hh> # include <hpp/rbprm/rbprm-shooter.hh>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment