Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getMultiDofJointAddon() is not defined #645

Closed
mkoval opened this issue Mar 27, 2016 · 1 comment
Closed

getMultiDofJointAddon() is not defined #645

mkoval opened this issue Mar 27, 2016 · 1 comment
Milestone

Comments

@mkoval
Copy link
Collaborator

mkoval commented Mar 27, 2016

Trying to call getMultiDofJointAddon() on a MultiDofJoint<T> results in the following error message:

In file included from /home/mkoval/dartpy-ws/devel/include/dart/common/SpecializedForAddon.h:193:
/home/mkoval/dartpy-ws/devel/include/dart/common/detail/SpecializedForAddon.h:260:26: error: no matching constructor for initialization of 'dart::dynamics::detail::MultiDofJointAddon<3>'
  SpecAddon* addon = new SpecAddon(this, std::forward<Args>(args)...);
                         ^         ~~~~
/home/mkoval/dartpy-ws/devel/include/dart/common/detail/SpecializedForAddon.h:105:10: note: in instantiation of function template specialization 'dart::common::SpecializedForAddon<dart::dynamics::detail::MultiDofJointAddon<3> >::_create<>' requested here
  return _create(type<T>(), std::forward<Args>(args)...);
         ^
/home/mkoval/dartpy-ws/devel/include/dart/dynamics/MultiDofJoint.h:74:3: note: in instantiation of function template specialization 'dart::common::SpecializedForAddon<dart::dynamics::detail::MultiDofJointAddon<3> >::create<dart::dynamics::detail::MultiDofJointAddon<3>>' requested here
  DART_BAKE_SPECIALIZED_ADDON_IRREGULAR( typename MultiDofJoint<DOF>::Addon, MultiDofJointAddon )
  ^
/home/mkoval/dartpy-ws/devel/include/dart/common/detail/AddonManager.h:201:27: note: expanded from macro 'DART_BAKE_SPECIALIZED_ADDON_IRREGULAR'
    return this->template create<TypeName>(std::forward<Args>(args)...); \
                          ^
/home/mkoval/dartpy-ws/devel/include/dart/dynamics/MultiDofJoint.h:74:3: note: in instantiation of function template specialization 'dart::dynamics::MultiDofJoint<3>::createMultiDofJointAddon<>' requested here
  DART_BAKE_SPECIALIZED_ADDON_IRREGULAR( typename MultiDofJoint<DOF>::Addon, MultiDofJointAddon )
  ^
/home/mkoval/dartpy-ws/devel/include/dart/common/detail/AddonManager.h:183:14: note: expanded from macro 'DART_BAKE_SPECIALIZED_ADDON_IRREGULAR'
      return create ## AddonName();                                      \
             ^
<scratch space>:28:1: note: expanded from here
createMultiDofJointAddon
^
/home/mkoval/dartpy-ws/src/dartpy/src/generated/_ZN4dart8dynamics13MultiDofJointILm3EEE.cpp:317:8: note: in instantiation of member function 'dart::dynamics::MultiDofJoint<3>::getMultiDofJointAddon' requested here
joint->getMultiDofJointAddon(true);
       ^
/home/mkoval/dartpy-ws/devel/include/dart/dynamics/detail/MultiDofJointProperties.h:165:3: note: candidate constructor not viable: no known conversion from 'dart::common::SpecializedForAddon<dart::dynamics::detail::MultiDofJointAddon<3> > *' to 'const dart::dynamics::detail::MultiDofJointAddon<3>' for 1st argument
  MultiDofJointAddon(const MultiDofJointAddon&) = delete;
  ^
/home/mkoval/dartpy-ws/devel/include/dart/dynamics/detail/MultiDofJointProperties.h:167:3: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
  MultiDofJointAddon(common::AddonManager* mgr,
  ^
1 error generated.

The problem seems to be that DART_BAKE_SPECIALIZED_ADDON_IRREGULAR calls a constructor on MultiDofJointAddon that does not exist. I can't figure out what the root cause of this is because it's buried under a lot of template specializations and macro expansions - hopefully @mxgrey can figure this out. 😓

@mxgrey
Copy link
Member

mxgrey commented Mar 28, 2016

It looks like you were using getMultiDofJointAddon(bool) which will automatically create the Addon if it didn't already exist. I forgot to make a default argument for the constructor, so it wasn't able to automatically create an instance of the Addon. All the other Addon types are made with macros which ensure these default arguments exist, but MultiDofJointAddon is weird because of its template, so it doesn't fit nicely into the same macro as the others.

This should be fixed with a regression test in pull request #649.

@mkoval mkoval closed this as completed Apr 6, 2016
@jslee02 jslee02 added this to the DART 6.0.0 milestone Apr 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants