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

How to create a bond between two nodes using bondcpp

asked 2017-04-03 04:09:55 -0600

eesttaar gravatar image

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

edit retag flag offensive close merge delete

Comments

if u wanna track where your node crashes why don't u just use gdb?

mohsen1989m gravatar image mohsen1989m  ( 2017-04-04 08:31:42 -0600 )edit

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.

eesttaar gravatar image eesttaar  ( 2017-04-05 04:04:17 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-15 17:31:09 -0600

tfoote gravatar image

If you're getting that "ERROR!" string the bond is not getting initialized within 1 second so is erroring.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-04-03 04:09:55 -0600

Seen: 2,880 times

Last updated: Jun 15 '18