Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 55

Pointcloud is only being published playing a certain bagfile

$
0
0
I'm writing a node that subscribes to rectified stereo images from stereo_image_proc and the camera_info from the camera node. It processes the images (using openCV) to compute and publish the camera pose as message and to /tf. Also I publish two image topics and a pointcloud topic. The problem is it only works with one older bagfile I recorded. When I use another bagfile I recorded recently it does not publish the pointcloud and `rostopic echo /pointcloud` results in: WARNING: no messages received and simulated time is active. Is /clock being published? I tried it with `use_sim_time` set as both true or false (and using `rosbag play --clock`). The only differences between the bags are that the older bag was recorded on another laptop running groovy or hydro. The topics where in another namespace but I adjusted everything so that my node receives and processes the rectified images correctly (by remapping, no recompiling of the node). Also when I try to let the node run with live images fed from the camera it receives and processes them but I can't publish my pointcloud. Even publishing a static pointcloud does not work athough it works while playing the old bagfile. Oh and the bagfiles only contain the topics from the camera node (images, camera_info), `/rosout` and `/rosout_agg`. The rqt_graphs look the same for both the old and new bagfiles. This is part of my code: typedef pcl::PointXYZ PointT; typedef pcl::PointCloud PointCloud; class VisualOdometer { ros::Publisher pcPub_; std::vector map_; string worldFrame_; ... VisualOdometer(...) { ... ros::NodeHandle nh; pcPub_ = nh.advertise("pointcloud", 50); ... } void publishPC() { PointCloud pointCloud; pointCloud.height = 1; pointCloud.width = map_.size(); for (unsigned int i = 0; i < map_.size(); ++i) { pointCloud.points.push_back(PointT(map_[i].x, map_[i].y, map_[i].z)); } pointCloud.header.frame_id = worldFrame_; pointCloud.header.stamp = ros::Time::now().toNSec(); pcPub_.publish(pointCloud); } } Does anyone have an idea why it's only working with the older bagfile? It seems that my node is not the problem or maybe somehow the way it manages time related stuff?

Viewing all articles
Browse latest Browse all 55

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>