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

image,Uint8array,Subscribe,slow #960

Open
Tombliboo96 opened this issue May 7, 2024 · 1 comment
Open

image,Uint8array,Subscribe,slow #960

Tombliboo96 opened this issue May 7, 2024 · 1 comment
Assignees
Labels

Comments

@Tombliboo96
Copy link

Description
Hello, may I ask if there are any optimization methods for receiving high-pixel image data streams in SensorMsg?
I am currently using rclnodejs to receive C++ parse a 12000000 pixel Uint8array. The speed is slow, about 6-9FPS. I found that the deserialization operation in Wrapper is slow.
this._wrapperFields.data.copyRefObject(refObject.data);

At the same time, when I want to send image data through ROS memory sharing, the deserialization code for Uint8array in ImageWrapper generated from MSG files takes a long time. Is there any operation that can quickly receive a large amount of image data?

    this._refObject.data = refObject.data;
    this._wrapperFields.data.fill(refObject.data.toArray());
  • Library Version:
  • ROS Version:
  • Platform / OS:

Steps To Reproduce

Expected Behavior

Actual Behavior

@Tombliboo96 Tombliboo96 added the bug label May 7, 2024
@minggangw minggangw self-assigned this May 8, 2024
@minggangw
Copy link
Member

What's in my mind is you can set enableTypedArray to true when creating a subscription (the default is true), it will avoid allocating memory when passing the data across the language boundary from C++ to JavaScript, please check the doc https://robotwebtools.github.io/rclnodejs/docs/0.26.0/Node.html
image

rclnodejs doesn't support memory sharing, please also check out some discussion here.

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

No branches or pull requests

2 participants