rosin-project / rxros

Reactive programming for ROS
BSD 3-Clause "New" or "Revised" License
48 stars 6 forks source link

rxros::observable::from_topic does not react on ROS problems. #20

Open henrik7264 opened 5 years ago

henrik7264 commented 5 years ago

rxros::observable::from_topic does not react on ROS problems such as topic termination or network problems. An on_error event should be emitted if such problems appears.

gavanderhoorn commented 4 years ago

such as topic termination

just curious: @henrik7264: how would you detect 'topic termination'? Do you mean the case where a single publisher is publishing to a topic and it stops doing that?

How would you distinguish that from a publisher that is just slow?

It's possible to interrogate the master to see whether there are still publishers for a specific topic, but that will introduce a rather significant overhead (as it has to be done periodically, there are no events for this).

henrik7264 commented 4 years ago

@gavanderhoorn - yes it is a good question. I actually don't known how to handle it currently. I just remembered for a long time ago I read that is was possible to terminate a topic. I have never tried this and I also don't know how to handle it in a ROS node.

You a right that this could easily become an expensive operation if there are no events/triggers associated to the termination of the topic. Then we would have to fallback to timers + checks as you describe. This could easily become a nasty business.