-
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
Added #define-based namespaces to prevent linking errors. #355
base: kinetic-devel
Are you sure you want to change the base?
Changes from 1 commit
532123f
d3819f1
4fec2b6
9a06798
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,18 @@ | |
#ifndef UR_KIN_H | ||
#define UR_KIN_H | ||
|
||
#ifdef UR10_PARAMS | ||
#define UR_NAMESPACE ur10 | ||
#endif | ||
|
||
#ifdef UR5_PARAMS | ||
#define UR_NAMESPACE ur5 | ||
#endif | ||
|
||
#ifdef UR3_PARAMS | ||
#define UR_NAMESPACE ur3 | ||
#endif | ||
|
||
// These kinematics find the tranfrom from the base link to the end effector. | ||
// Though the raw D-H parameters specify a transform from the 0th link to the 6th link, | ||
// offset transforms are specified in this formulation. | ||
|
@@ -56,13 +68,14 @@ | |
// 0, 0, 0, 1 | ||
|
||
namespace ur_kinematics { | ||
// @param q The 6 joint values | ||
namespace UR_NAMESPACE { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we make this an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting idea. I wasn't familiar with |
||
// @param q The 6 joint values | ||
// @param T The 4x4 end effector pose in row-major ordering | ||
void forward(const double* q, double* T); | ||
|
||
// @param q The 6 joint values | ||
// @param q The 6 joint values | ||
// @param Ti The 4x4 link i pose in row-major ordering. If NULL, nothing is stored. | ||
void forward_all(const double* q, double* T1, double* T2, double* T3, | ||
void forward_all(const double* q, double* T1, double* T2, double* T3, | ||
double* T4, double* T5, double* T6); | ||
|
||
// @param T The 4x4 end effector pose in row-major ordering | ||
|
@@ -71,6 +84,7 @@ namespace ur_kinematics { | |
// in case of an infinite solution on that joint. | ||
// @return Number of solutions found (maximum of 8) | ||
int inverse(const double* T, double* q_sols, double q6_des=0.0); | ||
}; | ||
} | ||
} | ||
|
||
#endif //UR_KIN_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach will require users to always define one of these options before including the header. We could approximate the original behavior by doing this instead:
Using the approach in this PR, users will get a crytpic linking error if they neglect to specify one of these options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It does slightly privilege the UR3, but that's probably fine.