Basic RT components and utilities  315.15.0
Classes | Functions | Variables
python.rtm Namespace Reference

Classes

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

Functions

def unbindObject (name, kind)
 unbind an object reference More...
 
def initCORBA ()
 initialize ORB More...
 
def getRootNamingContext (corbaloc)
 get root naming context More...
 
def findObject (name, kind="", rnc=None)
 get IOR of the object More...
 
def findRTCmanager (hostname=None, rnc=None)
 get RTCmanager More...
 
def findRTC (name, rnc=None)
 get RT component More...
 
def findPort (rtc, name)
 get a port of RT component More...
 
def serializeComponents (rtcs, stopEC=True)
 set up execution context of the first RTC so that RTCs are executed sequentially More...
 
def isConnected (outP, inP)
 check two ports are connected or not More...
 
def disconnectPorts (outP, inP)
 disconnect ports More...
 
def dataTypeOfPort (port)
 get data type of a port More...
 
def connectPorts (outP, inPs, subscription="flush", dataflow="Push", bufferlength=1, rate=1000, pushpolicy="new", interfaceType="corba_cdr")
 connect ports More...
 
def data2cdr (data)
 convert data into CDR format More...
 
def classFromString (fullname)
 get class object from class name More...
 
def cdr2data (cdr, classname)
 convert data from CDR format More...
 
def writeDataPort (port, data, tm=1.0, disconnect=True)
 write data to a data port More...
 
def readDataPort (port, timeout=1.0, disconnect=True)
 read data from a data port More...
 
def deleteAllConnector ()
 
def findService (rtc, port_name, type_name, instance_name)
 get a service of RT component More...
 
def setConfiguration (rtc, nvlist)
 update default configuration set More...
 
def getConfiguration (rtc)
 get default configuration set More...
 
def narrow (ior, klass, package="OpenHRP")
 narrow ior More...
 
def isJython ()
 check if jython or python More...
 

Variables

 rootnc = None
 root naming context More...
 
 nshost = None
 
 nsport = None
 
list connector_list = []
 

Function Documentation

◆ cdr2data()

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().

◆ classFromString()

def python.rtm.classFromString (   fullname)

get class object from class name

Parameters
fullnameclass name
Returns
class object

Referenced by python.rtm.cdr2data().

◆ connectPorts()

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

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

◆ data2cdr()

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().

◆ dataTypeOfPort()

def python.rtm.dataTypeOfPort (   port)

get data type of a port

Parameters
portIOR of port
Returns
data type

Referenced by python.rtm.connectPorts().

◆ deleteAllConnector()

def python.rtm.deleteAllConnector ( )

◆ disconnectPorts()

def python.rtm.disconnectPorts (   outP,
  inP 
)

disconnect ports

Parameters
outPIOR of outPort
inPIOR of inPort
Returns
True disconnected successfully, False otherwise

◆ findObject()

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().

◆ findPort()

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().

◆ findRTC()

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(), python.rtm.RTCmanager.create(), and python.rtm.RTCmanager.delete().

◆ findRTCmanager()

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().

◆ findService()

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().

◆ getConfiguration()

def python.rtm.getConfiguration (   rtc)

get default configuration set

Parameters
rtcIOR of RT component
Returns
default configuration set

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

◆ getRootNamingContext()

def python.rtm.getRootNamingContext (   corbaloc)

get root naming context

Parameters
corbaloclocation of NamingService
Returns
root naming context

◆ initCORBA()

def python.rtm.initCORBA ( )

◆ isConnected()

def python.rtm.isConnected (   outP,
  inP 
)

check two ports are connected or not

Return values
Trueconnected
Falsenot connected

Referenced by python.rtm.connectPorts().

◆ isJython()

def python.rtm.isJython ( )

check if jython or python

Returns
True if jython

References python.rtm.initCORBA().

◆ narrow()

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().

◆ readDataPort()

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

read data from a data port

Parameters
portreference of data port
timeouttimeout[s]
Returns
data

References python.rtm.cdr2data().

◆ serializeComponents()

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

◆ setConfiguration()

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

◆ unbindObject()

def python.rtm.unbindObject (   name,
  kind 
)

unbind an object reference

Parameters
namename of the object
kindkind of the object

◆ writeDataPort()

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

◆ connector_list

list python.rtm.connector_list = []

◆ nshost

python.rtm.nshost = None

◆ nsport

python.rtm.nsport = None

◆ rootnc

python.rtm.rootnc = None

root naming context