Ask Your Question

Assertion Failed when trying to publish on a ROS topic

asked 2013-06-18 03:35:57 -0500

DwProd gravatar image

updated 2014-01-28 17:16:56 -0500

ngrennan gravatar image

Hello there,

I'm building a generic bridge from YARP to ROS and I'm facing a little issue when dealing with the ROS->YARP side of the bridge. I basically launch two std::thread, and each thread either writes or read data using a POSIX pipe. The issue is that I'm getting a pretty weird error when trying to initialize the ROS node inside the "writing" thread. My program goes something like this :

 bool FRBridge::run()
    std::thread tWrite(&FRBridge::writeData,this);
    std::thread tRead(&FRBridge::readRosData,this);
    return true;

bool FRImageBridge::writeData()
    if ( (fromRosPipe = fdopen(fd[P_WRITE],"w")) == NULL )
        cerr << "Fdopen (Write)" << endl;
        return false;
    int argc = 0;
    char **argv = NULL;
    ros::NodeHandle n; // Program gets stuck here

    ros::Subscriber sub = n.subscribe(topicName, 10, &FRImageBridge::imageCallback,this);
    return true;

I have just kept the important info, please disregard the fact that the function called by a thread is from a child class. At run-time, I get this :

[FATAL] [1371562311.637421310]: ASSERTION FAILED file = /tmp/buildd/ros-groovy-roscpp-1.9.44-0precise-20130325-1240/src/libros/xmlrpc_manager.cpp line = 133 cond = bound

followed by a SIGABRT... Can I not initialize a ROS node after the beginning of the program ? I get some debugging output before

ros::NodeHandle n;

but not after...

Thanks a lot for your help !

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-26 00:51:14 -0500

andreas gravatar image

updated 2014-02-26 00:59:53 -0500

I had the exact same problem when running this code here

(On Fuerte)

It worked for me when compiling yarp with the standard CMakelist settings. ( Before I used the instructions here )

Cheers, Andreas

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-06-18 03:35:57 -0500

Seen: 1,043 times

Last updated: Feb 26 '14