How to create a bond between two nodes using bondcpp
Hi, I am running ros jade on ubuntu 14.04. I need to monitor node crashes.I think bondcpp can help me do that.However, I can't find the example code given to work
node A
#include <bondcpp/bond.h>
std::string id = generateUniqueId();
// Sends id to B using a service or action
bond::Bond bond("example_bond_topic", id);
bond.start();
if (!bond.waitUntilFormed(ros::Duration(1.0)))
{
ROS_ERROR("ERROR!");
return false;
}
// ... do things with B ...
bond.waitUntilBroken(ros::Duration(-1.0));
printf("B has broken the bond\n");
and another node -node B
#include <bondcpp/bond.h>
// Receives id from A using a service or action
bond::Bond bond("example_bond_topic", id);
bond.start();
// ... do things ...
bond.breakBond();
Node A never goes beyond that "ERROR!". Any advice will be appreciated Thanks
if u wanna track where your node crashes why don't u just use gdb?
More than where I am interested in when so that I can take subsequent actions like respawning or informing other nodes in the system that a particular node has crashed.