ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS internals - topics storage and network comms?

asked 2014-04-11 02:52:34 -0500

JaysonJT gravatar image

updated 2014-04-11 02:57:51 -0500

I am currently working on a software framework to monitor the energy consumption of robots or any embedded device. I wanted to build my framework in a similar manner as ROS.

At the moment, I have created a user API that does the following (front end):

  1. a user can create a probe (a data structure used to collect data from an energy source) and associate it with a device attached to the embedded board.
  2. set a checkpoint with respect to any probe that is already created; once set, energy monitoring of the corresponding device begins.
  3. A user can 'sampleCheckpoint' at which point the latest energy reading collected from the corresponding device is returned.
  4. Finally, a user can also delete checkpoints and probes.

This framework allows users to profile their code for energy consumption.

The backend:
The architecture of the system is built in a producer-consumer fashion (similar to ROS), where energy sources are the producers and any software using the API are consumers. There is a central authority in between that stores checkpoints and probe related data in an sqlite database. And all communications between producers and consumers happen via this central authority over unix sockets.

  1. Does ROS also use UNIX sockets to do all its network communications?
  2. Does ROS store all the topics & subscribers associated with each topic in a database of some sort or just in memory?

I would also like to integrate this framework with ROS at some point. In order to do that, I believe I need to create a ROS package for the framework?

Thank you.

edit retag flag offensive close merge delete

Comments

1

Some nitpicking: ROS (the middleware) is built upon publish-subscribe and a flavour of RPC (or implicit and explicit invocation). While similar, a plain producer-consumer system is not the same.

gvdhoorn gravatar image gvdhoorn  ( 2014-04-11 06:33:34 -0500 )edit

Thanks for pointing that out.

JaysonJT gravatar image JaysonJT  ( 2014-04-11 12:08:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-04-11 06:36:41 -0500

gvdhoorn gravatar image

updated 2014-04-11 06:41:04 -0500

To answer your questions:

1 . Does ROS also use UNIX sockets to do all its network communications?

No, it uses TCP/IP for nodes (to cross process boundaries), and pointer-passing in nodelets (essentially nodes mapped on threads).

2 . Does ROS store all the topics & subscribers associated with each topic in a database of some sort or just in memory?

Plain ROS (ie: no extensions providing additional transports) uses in-memory buffering for messages, and a special node (the master) as a central index to provide topic->node mapping services. AFAIK that mapping is stored in memory, no databases (if you mean (R)DBMS) involved. Node->node communication is also direct, so the master is only involved in the initial setup of the connection.


Edit: see also the ROS/Concepts wiki page.

edit flag offensive delete link more

Comments

Thanks for your reply. I've just read that nodes send messages to each other via topics. So is a topic a 'name (char *) + memory buffer (user definable datatype)' data-structure? And, does the master keep a track of all the topics in a linked-list data-structure? Thanks.

JaysonJT gravatar image JaysonJT  ( 2014-04-11 12:13:51 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-04-11 02:52:34 -0500

Seen: 811 times

Last updated: Apr 11 '14