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

#fix correct calculation of the center of cuboid_hull #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crush0441
Copy link

When the corner points of link_cuboid_hulls have the same sign, this error will occur.

Visual model;
image

raw code collision model :

image

modified code collision model:

image

@kjyv
Copy link
Owner

kjyv commented Feb 1, 2019

I'm not sure this is the right fix (it might give problems with other models). The question is why is one of your bounding boxes oriented wrong while the others are the way they should be. I think the link geometry in the URDF file might be defined wrongly which results in a wrong bounding box (maybe using rotation or position tags? These are not used at the moment, so they should always be defined from the link origin - there is a TODO in the code about that). The sign is thrown away because the bounding box is supposed to always extend in positive direction as a chain is built up.

@crush0441
Copy link
Author

@kjyv
Some of my links are in the right places because their coordinate are in the bounding box.

This problem happens ONLY when the link coordinate is out of the bounding box. So the edge points have the same sign.

whole robot

image

coordinate in the bound box
image

coordinate out of the bound box
image

@kjyv
Copy link
Owner

kjyv commented Feb 15, 2019

I see, that's a bit unusual to have the link origin away from the actual body. Is there a reason to do that?
Your patch might work for your case, but it incorrectly calculates the center point as (b[1][0])+(b[0][0]) + p[0], .... p is the link geometry position, b are the min and max coordinate values for each axis of the bounding box. I'm not sure why I added the abs calls. But it should be more like 0.5*(b[1][0]-b[0][0])+p[0]. I don't see why adding the min and max would be correct, also halving the geometry position is probably wrong. Also it is possible that the geometry position or bounding box is not determined correctly in your case. I can't really test this at the moment to fix it myself, sorry.

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.

None yet

2 participants