Skip to content

Improving node subscription frequency #916

@gmp-capgemini

Description

@gmp-capgemini

This might be more a question than a feature, but I am not getting help anywhere else. I apologize in advance.

I've got a subscription to a camera (sensor_msgs/msg/Image) as I am using rclnodejs to make a real-time camera display. Even though the topic publishing the camera image is approximately 30 fps, I receive approximately 8 fps. Both publisher and subscriber are on the same host (my laptop), no network involved / no latency involved. It would be nice being able to improve the frequency of received messages for a subscription. I'm just using a basic call to createSubscription with an fps_counter (value displayed every second and then resetted):

const node_sub = new rclnodejs.Node('subscription_example_node');
  node_sub.createSubscription('sensor_msgs/msg/Image', 'rgb_front/image', (msg) => {
    console.log(`Received message: ${typeof msg}`, msg);
    fps_counter1++;
  });
  node_sub.spin();

The link for the on-line documentation is not working. Also executing npm run docs . as suggested by the README of the repo did not work either. I had a view at the implementation of Node.createSubscription and as far as I understood there's an option about QoS, but I could not understand how it works.

Please, lend me a hand with this in case it can be improved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions