Conversion into ROS compatible timestamp
I was following a tutorial on laser scanner. But then, there is time-related stuff that I need to modify so that the time is not considered taken real-time(as shown in tutorial, it uses
- ros::Time scan_time = ros::Time::now();
- scan.header.stamp = scan_time;
to realize it. Instead, I want to take time values from a dataset(logfile).
I've tried to do as the following:
for (int i = 0; i < num_row; i++)
{
scan.header.stamp = data_set[i][1];
}
but, it doesn't work..for the line "scan.header.stamp = data_set[i][1];", I receive the following error:
"no match for ‘operator=’ in ‘scan.sensor_msgs::LaserScan_<std::allocator<void> >::header.std_msgs::Header_<std::allocator<void> >::stamp = (((std::vector<double, std::allocator<double> >*)((PointCloud*)this)-
>PointCloud::data_set.std::vector<_Tp, _Alloc>::operator[] [with _Tp = std::vector<double, std::allocator<double> >, _Alloc = std::allocator<std::vector<double, std::allocator<double> > >](((long unsigned int)i)))->std::vector<_Tp,
_Alloc>::operator[] [with _Tp = double, _Alloc = std::allocator<double>](1ul) / 1.0e+3)’"
I cannot see the culprit..