Greetings,
take this for instance:
int main(int argc, char** argv){
ros::init(argc, argv, "decision_ensemble");
DecisionEnsemble ensemble;
ros::NodeHandle nh;
message_filters::Subscriber<elars::alg1> alg1_sub(nh, "alg1", 1);
message_filters::Subscriber<elars::alg2> alg2_sub(nh, "alg2", 1);
message_filters::Subscriber<elars::alg3> alg3_sub(nh, "alg3", 1);
ROS_INFO("HERE");
typedef sync_policies::ApproximateTime<elars::alg1, elars::alg2, elars::alg3> syncPolicy;
Synchronizer<syncPolicy> sync(syncPolicy(10), alg1_sub, alg2_sub, alg3_sub);
sync.registerCallback(boost::bind(&DecisionEnsemble::ensembleCallback, &ensemble, _1, _2, _3));
ros::spin();
eturn 0;
}
An attempt to use ApproximateTime to synchronize 3 separate recognition algorithm messages. As you might expect, it doesn't work, simple hangs. The subscriptions are correct and I am sure that the 3 separate nodes are publishing, however, my callback for this particular node, ensemble callback, does not execute. In fact, the node hangs after subscribing to the topics alg1, alg2, alg3. Am I using boost::bind correctly? The template is a bit esoteric to the uninitiated.
In any event, the real question is this:
I have 3 nodes, each one taking some delta time interval to complete a task. I have an algorithm that needs info from each node, yet I do not want to run the algorithm until each of the 3 nodes have published. Once all 3 have published, I run the algorithm and output some interesting bit of data. The 3 algorithms are not synchronized and each can take wildly varying time to complete. Is ApproximateTime Synch the appropriate solution? or should I be investigating another approach to message passing synchronization?
Originally posted by 101010 on ROS Answers with karma: 79 on 2013-05-24
Post score: 4