strands-project / strands_utils

Utility package containing nodes that are useful in a number of STRANDS contexts.
0 stars 11 forks source link

[data_centre] notifications and subscriptions #54

Closed marc-hanheide closed 10 years ago

marc-hanheide commented 10 years ago

The idea is to implement a notification scheme that allows people to subscribe to changes to the data centre. This is following ideas of CAST and the Active Memory approach developed by @hawesie and @marc-hanheide in previous projects. The idea would be that components can subscribe e.g. using a command like this: subscribe(Operation op, BSON query, String collection) with op being either DELETE, UPDATE, or ADD; query being a mongodb query document to match any events against; and collection defining the collection to monitor. We could then send out such notification on appropriately named ROS topics with a defined message indication again operation, matched query, the mongo object id, and the collection, plus the actual content in JSON. This is to be discussed in detail at the data_centre task force meeting with @cburbridge and others.

hawesie commented 10 years ago

Some mongodb prior art:

hawesie commented 10 years ago

An alternative approach would be to add/update all db entries via ROS topics and just subscribe to them.

marc-hanheide commented 10 years ago

yes, kind of... but the really interesting bit is the filtering via query. That would allow content-based filtering, e.g. to only get notified if, e.g., the robot saw something new in a specific area (having a spatial query). Thanks for the links. I knew some of these already but not all of them.

hawesie commented 10 years ago

On 11 Dec 2013, at 13:46, Marc Hanheide notifications@github.com wrote:

yes, kind of... but the really interesting bit is the filtering via query. That would allow content-based filtering, e.g. to only get notified if, e.g., the robot saw something new in a specific area (having a spatial query). Thanks for the links. I knew some of these already but not all of them.

I think there are interesting trade-offs here. If we go via the database then we get a standard language (JSON) but the associated cost of translation into and out of this. If we are constantly creating different arbitrary queries then I think this could be the way to go. However, if we end up just instantiation a reasonable number with a few different parameters, then the ROS-native approach may be better, with queries instantiated as custom subscriber. Either way, getting cross-topic queries right (e.g. object x spotted when robot is location y) will definitely be a challenge due to different update rates.