Problems with time using rosbag api
Hi all!!
I have some problems using the rosbag api. Here I present some of my code:
rosbag::Bag bagR("bag.bag",rosbag::bagmode::Read);
rosbag::View view;
view.addQuery(bagR,rosbag::TopicQuery(_topics));
nav_msgs::Odometry msg;
BOOST_FOREACH(rosbag::MessageInstance const m, view){
ROS_INFO("T: %i.%i",m.getTime().sec,m.getTime().nsec);
msg = *m.instantiate<nav_msgs::Odometry>();
ROS_INFO("T: %i.%i",msg.header.stamp.sec,msg.header.stamp.nsec);
}
beeing _topics a vector of strings containg all the topics I need.
The problem is that the time from m.getTime() and the time from msg.header.stamp are different and I do not understand why that happends. Can somebody give me a hint on that?
Cheers
add a comment