eclipse-cyclonedds / eclipse-cyclonedds/cyclonedds-python

TimeBasedFilter Policy Not Functional

Open
#193 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
110
Forks
68
Avg merge
1h 8m
Merged PRs (30d)
1

Description

cyclonedds version = 0.10.3
cyclonedds-python version = 0.10.2

Assuming I understand the use case for the TimeBasedFilter QoS, I have been unable to get the TimeBasedFilter QoS policy to work. I have not experimented with the base C implementation or the C++ binding.

For a sanity check, I altered examples/vehicle, but I uncovered the problem in my specific application.

Expected behavior: subscriber.py prints the topic at approximately 1 Hz.
Actual behavior: subscriber.py prints the topic at approximately 10 Hz.

# Removed specific Topic QoS, using default.

domain_participant = DomainParticipant(0)
topic = Topic(domain_participant, 'Vehicle', Vehicle)
publisher = Publisher(domain_participant)
writer = DataWriter(publisher, topic)


vehicle = Vehicle(name="Dallara IL-15", x=200, y=200)


while True:
    vehicle.x += random.choice([-1, 0, 1])
    vehicle.y += random.choice([-1, 0, 1])
    writer.write(vehicle)
    print(">> Wrote vehicle")
    time.sleep(0.1)  # Changed to achieve ~ 10 Hz publish rate
class MyListener(Listener):
    def on_liveliness_changed(self, reader, status):
        print(">> Liveliness event")


listener = MyListener()

# Removed specific Topic QoS, using default.

reader_qos = Qos(
    Policy.TimeBasedFilter(duration(seconds=1))
)

domain_participant = DomainParticipant(0)
topic = Topic(domain_participant, 'Vehicle', Vehicle)
subscriber = Subscriber(domain_participant)
reader = DataReader(domain_participant, topic, reader_qos, listener=listener)


for sample in reader.take_iter(timeout=duration(seconds=2)):
    print(sample, datetime.now()) 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported behavior with the altered examples/vehicle publisher.py and subscriber.py, using the stated CycloneDDS and cyclonedds-python versions. Trace how the TimeBasedFilter QoS is applied to the DataReader and verify that subscriber.py receives approximately 1 Hz rather than 10 Hz when the fix is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.