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

new bounding box semantics #547

Merged
merged 5 commits into from
Dec 3, 2015
Merged

Conversation

mklingen
Copy link

@mklingen mklingen commented Nov 3, 2015

Replaces old boundingBoxDim semantics with a new BoundingBox class that has a minimum and maximum. This reduces ambiguity and allows for off-center bounding boxes.

@@ -121,7 +126,7 @@ class Shape : public virtual common::Subject
// biased mesh shape. Two Vector3ds might be better; one is for
// minimum verterx, and the other is for maximum verterx of the
// bounding box.
const Eigen::Vector3d& getBoundingBoxDim() const;
Eigen::Vector3d getBoundingBoxDim() const;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function should be marked as DEPRECATED and the TODO should probably be made a comment that points the user to getBoundingBox.

Copy link
Author

Choose a reason for hiding this comment

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

Okay, whats the proper way of deprecating in dart?

Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a DEPRECATED macro defined in Deprecated.h that has #ifdefs for all of the supported compilers. The argument is the major/minor version number when the deprecation occurred.

DART 5.1.1 was just released, so I suppose it should be DEPRECATED(5.2) now?

Copy link
Member

Choose a reason for hiding this comment

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

DEPRECATED(5.2) would be fine. In general, we might not be sure the deprecation is included in which release at the moment. So I usually increment the minor version with 1 and update the version number if needed when DART is released.

Copy link
Member

Choose a reason for hiding this comment

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

This code would work for the deprecating.

//
// Shape.h
//
/// [Original comment]
/// \deprecated Please use getBoundingBox() instead
DEPRECATED(5.2)
const Eigen::Vector3d& getBoundingBoxDim() const;

//
// Shape.cpp
//
const Eigen::Vector3d& Shape::getBoundingBoxDim() const
{
  static Eigen::Vector3d boundingBoxDim = mBoundingBox.computeFullExtents();
  return boundingBoxDim;

  // or by not removing mBoundingBoxDim
  mBoundingBoxDim = mBoundingBox.computeFullExtents();
  return mBoundingBoxDim;
}

Copy link
Author

Choose a reason for hiding this comment

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

Added this in the latest commit.

@mxgrey
Copy link
Member

mxgrey commented Nov 5, 2015

This pull request looks reasonable to me. The only question I would have is: Are we currently using the bounding box dimension information anywhere meaningful in the DART source code? All of the changes seem to be internal to the Shape class and its derivatives. Are we using bounding boxes in the collision detection components of DART, or are we just letting the third-party libraries deal with those? I'll check this myself, but if anyone already knows the answer, then that might save me some time.

@mxgrey
Copy link
Member

mxgrey commented Nov 5, 2015

It doesn't look like we need to worry about making any other changes to the code, since the bounding boxes are only used internally by shapes right now. 👍

Edit: Although we should add the DEPRECATED flag and put in the comment that @mkoval suggested before we merge.

@mklingen
Copy link
Author

Okay, assuming the tests pass, can we merge this?

@mxgrey
Copy link
Member

mxgrey commented Dec 2, 2015

Looks good to me 👍

If @jslee02 approves, I think it's ready to merge.

@jslee02
Copy link
Member

jslee02 commented Dec 3, 2015

It looks good to me as well. Thank you for your contribution! Merging now.

jslee02 added a commit that referenced this pull request Dec 3, 2015
@jslee02 jslee02 merged commit 76485a3 into dartsim:master Dec 3, 2015
@jslee02 jslee02 added this to the DART 6.0.0 milestone Dec 3, 2015
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.

4 participants