Basic RT components and utilities  315.12.1
Classes | Functions | Variables
python::rtm Namespace Reference

Classes

class  RTcomponent
 wrapper class of RT component More...
class  RTCmanager
 wrapper class of RTCmanager More...

Functions

def unbindObject
 unbind an object reference
def initCORBA
 initialize ORB
def getRootNamingContext
 get root naming context
def findObject
 get IOR of the object
def findRTCmanager
 get RTCmanager
def findRTC
 get RT component
def findPort
 get a port of RT component
def serializeComponents
 set up execution context of the first RTC so that RTCs are executed sequentially
def isConnected
 check two ports are connected or not
def disconnectPorts
 disconnect ports
def dataTypeOfPort
 get data type of a port
def connectPorts
 connect ports
def data2cdr
 convert data into CDR format
def classFromString
 get class object from class name
def cdr2data
 convert data from CDR format
def writeDataPort
 write data to a data port
def readDataPort
 read data from a data port
def findService
 get a service of RT component
def setConfiguration
 update default configuration set
def narrow
 narrow ior
def isJython
 check if jython or python

Variables

 rootnc = None
 root naming context
 nshost = None
 nsport = None

Function Documentation

def python.rtm.cdr2data (   cdr,
  classname 
)

convert data from CDR format

Parameters:
cdrin CDR format
classnameclass name of the data
Returns:
converted data

References classFromString().

Referenced by readDataPort().

def python.rtm.classFromString (   fullname)

get class object from class name

Parameters:
fullnameclass name
Returns:
class object

Referenced by cdr2data().

def python.rtm.connectPorts (   outP,
  inPs,
  subscription = "flush",
  dataflow = "Push",
  bufferlength = 1,
  rate = 1000,
  pushpolicy = "new",
  interfaceType = "corba_cdr" 
)

connect ports

Parameters:
outPIOR of outPort
inPsan IOR or a list of IORs of inPort
subscriptionsubscription type. "flush", "new" or "periodic"
dataflowdataflow type. "Push" or "Pull"
bufferlengthlength of data buffer
ratecommunication rate for periodic mode[Hz]

References dataTypeOfPort(), and isConnected().

Referenced by python.hrpsys_config.HrpsysConfigurator.connectComps(), and python.hrpsys_config.HrpsysConfigurator.connectLoggerPort().

def python.rtm.data2cdr (   data)

convert data into CDR format

Parameters:
datadata to be converted
Returns:
converted data in CDR format

Referenced by writeDataPort().

def python.rtm.dataTypeOfPort (   port)

get data type of a port

Parameters:
portIOR of port
Returns:
data type

Referenced by connectPorts().

def python.rtm.disconnectPorts (   outP,
  inP 
)

disconnect ports

Parameters:
outPIOR of outPort
inPIOR of inPort
Returns:
True disconnected successfully, False otherwise
def python.rtm.findObject (   name,
  kind = "",
  rnc = None 
)

get IOR of the object

Parameters:
namename of the object
kindkind of the object
rncroot naming context. If it is not specified, global variable rootnc is used
Returns:
IOR of the object

Referenced by findRTC(), and findRTCmanager().

def python.rtm.findPort (   rtc,
  name 
)

get a port of RT component

Parameters:
rtcan object of RTcomponent
namename of the port
Returns:
IOR of the port if the port is found, None otherwise

Referenced by python.rtm.RTcomponent.port().

def python.rtm.findRTC (   name,
  rnc = None 
)

get RT component

Parameters:
namename of the RT component
rncroot naming context. If it is not specified, global variable rootnc is used
Returns:
an object of RTcomponent

References findObject().

Referenced by python.hrpsys_config.HrpsysConfigurator.checkSimulationMode(), python.rtm.RTCmanager.create(), and python.rtm.RTCmanager.delete().

def python.rtm.findRTCmanager (   hostname = None,
  rnc = None 
)

get RTCmanager

Parameters:
hostnamehostname where rtcd is running
rncroot naming context. If it is not specified, global variable rootnc is used
Returns:
an object of RTCmanager

References findObject().

def python.rtm.findService (   rtc,
  port_name,
  type_name,
  instance_name 
)

get a service of RT component

Parameters:
rtcIOR of RT component
port_nameport name of the port which provides the service
type_nametype name of the service
instance_namename of the service
Returns:
IOR of the service

Referenced by python.rtm.RTcomponent.service().

def python.rtm.getRootNamingContext (   corbaloc)

get root naming context

Parameters:
corbaloclocation of NamingService
Returns:
root naming context

initialize ORB

Referenced by isJython().

def python.rtm.isConnected (   outP,
  inP 
)

check two ports are connected or not

Return values:
Trueconnected
Falsenot connected

Referenced by connectPorts().

check if jython or python

Returns:
True if jython

References initCORBA().

def python.rtm.narrow (   ior,
  klass,
  package = "OpenHRP" 
)

narrow ior

Parameters:
iorior
klassclass name
packagepackage where the class is defined

Referenced by python.hrpsys_config.HrpsysConfigurator.checkSimulationMode(), python.hrpsys_config.HrpsysConfigurator.createComp(), and python.hrpsys_config.HrpsysConfigurator.findComp().

def python.rtm.readDataPort (   port,
  timeout = 1.0 
)

read data from a data port

Parameters:
portreference of data port
timeouttimeout[s]
Returns:
data

References cdr2data().

def python.rtm.serializeComponents (   rtcs,
  stopEC = True 
)

set up execution context of the first RTC so that RTCs are executed sequentially

Parameters:
rtcssequence of RTCs
stopECwhether stop owned ECs of slave components
def python.rtm.setConfiguration (   rtc,
  nvlist 
)

update default configuration set

Parameters:
rtcIOR of RT component
nvlistlist of pairs of name and value
Returns:
True if all values are set correctly, False otherwise
def python.rtm.unbindObject (   name,
  kind 
)

unbind an object reference

Parameters:
namename of the object
kindkind of the object
def python.rtm.writeDataPort (   port,
  data,
  tm = 1.0,
  disconnect = True 
)

write data to a data port

Parameters:
portreference of data port
datadata to be written
tmIf disconnect==True, a connection to write data is disconnected after this time
disconnectIf True, a connection is disconnected after tm and if not, the connection must be disconnected by a user

References data2cdr().


Variable Documentation

root naming context