Commit d653edd0 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Use environment variable HPP_HOST and HPP_PORT to connect to remote server

parent af2a39fc
......@@ -18,6 +18,7 @@
from omniORB import CORBA
import CosNaming
from hpp.corbaserver.client import _getIIOPurl
from hpp.corbaserver.wholebody_step import Problem
class CorbaError(Exception):
......@@ -33,13 +34,16 @@ class Client:
"""
Connect and create clients for hpp-wholebody-step-planner library.
"""
def __init__(self):
def __init__(self, url = None):
"""
Initialize CORBA and create default clients.
"""
import sys
self.orb = CORBA.ORB_init (sys.argv, CORBA.ORB_ID)
obj = self.orb.resolve_initial_references("NameService")
if url is None:
obj = self.orb.string_to_object (_getIIOPurl ())
else:
obj = self.orb.string_to_object (url)
self.rootContext = obj._narrow(CosNaming.NamingContext)
if self.rootContext is None:
raise CorbaError ('failed to narrow the root context')
......
Supports Markdown
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