velodyne_points with timesync
Hi, I have three point cloud topics and want to use time sync, i.e. message filter, to sync and read them.
But I get a huge error. This is the part where I define the subscriber.
sub_HDL_1 = new message_filters::Subscriber<VPointCloud>(nh, "HDL_1/velodyne_points", 1);
sub_HDL_2 = new message_filters::Subscriber<VPointCloud>(nh, "HDL_2/velodyne_points", 1);
sub_VLP = new message_filters::Subscriber<VPointCloud>(nh, "VLP/velodyne_points", 1);
timesync = new message_filters::TimeSynchronizer<VPointCloud, VPointCloud, VPointCloud>(*sub_HDL_1, *sub_HDL_2, *sub_VLP, 50);
timesync->registerCallback(boost::bind(&myclass::dataReceived, this, _1, _2, _3));
> error: could not convert ‘m.pcl::PointCloud<velodyne_pointcloud::PointXYZIR>::header.pcl::PCLHeader::stamp’ from ‘const uint64_t {aka const long unsigned int}’ to ‘ros::Time’
static ros::Time value(const M& m) { return m.header.stamp; }
Has someone done this before or have any idea how to solve it? Thanks in advance.
The ROS message header has a
ros::Time stamp
, while PCL now has its ownuint64_t stamp
, a different type. The pcl_ros package provides some translation between the two. I don't see a message filter there, however.Are you trying to combine complete rotational scans from all three devices? That probably won't work very well. Maybe it would help if you explain what you are trying to achieve.
hi thanks. I have a seperate visualisation app and i want to pass the topics to this program to see all the point clouds from the velodynes. So if i can have a message filter then I can sync them in time.
It would probably work better to display each scan message when it arrives (separately), showing it for some reasonable duration, depending on rotational rate (100ms, or maybe 200ms for the default 10Hz spin rate). I believe that is how
rviz
does it.