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

Variables

 rootnc = None
 root naming context More...
 
 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 python.rtm.classFromString().

Referenced by python.rtm.readDataPort().

def python.rtm.classFromString (   fullname)

get class object from class name

Parameters
fullnameclass name
Returns
class object

Referenced by python.rtm.cdr2data().

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

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

References python.rtm.dataTypeOfPort(), and python.rtm.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 python.rtm.writeDataPort().

def python.rtm.dataTypeOfPort (   port)

get data type of a port

Parameters
portIOR of port
Returns
data type

Referenced by python.rtm.connectPorts().

def python.rtm.disconnectPorts (   outP,
  inP 
)

disconnect ports

Parameters
outPIOR of outPort
inPIOR of inPort
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 python.rtm.findRTC(), and python.rtm.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 python.rtm.findObject().

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

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 python.rtm.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
def python.rtm.initCORBA ( )
def python.rtm.isConnected (   outP,
  inP 
)

check two ports are connected or not

Return values
Trueconnected
Falsenot connected

Referenced by python.rtm.connectPorts().

def python.rtm.isJython ( )

check if jython or python

Returns
True if jython

References python.rtm.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 python.rtm.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 python.rtm.data2cdr().

Variable Documentation

python.rtm.nshost = None
python.rtm.nsport = None
python.rtm.rootnc = None

root naming context