Ask Your Question


asked 2016-07-29 14:41:34 -0500

Chickenman gravatar image

Hi guys

I am planning to do something like trajectory manager for my robotic application. I created pretty solid rqt plugin and also joint trajectory client, gripper client and everything that was needed for controlling my stuff but I have now huge problem with data storage. Is there any great database which is able to store messages in rows and structures. For example I want learn my robot new trajectories but I also want to record points and move arm step by step, add new trajectories and so on. I want to create something which can store trajectories and points like for example abb flexpendant if you have any experience with it. Is there any great database for this. I was reading about mongo database or rosbag. But I cannot find any usefull API documentation. I know how to store or record some messages but that is not enough. Can you please give me some hints or tips. Maybe I just did not explore everything which can these databases do. I have to say that I dont have a lot of experience with databases yet

Thank you for your time and help.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-07-30 08:56:11 -0500

Chrissi gravatar image

Not sure if this does what you want it to but our project uses mongodb and created a ros wrapper for it: It also offers a message_store which allows you to store and retrieve any kind of standard or custom ROS message. So what ever data you want to save, just create your own message for it and put it in the message store:

from mongodb_store.message_store import MessageStoreProxy
from geometry_msgs import PoseStamped

msg_store = MessageStoreProxy(collection="my_collection")
insert = PoseStamped()
meta = {...} # Fill in some meta data
msg_store.insert(insert, meta)

I believe it is part of the standard ROS packages now.

I know you said that you had a look at mongodb already but I think it is worth giving it a try. Since it is just a standard mongodb at its core, you can also just use pymongo to access it directly. Basically, what ever you can express in a json string can be saved and retrieved.

edit flag offensive delete link more


thank you for your fast response. I read something about this package but is there a way to store messages in some kind of structure or order. Is it just something which is able to insert ros data to database and than I am able to work with all other functions of mongoDB ?

Chickenman gravatar image Chickenman  ( 2016-07-31 05:12:13 -0500 )edit

DB entries are always ordered by their insertion date by default. However, you can make up any kind of id you like and index your DB using that. Basically, the message_store allows to store any kind of ROS message and accessing it directly via pymongo allows to store arbitrary dictionaries.

Chrissi gravatar image Chrissi  ( 2016-07-31 08:36:41 -0500 )edit

Ok thank you for informations. I will try something and give some feedback. I will see what I can do. Thank you for your time and advices

Chickenman gravatar image Chickenman  ( 2016-07-31 12:10:57 -0500 )edit

No problem at all. Just let me know if you run into problems.

Chrissi gravatar image Chrissi  ( 2016-07-31 12:55:01 -0500 )edit

Can I ask one more question. I save data to database with specific names is there a way to print these names? after login to database ? I am using C++ client

Chickenman gravatar image Chickenman  ( 2016-08-01 03:02:43 -0500 )edit

I'm sure there is but I do not fully understand what you would like to print. When inserting the data, you should have all the information you need, so you should just be able to print it. Otherwise try querying for the info you need.

Chrissi gravatar image Chrissi  ( 2016-08-01 03:14:54 -0500 )edit

Ok and is there a way to storage data under a specific id I mean this string id(messageStore.insertNamed(name, p)); will return me specific id of stored message. Is there a way to named ID by myself. Is there any api_documentation for package ? I cannot exactly know what functions do Thank you

Chickenman gravatar image Chickenman  ( 2016-08-01 04:07:38 -0500 )edit

Just create a field in your data you want to index it by. I for example have a field UUID which has a UUID as a string in it. With you can then create an index over this entry.

Chrissi gravatar image Chrissi  ( 2016-08-01 04:27:36 -0500 )edit

answered 2016-08-08 13:27:41 -0500

Chickenman gravatar image

updated 2016-08-08 13:35:07 -0500

Thank you Chrissi for your help. Database works fine but when I am using it with moveit and I call movegroup constructor I got this error

Attempt to add global initializer failed, status: DuplicateKey throwSockExcep

I had this in my code when I commented it everything works fine so this is the problem

moveit::planning_interface::MoveGroup *group;
group = new moveit::planning_interface::MoveGroup(options);
ROS_INFO_STREAM("Move group interface configured.");

After debuging I found mongo::GlobalInitializerRegisterer::GlobalInitializerRegisterer causing problems

#0  0x00007ff4d54bac37 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ff4d54be028 in __GI_abort () at abort.c:89
#2  0x00007ff4d3e5c6d7 in mongo::GlobalInitializerRegisterer::GlobalInitializerRegisterer(std::string const&, boost::function<mongo::Status (mongo::InitializerContext*)> const&, std::vector<std::string, std::allocator<std::string> > const&, std::vector<std::string, std::allocator<std::string> > const&) ()    from /home/mirec/catkin_ws/devel/lib/
#3  0x00007ff4d3dea448 in _GLOBAL__sub_I_sock.cpp ()    from /home/mirec/catkin_ws/devel/lib/
#4  0x00007ff4d650a10a in call_init (l=<optimized out>, argc=argc@entry=1,

    argv=argv@entry=0x7ffde02cb9a8, env=env@entry=0x7ffde02cb9b8)
    at dl-init.c:78
#5  0x00007ff4d650a1f3 in call_init (env=<optimized out>, 
    argv=<optimized out>, argc=<optimized out>, l=<optimized out>)
    at dl-init.c:36
#6  _dl_init (main_map=0x7ff4d671e1c8, argc=1, argv=0x7ffde02cb9a8, 
    env=0x7ffde02cb9b8) at dl-init.c:126
#7  0x00007ff4d64fb30a in _dl_start_user () from /lib64/
#8  0x0000000000000001 in ?? ()
#9  0x00007ffde02ccf6d in ?? ()
#10 0x0000000000000000 in ?? ()

Database client is my lib and it works fine without Moveit. I was searching internet for solution but I could find anything helpful. I know this is not problem of your package but if you could help my find any solution I would be grateful.

Thank you for your answer and help

edit flag offensive delete link more


Hi, I am not that familiar with the C++ interface I am afraid and I cannot really tell what is going wrong from the backtrace. Is your code available somewhere so I can give it a try myself?

Chrissi gravatar image Chrissi  ( 2016-08-09 05:03:05 -0500 )edit

Found solution I initialize move_group in Constructor where I also initialized your database. I solve it by commenting line 1118 and every methods connected with it in move_group.cpp

Chickenman gravatar image Chickenman  ( 2016-08-09 07:56:42 -0500 )edit

Brilliant. Sorry I couldn't really help.

Chrissi gravatar image Chrissi  ( 2016-08-09 15:01:54 -0500 )edit

No problem. I am really grateful for your time and effort. I am glad that there are still people like you.

Chickenman gravatar image Chickenman  ( 2016-08-09 18:22:24 -0500 )edit

Just happy to help :)

Chrissi gravatar image Chrissi  ( 2016-08-10 03:12:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-07-29 14:41:34 -0500

Seen: 482 times

Last updated: Aug 08 '16