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

Bug in interpMapValueWithDerivatives (OccGridMapUtil.h)? #16

Open
alik55 opened this issue Mar 26, 2015 · 4 comments
Open

Bug in interpMapValueWithDerivatives (OccGridMapUtil.h)? #16

alik55 opened this issue Mar 26, 2015 · 4 comments

Comments

@alik55
Copy link

alik55 commented Mar 26, 2015

It seems x and y weights are switched in derivatives at Line 341:

return Eigen::Vector3f(
((intensities[0] * xFacInv + intensities[1] * factors[0]) * (yFacInv)) +
((intensities[2] * xFacInv + intensities[3] * factors[0]) * (factors[1])),
-((dx1 * xFacInv) + (dx2 * factors[0])),
-((dy1 * yFacInv) + (dy2 * factors[1]))

should be (changes in the last two lines):

return Eigen::Vector3f(
((intensities[0] * xFacInv + intensities[1] * factors[0]) * (yFacInv)) +
((intensities[2] * xFacInv + intensities[3] * factors[0]) * (factors[1])),
-((dx1 * yFacInv) + (dx2 * factors[1])),
-((dy1 * xFacInv) + (dy2 * factors[0]))

@ytgui
Copy link

ytgui commented Jul 31, 2016

Hi,
I also find that bug these days, and I'm confused why there is a math error but this lib could run correctly.
I think that because xFacInv or yFacInv are both weight value in range (0,1), and dx,dy decide the positive or negative. A multiplication of dx1*xFacInv is same to k * dy1 * yFacInv.

@watcherZY
Copy link

i have confirmed that you are correct , i used a same rosbag to test -((dx1 * xFacInv) + (dx2 * factors[0])),
-((dy1 * yFacInv) + (dy2 * factors[1])) AND -((dx1 * yFacInv) + (dx2 * factors[1])),
-((dy1 * xFacInv) + (dy2 * factors[0])). the second one works much better! and dosen^t become disorder when the robot rotation

@jondo
Copy link

jondo commented Mar 17, 2021

Why was this closed?

@StefanFabian
Copy link
Member

I've closed all issues older than 5 years due to their age but you're right, this one may still be relevant.
I'm not sure if @skohlbr will have the time to look at this, though.

@StefanFabian StefanFabian reopened this Mar 17, 2021
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

No branches or pull requests

5 participants