Ask Your Question
0

PCL and ros::Time

asked 2014-05-30 17:49:06 -0500

Yuan Huang gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2014-05-30 18:12:56 -0500

Yuan Huang gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-05-30 17:49:06 -0500

Seen: 1,601 times

Last updated: May 30 '14