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

Support urdfdom_headers 1.0 #766

Merged
merged 3 commits into from
Aug 27, 2016
Merged

Support urdfdom_headers 1.0 #766

merged 3 commits into from
Aug 27, 2016

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Aug 27, 2016

urdfdom_headers 1.0 is released with API changes. The major change was replacing boost with C++11, which is a relatively small change.

This pull request adds support of urdfdom_headers 1.0 using different type aliasings depending on the urdfdom_headers versions.

This should fix the build failures on Ubuntu yakkety.


This change is Reviewable

@jslee02 jslee02 added this to the DART 6.1.0 milestone Aug 27, 2016
@jslee02 jslee02 merged commit 6c31368 into master Aug 27, 2016
#define URDFDOM_HEADERS_VERSION_AT_LEAST(x,y,z) \
(URDFDOM_HEADERS_MAJOR_VERSION > x || (URDFDOM_HEADERS_MAJOR_VERSION >= x && \
(URDFDOM_HEADERS_MINOR_VERSION > y || (URDFDOM_HEADERS_MINOR_VERSION >= y && \
URDFDOM_HEADERS_PATCH_VERSION >= z))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this third part also have URDFDOM_HEADERS_MAJOR_VERSION >= x?

Copy link
Member Author

@jslee02 jslee02 Aug 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand your question correctly, it actually has URDFDOM_HEADERS_MAJOR_VERSION >= x. If it is reached to the last part (i.e., URDFDOM_HEADERS_PATCH_VERSION >= z), that means it's the case of URDFDOM_HEADERS_MAJOR_VERSION >= x AND URDFDOM_HEADERS_MINOR_VERSION >= y.

The logic expressed in C++ would be like:

if (major > x)
{
  return true;
}
else if (major >= x)
{
  if (minor > y)
  {
    return true;
  }
  else if (minor >= y)
  {
    // the third part
    if (patch >= z)
      return true;
    else
      return false;
  }
  else
  {
    return false;
  }
}
else
{
  return false;
}

I borrowed this from Eigen, but yeah it's pretty confusing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the explanation. I guess I don't remember the order of precedence between || and && operators

@jslee02 jslee02 deleted the support_urdfdom_headers-1.0 branch August 30, 2016 21:59
jslee02 added a commit that referenced this pull request Oct 17, 2016
Support urdfdom_headers 1.0 for DART 5.1 (backport of #766)
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

Successfully merging this pull request may close these issues.

2 participants