PCL Header timestamp
The pcl_ros tutorial example doesn't work:
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>
typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
int main(int argc, char** argv)
{
ros::init (argc, argv, "pub_pcl");
ros::NodeHandle nh;
ros::Publisher pub = nh.advertise<PointCloud> ("points2", 1);
PointCloud::Ptr msg (new PointCloud);
msg->header.frame_id = "some_tf_frame";
msg->height = msg->width = 1;
msg->points.push_back (pcl::PointXYZ(1.0, 2.0, 3.0));
ros::Rate loop_rate(4);
while (nh.ok())
{
msg->header.stamp = ros::Time::now ();
pub.publish (msg);
ros::spinOnce ();
loop_rate.sleep ();
}
}
The compiler complains with the following:
error: no se puede convertir ‘ros::Time’ a ‘uint64_t {aka long unsigned int}’ en la asignación (it's in Spanish, I don't know how to change my compiler language)
which is something like:
error: 'ros::Time' cannot be converted to 'uint64_t {aka long unsigned int}' in assignment
Has somebody else faced this problem? I am running ROS Hydro, on Ubuntu 12.04.
Thanks