Trouble subscribing to pointclouds [closed]

asked 2016-02-03 23:50:21 -0500

jhlim6 gravatar image

Hi, I am having troubling using the ROS's sensor_msg to send pointclouds over nodes. From RVIS, i can see the pointcloud being published, and the rqt_graph shows that the subscriber has subscribed to the publisher, but the subscriber is not entering the subscriber callback function.

Please help. I've also tried sending pointclouds directly following example, but the same issue arises.

Below is my code using sensor_msgs

ros::Subscriber sub = nh.subscribe<sensor_msgs::pointcloud2>("/ensenso/depth/points", 2, callback); void callback(const sensor_msgs::PointCloud2ConstPtr& cloud) { ROS_INFO ("inside callback"); }

void sender ( const boost::shared_ptr<pcl::pointcloud<pcl::pointxyz> >& cloud) { sensor_msgs::PointCloud2 cloud_msg; pcl::toROSMsg (* cloud, cloud_msg); cloud_pub_.publish(cloud_msg); }

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by jhlim6
close date 2016-02-04 03:28:28.375234


Can you show more code? Where do you do a ros::spin() in the client?

NEngelhard gravatar image NEngelhard  ( 2016-02-04 02:53:29 -0500 )edit

Hi NEngelhard,

I realized that my code is not so comprehensible here, so I asked another qns where i posted the test code.

jhlim6 gravatar image jhlim6  ( 2016-02-04 03:27:51 -0500 )edit

You could just update the question here so that no moderator has to close this question here.

NEngelhard gravatar image NEngelhard  ( 2016-02-04 04:16:04 -0500 )edit