Skip to content

Commit

Permalink
adds an option parameter pushpolicy to connectPorts()
Browse files Browse the repository at this point in the history
  • Loading branch information
fkanehiro committed Nov 25, 2014
1 parent ff6816b commit 1e7aaa7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/rtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def dataTypeOfPort(port):
# \param bufferlength length of data buffer
# \param rate communication rate for periodic mode[Hz]
#
def connectPorts(outP, inPs, subscription="flush", dataflow="Push", bufferlength=1, rate=1000):
def connectPorts(outP, inPs, subscription="flush", dataflow="Push", bufferlength=1, rate=1000, pushpolicy="new"):
if not isinstance(inPs, list):
inPs = [inPs]
if not outP:
Expand All @@ -508,9 +508,10 @@ def connectPorts(outP, inPs, subscription="flush", dataflow="Push", bufferlength
nv3 = SDOPackage.NameValue("dataport.subscription_type", any.to_any(subscription))
nv4 = SDOPackage.NameValue("dataport.buffer.length", any.to_any(str(bufferlength)))
nv5 = SDOPackage.NameValue("dataport.publisher.push_rate", any.to_any(str(rate)))
nv6 = SDOPackage.NameValue("dataport.data_type", any.to_any(dataTypeOfPort(outP)))
nv6 = SDOPackage.NameValue("dataport.publisher.push_policy", any.to_any(pushpolicy))
nv7 = SDOPackage.NameValue("dataport.data_type", any.to_any(dataTypeOfPort(outP)))
con_prof = RTC.ConnectorProfile("connector0", "", [outP, inP],
[nv1, nv2, nv3, nv4, nv5, nv6])
[nv1, nv2, nv3, nv4, nv5, nv6, nv7])
print '[rtm.py] Connect ' + outP.get_port_profile().name + ' - ' + \
inP.get_port_profile().name
ret, prof = inP.connect(con_prof)
Expand Down

0 comments on commit 1e7aaa7

Please sign in to comment.