So, if you are just looking to go from memory to disk and back to memory again, bag files are possibly an entirely reasonable choice starting with cturtle.  To save, you could write all the messages into a bag.  And then when you start your program you could give it a bag to load all the messages from again.<br>

<br>However, the caveat is that the only structure of messages you can store at the moment is an ordered (or unordered) set.  You can abuse the time parameter to create an arbitrary ordering.  However, if you have some other data structure of messages, e.g., a dictionary mapping strings to messages, there is no way to map that into a bag file.<br>

<br>Clearly there would be great value in allowing bags to be created and indexed using arbitrary key-types such as strings or ints, but it will still be quite some time before that gets implemented.<br><br>So, if your database state can be captured completely by a suitable ordered set of messages, go ahead and try using bags.  Otherwise you might have to implement something on your own.  If you do have to implement your own file format, you should take a look at the ROS serialization API.  All ROS messages can fairly easily be serialized into an appropriate binary block for writing to file and that same binary block, when loaded back from the file can be deserialized into a message.<br>

<br>--Jeremy<br><br><br><div class="gmail_quote">On Fri, Jun 11, 2010 at 2:43 PM, Billy Okal <span dir="ltr"><<a href="mailto:b.okal@jacobs-university.de">b.okal@jacobs-university.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Yes I wanted a more ROS approach to the storage, I could of course just convert them back to text files and store them, but I I was looking for something smarter than that and I though bag files could do some magic here, if not at least this should be ticketed or something like that( a way to store msg data directly into mem and be able to load it and do stuff on it)<br>


<br>thanks<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, Jun 11, 2010 at 5:23 PM, Jeremy Leibs <span dir="ltr"><<a href="mailto:leibs@willowgarage.com" target="_blank">leibs@willowgarage.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Billy,<br><br>I'm sorry I'm not entirely sure what it is that you are looking for.  If you want things to be fast, it sounds like you can load all of these files as messages into memory and work with them there without too much trouble.  1000 files of 4000 floats is only about 30MB, even if you store them as doubles you should be fine.<br>




<br>Are you just looking for a way to write the messages out to disk and load them in again at a later point?  It sounds like you already have a way of reading your text files and converting them to messages.  Is it that you haven't implemented a way of writing them back out to your text format, or are you wanting to use a different, ROS-native, format to store them?<br>




<br>If you could elaborate a little bit on what it is that you are looking for a solution to I can maybe point you in the right direction.<br><font color="#888888"><br>--Jeremy<br><br><br></font><div class="gmail_quote">


<div><div></div><div>On Fri, Jun 11, 2010 at 1:38 PM, Billy Okal <span dir="ltr"><<a href="mailto:b.okal@jacobs-university.de" target="_blank">b.okal@jacobs-university.de</a>></span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>Dear Ros Users,<br><br>I am writting a ros package to emulate a database in which I want to store many(1000+) text files(each containing about 4000 float values). Originally I though of using bag files to store this info but now it looks like thats not what I want. Basically I want to store these files and be able to perform Addition, Deletion, and Querying(compare one text file against all the rest to infer some properties of grasps). Right now I have made Ros msg representing the text files and can move them around ros, but the problem is storing these messages in some lasting memory so that I just load the database(which I can also make a ros message) in the beginning and to stuff then write it back.<br>





<br>Does anybody have experience in this or something related or just some ideas I could use to go about this? Also I need to querying to be really fast(the goal is real time control)<br clear="all"><font color="#888888"><br>




-- <br>Best Regards,<br>
<br>Billy Okal<br><br>sure vi is user friendly, its just particular about who to be friends with<br>
</font><br></div></div><div>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">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>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">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>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards,<br><br>Billy Okal<br><br>sure vi is user friendly, its just particular about who to be friends with<br>
</div></div><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>
<br></blockquote></div><br>