Hi Ivan,<span style="font-family: courier new,monospace;"><br><br></span>I'm not sure it's possible to devise a meta-data schema flexible enough to satisfy all use cases.  The ROS toolchain is pretty flexible, though, and it should be easy to engineer a solution for your particular needs.  The following techniques[*] might help you:<br>

<br>
To query the topics and message types in a bag, use:<br><span style="font-family: courier new,monospace;"><br>    rosbag info --yaml mybag.bag</span><br><br>to return information about the bag in a YAML document.<br><br>

For arbitrary meta-data, it's easy to add any data you want to a bag.  For example, here's a Python script that will take a bag filename passed on the command-line, and add as the first message in the bag a message on the <span style="font-family: courier new,monospace;">/metadata</span> topic:<br>

<br><span style="font-family: courier new,monospace;">    import roslib; roslib.load_manifest('rosbag')</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    import sys, rosbag, rospy, std_msgs.msg</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    b = rosbag.Bag(sys.argv[1], 'a')</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    # @todo: generate your meta-data message here                                                                                                                                                                         </span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    metadata = std_msgs.msg.String()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    metadata.data = 'my metadata'</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    for _, _, t in b.read_messages():</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        break</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">    b.write('/metadata', metadata, t - rospy.Duration(0, 1))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    b.close()</span><br style="font-family: courier new,monospace;">

<br>For example, if you wanted to annotate the bag with a description and keywords, the meta-data message could be populated from the command-line arguments the user passes in.<br>
<br>Your meta-data can then easily be read from the bag, either using the <span style="font-family: courier new,monospace;">rosbag</span> API, or via the command-line, e.g.<br><br><span style="font-family: courier new,monospace;">    rostopic echo -b metadata.bag -n 1 /metadata</span><br>

<br>Tim<br><br>[*] assuming a C-turtle installation<br><br>On Mon, Jun 21, 2010 at 5:46 PM, Ivan Dryanovski <span dir="ltr"><<a href="mailto:ivan.dryanovski@gmail.com">ivan.dryanovski@gmail.com</a>></span> wrote:<br>

<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
We've been running into a somewhat logistical problem of having too<br>
many bag files, and no good way to organize them. Has anyone given<br>
thought to the idea of adding meta-data to the .bag files? It would be<br>
useful if we can attach a description and keywords so we can quickly<br>
find relevant bags. For example, you would keep all your bags in a<br>
specific directory, and have a ros tool that is able to search through<br>
them based on keywords, topics, or message types.<br>
<br>
Since adding explicit meta-data to the bag format might cause<br>
compatibility problems with current bag tools, perhaps a round-about<br>
solution would be to attach a "metadata" topic to each bag.<br>
<font color="#888888"><br>
Ivan Dryanovski<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</font></blockquote></div><br>