[ros-users] rostopic echo -p -b --> Time stamp problem

Ken Conley kwc at willowgarage.com
Thu Aug 19 19:08:12 UTC 2010


This goes way back in my memory, but I believe the behavior you
describe is the behavior that was requested, i.e. a stamped message
overrides the time the message was recorded in the bag file. In fact,
I have a hard-to-fix bug ticket filed by a user that describes a
situation where the stamped value isn't used. This behavior is because
usually, when plotting, the stamped value inherent with the data is
preferred to the recorded time, which is offset by variable latency of
network transmission.

You can always change this behavior in your own tree by removing these
lines from rostopic.py:

        if getattr(val, "_has_header", False):
            return "%s,%s"%(val.header.stamp.to_nsec()-time_offset, s)

Another option is to use rosbag.py to write your own bag->CSV
converter fairly trivially.

HTH,
Ken



On Thu, Aug 19, 2010 at 7:05 AM, Gregory <hitzgreg at gmail.com> wrote:
> Hi,
>
> I have a .bag file that contains different types of messages. When the file
> was recorded some of them were generated by a running node and others were
> published via 'rosbag play' from an older bag file, so they have a time
> stamp from the past (like two weeks ago).
>
> Ok, so I tried to use:
>
>     rostopic echo -p -b bagfile.bag /topic1 > topic1.txt
>     rostopic echo -p -b bagfile.bag /topci2 > topic2.txt
>
> to generate files that I can easily read from a matlab script which I use to
> analyze the data. However the 'time' field in the text files is equal to the
> 'header.stamp' field for all messages. So when I compare topic1.txt and
> topic2.txt there is a two week offset not only between the 'header.stamp'
> but also between the 'time' fields. Shouldn't 'time' tell me when the
> message was recorded rather than what it's timestamp is?
>
> When I play the bag file all the messages are published and there's no
> offset.
>
> Is this a bug in rostopic.py? Or have I completely misunderstood something?
>
> I use cturtle. OS is Ubuntu 9.10. rostopic.py is at revision 10000.
>
>
> Thanks in advance!
>
> Gregory
>
>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>



More information about the ros-users mailing list