Subclassing the nodelet::Loader class
I can use bond::Bond
to set up a watchdog so that if we get a crash in a linked node we get a notification to perhaps reconnect subscriptions, etc.
However, in a nodelet situation we have multiple nodelets within a single node, so creating a watchdog for every single nodelet seems a waste of resources, so ideally I would like to customise nodelet::Loader
to add something like:
void Loader::reloadAll (const std::string & name)
{
boost::mutex::scoped_lock lock (lock_);
Impl::M_stringToNodelet::iterator it = impl_->nodelets_.begin();
for (; it != impl_->nodelets_.end(); ++it)
{
it->second->reload();
}
}
Then each nodelet can implement the reload()
API to refresh its subscriptions, etc.
How can I do this, or is there another way? nodelet::LoaderROS
already uses bond
, so can we leverage that somehow?
Hi, I'm currently working on something similar to this where we want a watchdog node/nodelet that can kill and restart nodes/nodelets when they stop responding or die for whatever reason. Have you come across a solution?