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

Subscription for PointCloud2 is not working #726

Open
apoorvcn47 opened this issue May 8, 2024 · 3 comments
Open

Subscription for PointCloud2 is not working #726

apoorvcn47 opened this issue May 8, 2024 · 3 comments
Labels

Comments

@apoorvcn47
Copy link

apoorvcn47 commented May 8, 2024

Description
I am trying subscribe to a Pointcloud2 topic but my subscription callback function never triggers. Similar styled subsciptions work for Image and MarkerArray topics.

let pc_topic = new ROSLIB.Topic(
{
    ros : ros,
    // name : '/camera/color/image_raw',
    // messageType : 'sensor_msgs/msg/Image',
    name : '/camera/depth_registered/points',
    messageType : 'sensor_msgs/msg/PointCloud2',
    // name : '/rviz/pallet1',
    // messageType : 'visualization_msgs/MarkerArray',
    // latch : true
});
// render_ob.create_pointcloud_sub(pc_topic);
pc_topic.subscribe(function(message) 
{
    console.log('message.width');
    console.log(message.width);
    console.log(message.height);
});

I was wondering if anyone has come across this.

  • Library Version: v2
  • ROS Version: Humble
  • Platform / OS: Ubuntu 22.04
@apoorvcn47 apoorvcn47 added the bug label May 8, 2024
@spxvszero
Copy link

try 'sensor_msgs/PointCloud2' instead of 'sensor_msgs/msg/PointCloud2'

@apoorvcn47
Copy link
Author

try 'sensor_msgs/PointCloud2' instead of 'sensor_msgs/msg/PointCloud2'

I tried both. It doesn't make a difference.

@MatthijsBurgh
Copy link
Contributor

I suggest you start with the simple example and start adding changes, not all at the same, just as minimal as possible.

And you should indeed use sensor_msgs/PointCloud2'.

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

3 participants