0
$\begingroup$

Rosanswers logo

Hi,

I was looking through this example and.. http://wiki.ros.org/pcl_ros

PointCloud::Ptr msg (new PointCloud); msg->header.stamp = ros::Time::now ();

The second line where the stamp takes the time from the ros::time function does not work. Is there any reason to it or a workaround to directly use the current time?

Basically the compilation error is as follows: error: cannot convert ‘ros::Time’ to ‘uint64_t {aka long long unsigned int}’ in assignment

Running hydro btw. Thanks!


Originally posted by Yuan Huang on ROS Answers with karma: 48 on 2014-05-30

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

ros::Time time_st = ros::Time::now ();

msg->header.stamp = time_st.toNSec()/1e3;

From what I saw in the pcl_conversion header. for hydro there is no toPCL for time but for indigo there is.

Probably the wiki should be updated since hydro is using the newer PCL.


Originally posted by Yuan Huang with karma: 48 on 2014-05-30

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.