Cannot compile component

The errors that I get are:

- - - - - - - - - - - - - - - - - - - 8< - - - - - - - - - - - - - - - - - - -

/home/megilabor/ros_workspace/orocos/orocos_toolchain/log4cpp/../install/include/rtt/internal/../internal/../internal/CollectBase.hpp:69:16: error: invalid use of incomplete type ‘struct RTT::internal::CollectBaseImpl<4, bool(bool&, KDL::Frame&, int&, double&)>’

/home/megilabor/ros_workspace/orocos/orocos_toolchain/log4cpp/../install/include/rtt/internal/../internal/../internal/CollectBase.hpp:60:16: error: declaration of ‘struct RTT::internal::CollectBaseImpl<4, bool(bool&, KDL::Frame&, int&, double&)>’

/home/megilabor/ros_workspace/orocos/orocos_toolchain/log4cpp/../install/include/rtt/internal/../internal/Collect.hpp:208:58: error: no matching function for call to ‘RTT::internal::CollectImpl<4, bool(bool&, KDL::Frame&, int&, double&), RTT::internal::LocalOperationCallerImpl<bool(std::vector<double>, KDL::Frame&, int&, double&)> >::collect_impl(bool&, KDL::Frame&, int&, double&)’

/home/megilabor/ros_workspace/orocos/orocos_toolchain/log4cpp/../install/include/rtt/internal/../internal/../SendHandle.hpp:127:44: error: ‘struct RTT::internal::CollectBase<bool(std::vector<double>, KDL::Frame&, int&, double&)>’ has no member named ‘collect’

/home/megilabor/ros_workspace/orocos/orocos_toolchain/log4cpp/../install/include/rtt/internal/../internal/../internal/CollectSignature.hpp:253:57: error: ‘struct RTT::internal::CollectBase<bool(std::vector<double>, KDL::Frame&, int&, double&)>’ has no member named ‘collect’

/home/megilabor/ros_workspace/orocos/orocos_toolchain/log4cpp/../install/include/rtt/internal/../internal/../internal/CollectSignature.hpp:260:57: error: ‘struct RTT::internal::CollectBase<bool(std::vector<double>, KDL::Frame&, int&, double&)>’ has no member named ‘collect’

- - - - - - - - - - - - - - - - - - - 8< - - - - - - - - - - - - - - - - - - -

The function that matches the often mentioned template is:

bool calculateFK(const std::vector<double> jointValues, KDL::Frame & targetmatrix, int & rconfiguration, double & nsparam);

And the error disappears if I do not provide an operation that calls this function, so if I comment out the following part:

    this->addOperation( "calculateFK", &lwrKinematicsMethods::calculateFK, this, ClientThread)
    .doc("calculate forward kinematics")
    .arg("const std::vector5 jointValues", "bla")
    .arg("KDL::Frame & targetmatrix", "bla")
    .arg("int & rconfiguration", "bla")
    .arg("double & nsparam", "bla");
There are also other functions that I use as operations, none of which cause any problems.

Can someone tell me what seems to be the problem here?

Cannot compile component

I have tracked the problem a little further:

It seems to be caused by the second argument

KDL::Frame & targetmatrix

If I remove that (both in definition and declaration of course), it compiles fine.

Also, if I replace it with "KDL::Frame targetmatrix" or even "KDL::Frame * targetmatrix", it compiles. "KDL::Vector & targetmatrix" also causes the problem.

Cannot compile component

On Fri, Nov 30, 2012 at 12:55 PM, <mirko [dot] kunze [..] ...> wrote:
> I have tracked the problem a little further:
>
> It seems to be caused by the second argument
>
> KDL::Frame & targetmatrix
>
> If I remove that (both in definition and declaration of course), it compiles
> fine.
>
> Also, if I replace it with "KDL::Frame targetmatrix" or even "KDL::Frame *
> targetmatrix", it compiles.
> "KDL::Vector & targetmatrix" also causes the problem.

http://www.orocos.org/forum/orocos/orocos-users/cannot-compile-component

Thanks for reporting, there must be a bug in the operations code for
this combination of arguments (one return value + 3 argument
references). We certainly can fix this, but a bug report would also
help for keeping track of this ( bugs.orocos.org ).

Regarding your example code, you don't need to encode the C++ type in
the arg(...) function, RTT derives the argument type automatically, so
just your variable name will do.

Peter

Cannot compile component

On Fri, Nov 30, 2012 at 7:26 PM, Peter Soetens <peter [..] ...> wrote:
> On Fri, Nov 30, 2012 at 12:55 PM, <mirko [dot] kunze [..] ...> wrote:
>> I have tracked the problem a little further:
>>
>> It seems to be caused by the second argument
>>
>> KDL::Frame & targetmatrix
>>
>> If I remove that (both in definition and declaration of course), it compiles
>> fine.
>>
>> Also, if I replace it with "KDL::Frame targetmatrix" or even "KDL::Frame *
>> targetmatrix", it compiles.
>> "KDL::Vector & targetmatrix" also causes the problem.
>
> http://www.orocos.org/forum/orocos/orocos-users/cannot-compile-component
>
> Thanks for reporting, there must be a bug in the operations code for
> this combination of arguments (one return value + 3 argument
> references). We certainly can fix this, but a bug report would also
> help for keeping track of this ( bugs.orocos.org ).
>
> Regarding your example code, you don't need to encode the C++ type in
> the arg(...) function, RTT derives the argument type automatically, so
> just your variable name will do.

Some functions were missing for > 3 return arguments. I have attached
the patch and pushed the fix to toolchain-2.5

Peter