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

Synchronizing 3 messages: Build Errors

asked 2013-01-14 02:51:03 -0500

101010 gravatar image

updated 2014-01-28 17:14:49 -0500

ngrennan gravatar image

Greetings. I am attempting to use the ApproximateTime policy for synchronizing 3 messages containing the types with names: string type, int32 value. At the call, Synchronize<syncpolicy> sync(syncPolicy(10), alg1_sub, alg2_sub, alg3_sub), with alg 1, 2, 3 _sub the message filters on the nodeHandle, I get the following error:

/opt/ros/fuerte/include/message_filters/sync_policies/approximate_time.h:620:119: error: ‘value’ is not a member of ‘ros::message_traits::TimeStamp<elars::alg3_<std::allocator<void> >, void>’

The messages alg1, alg2, alg3 have been created correctly and the .h files for each are properly found and included in my node. It seems that the message types are not being registered properly using gen_msgs() in the CMakeLists.txt. Any pointers to a solution are greatly appreciated. Attached is the main function code:

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);
    typedef sync_policies::ApproximateTime<elars::alg1, elars::alg2,
                                                    elars::alg3> syncPolicy;
    Synchronizer<syncPolicy> sync(syncPolicy(10), alg1_sub, alg2_sub, alg3_sub);
    sync.registerCallback(&ensemble.ensembleCallback);
    ros::spin();

    return 0;
}
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2013-01-14 03:02:50 -0500

dornhege gravatar image

I think your custom types are missing a Header which contains the time stamp and thus is necessary for synchronization.

edit flag offensive delete link more

Comments

Of course. A beginner's mistake. Regards!

101010 gravatar image 101010  ( 2013-01-17 09:04:20 -0500 )edit

could you tell me which header is missing? I #include <message_filters sync_policies="" approximate_time.h="">.

waschbaer gravatar image waschbaer  ( 2017-06-16 15:52:11 -0500 )edit

Question Tools

Stats

Asked: 2013-01-14 02:51:03 -0500

Seen: 1,419 times

Last updated: Jan 14 '13