Skip to content

Fixed bugs in computation of AABB in LinkModel and RobotState (kinetic) - #703

Merged
rhaschke merged 6 commits into
moveit:kinetic-develfrom
tradr-project:fix_bbox-kinetic
Jan 3, 2018
Merged

rhaschke merged 6 commits into
moveit:kinetic-develfrom
tradr-project:fix_bbox-kinetic

Conversation

@peci1

@peci1 peci1 commented Dec 4, 2017

Copy link
Copy Markdown
Contributor

Port of #699 to kinetic-devel.

Also added a way to visualize both AABBs and OBBs in RViz to verify.

@rhaschke rhaschke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for those changes. I have a very few comments.

aabb.resize(6, 0.0);
if (!bounding_box.isEmpty())
{
aabb[0] = bounding_box.min()[0];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This assignment is very verbose. What about:

Map<VectorXd, Unaligned, InnerStride<2>>(aabb.data(), 3) = bounding_box.min();
Map<VectorXd, Unaligned, InnerStride<2>>(aabb.data()+1, 3) = bounding_box.max();

Eigen::Vector3d ei = shapes::computeShapeExtents(shapes_[i].get());
Eigen::Vector3d p1 = collision_origin_transform_[i] * (-ei / 2.0);
Eigen::Vector3d p2 = collision_origin_transform_[i] * (-p1);
Eigen::Vector3d extents = shapes::computeShapeExtents(shapes_[i].get());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

extends seems to be used for non-meshes only. Hence computation of shape extends should be moved into the non-meshes if-branch below.

a[i] = std::min(a[i], p1[i]);
for (int i = 0; i < 3; ++i)
b[i] = std::max(b[i], p2[i]);
const shapes::Mesh* mesh = dynamic_cast<const shapes::Mesh*>(shapes_[i].get());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add a comment, why meshes are handled differently?
I guess, with your approach, you compute the smallest AABB for the mesh given the transformation, while otherwise an AABB of the mesh (in default pose) is computed and transformed afterwards, which usually gives a larger box.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right it deserves a comment, since the reasoning is different - shapes::computeShapeExtents only gives the extents and doesn't provide info about the position of the center of the mesh in these extents.

@peci1

peci1 commented Jan 3, 2018

Copy link
Copy Markdown
Contributor Author

Both indigo and kinetic PRs now pass the tests, and I've addressed the last set of comments from rhascke in them. So from my point of view, the PR is ready.

@rhaschke rhaschke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot!

@rhaschke
rhaschke merged commit f6b85c6 into moveit:kinetic-devel Jan 3, 2018
peci1 pushed a commit to tradr-project/moveit that referenced this pull request Jan 9, 2018
Fixed bugs in computation of AABB in LinkModel and RobotState.
davetcoleman pushed a commit that referenced this pull request Jan 14, 2018
Fixed bugs in computation of AABB in LinkModel and RobotState.
@a-price

a-price commented Apr 17, 2018

Copy link
Copy Markdown

Has this fix been pushed to the Kinetic Debian release? I'm on 0.9.11-0xenial-20180319-133135-0800, but am still seeing this bug.

@rhaschke

Copy link
Copy Markdown
Contributor

No, there wasn't as new release since this PR was merged.

@peci1

peci1 commented Nov 16, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for also releasing for indigo. However, I've noticed that this PR (and its indigo counterpart) isn't referenced in the changelog (to kinetic, it was added in 0.9.12; to indigo in 0.7.14). Should I make PRs against kinetic-devel and indigo-devel adding the mention to the appropriate places, or is it a no-go to edit changelogs of already released versions?

I think mentioning this in the changelog is important because people might find things broken (or fixed :) ) and start searching for the cause.

@v4hn

v4hn commented Nov 29, 2018

Copy link
Copy Markdown
Contributor

@130s @rhaschke as they do the releases at the moment.

Personally I believe it is not important to add the notes here anymore.
Also, there is no clear strategy to "fix" it if something is broken because of these patches,
otherwise I would propose to add it to the MIGRATION.md

@rhaschke

Copy link
Copy Markdown
Contributor

Fully agree. I don't see the need to add this to an already released changelog as well.

peci1 added a commit to peci1/moveit that referenced this pull request Dec 7, 2018
peci1 added a commit to peci1/moveit that referenced this pull request Dec 7, 2018
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