Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataWriter loan_sample #197

Open
SilverIce opened this issue Nov 26, 2024 · 0 comments
Open

DataWriter loan_sample #197

SilverIce opened this issue Nov 26, 2024 · 0 comments

Comments

@SilverIce
Copy link

SilverIce commented Nov 26, 2024

Hello,

I’m trying to use the standard “Hello World” Python example provided in the documentation to implement the zero-copy approach. I’m not entirely sure if I am passing the arguments correctly or if there is an actual problem. Before I provide more details, my question is: Does the Python API support the zero-copy approach?

I encountered the following issue:

        self.writer: fastdds.DataWriter = self.publisher.create_datawriter(self.topic, self.writer_qos, self.listener)
        sample_ptr = ctypes.c_void_p()
        sample_ptr_ref = ctypes.byref(sample_ptr)
        # here I assume the result is error_code
        result = self.writer.loan_sample(sample_ptr_ref)
  File "/home/daniel/dev/misc/fastdds/FastDDSGenHelloWorld/HelloWorldPublisher.py", line 96, in write_zc
    res, data = self.writer.loan_sample(sample_ptr_ref)
  File "/home/daniel/dev/misc/fastdds/fastddspython/install/fastdds_python/lib/python3.10/site-packages/fastdds/__init__.py", line 6038, in loan_sample
    return _fastdds_python.DataWriter_loan_sample(self, *args)
TypeError: in method 'DataWriter_loan_sample', argument 2 of type 'void *&'

Thank you.

P.S. I use latest master from https://raw.githubusercontent.com/eProsima/Fast-DDS-python/main/fastdds_python.repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant