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

ambiguous use of header file

asked 2014-06-11 03:08:08 -0500

hvn gravatar image

updated 2014-06-12 01:05:21 -0500

Hi,

I want to use a package::header as usual like this:

void callbackBB(package_msgs::header msgs_x)
{
}

but the compiler indicates the headerfile is ambiguous and should be used like

header()

or

header(const package_msgs::header<#0> &)

Does this mean this header can't be instantiated ? The writer doesn't give support so can't ask. Thanks.

Code sample:

void  callback_BB_Twist(amigo_msgs::arm_links msgs_ls_t)

Error by Eclipse

Description
'amigo_msgs::arm_links' is ambiguous '
Candidates are:
arm_links()
arm_links(const amigo_msgs::arm_links<#0> &)

Compiler error:

error: ‘amigo_msgs::arm_links’ is not a type

A full minimal example:

#include "amigo_msgs/arm_links.h"
class ImageP
{
    void callbackBB(amigo_msgs::armlinks msgs_x)
    {
    }
    ImageP(ros::nodehandle* n)
    {
         ls_sub = n->subscribe("<topic>", &ImageP::callbackBB, this);
    }
    void run()
    {
    }
};
int main()
{
    ros::init(argc,argv,"imagedo");
    ros::Rate loop_rate(30);
    while(ros::ok())
    {
        imagep.run();
        ros::spinOnce();
        loop_rate.sleep;
     }
}
edit retag flag offensive close merge delete

Comments

That doesn't make much sense. Can you include the code sample you're trying to compile and the exact compiler output?

ahendrix gravatar image ahendrix  ( 2014-06-11 03:14:32 -0500 )edit

I edited the question. Hope you can make some sense out of it.

hvn gravatar image hvn  ( 2014-06-11 04:14:09 -0500 )edit

Your include

#include "amigo_msgs::arm_links"
doesn't look right at all. Is that a typo?

ahendrix gravatar image ahendrix  ( 2014-06-11 14:26:01 -0500 )edit

Yes, that was a typo. I corrected it.

hvn gravatar image hvn  ( 2014-06-12 01:05:48 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2014-06-11 04:45:05 -0500

ahendrix gravatar image

I'm not sure what Eclipse is trying to tell you. I suspect it is confused.

The underlying error here seems to be that amigo_msgs::arm_links isn't a type. Perhaps you forgot to include the appropriate header file?

edit flag offensive delete link more

Comments

No, I didn't forget to include the header file. That's why it's confusing me as well.

hvn gravatar image hvn  ( 2014-06-11 05:06:34 -0500 )edit

Please give a minimal, but complete example of what you are trying to compile.

dornhege gravatar image dornhege  ( 2014-06-11 05:41:26 -0500 )edit

How can I post that best ?

hvn gravatar image hvn  ( 2014-06-11 07:48:02 -0500 )edit

Edit you original question to provide further information.

dornhege gravatar image dornhege  ( 2014-06-11 09:28:38 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-06-11 03:08:08 -0500

Seen: 216 times

Last updated: Jun 12 '14