Jump to content
OpenSplice DDS Forum
Sign in to follow this  
Jami

a trouble when using waitForConditions method of Waiset class

Recommended Posts

Jami   

Hello,

I'm a new user of opensplice DDS...i'm working with Vortex Opensplice HDE Release 6.8.2.

i'm developing a Python script to write/read data to/from Vortex Opensplice Tester.

To read the samples, I'm using waitForConditions() method of WaitSet class. This method needs two parameters a collection of conditions to be satisfied and a timeout...the problem i'm facing with this method is that it's always generating the timeout exception without any consideration for the defined conditions.

when  i activate the commented line in the code,  i can read my data. (with commenting waitForConditions() line)Test_bis.py

hereafter, a piece of code i'm testing :

topic = osplscript.dds.findTopic(MyClass.topic_name)

rd =osplscript.dds.Reader(topic)

selector = rd.newSelectBuilder().withAlive().withNotRead().withNew()\

.content('Car.temp = self.temp  and Car.Hum=self.hum')\

.build()

ws=osplscript.dds.WaitSet( )

#ws.attachCondition(selector.condition()) ==> this works fine solely,  without waitForConditions()

try
    timeout_duration = osplscript.qos.Duration(2,0)
    ws.waitForConditions(selector.condition(),timeout_duration)
    topic_sample = selector.take()
    ...
except osplscript.dds.TimeoutException as timeout_exception
    print timeout_exception.message

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×