-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Multiple #defines when using boost and ur_kin.h #217
Comments
There's no real reason to have them as defines, but those are some very dangerously generic names for macros. Undeffing them might have weird effects if boost code uses them (though boost should know better than to use macros with names like that). The easiest "fix" is to move them to the source file instead of the header since they're not needed in the header anyway. Better yet they can be turned into const doubles in an anonymous namespace in the source file. It should have no noticeable effect in terms of optimization with any modern compiler. Note that the current interface prevents linking an executable that can do inverse kinematics for more than one arm type. For my own use I changed the kinematics functions to accept a struct containing the kinematic parameters instead. |
Actually, after double checking, there are guarantees about using const integral types as compile time constants, but not for doubles. Although I doubt it will make a difference in practise, that could be a reason to use #defines. Of course, c++11 constexpr would be perfect here if that was allowed. |
Nothing more than a +1 from me, this is a really nasty issue, just ran into it myself. |
I (most likely) will be able to test this on Monday... |
Compiler errors result when the
ur_kin.h
file is included with boost header files. The error is caused by redefinition of#define
macros here.These macros should be prefixed with a namespace and/or check for previous definition and
undef
'ed.The text was updated successfully, but these errors were encountered: