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

Dose the implementation code for VFH+ work correctly? #20

Open
hzlijianjun opened this issue Jan 5, 2021 · 2 comments
Open

Dose the implementation code for VFH+ work correctly? #20

hzlijianjun opened this issue Jan 5, 2021 · 2 comments

Comments

@hzlijianjun
Copy link

hzlijianjun commented Jan 5, 2021

Hi, I found that some lines of code were commented in the VFH_Class::ProcessLaser method form vfh.cc file, Such as lines of No 725, No 733 and No 734. I suspect whether it was a mistake comment.
Dose the implementation code for VFH+ work correctly?
Thanks!
@richmattes
Copy link
Member

richmattes commented Jan 8, 2021

I'm not entirely sure. The source code was changed in this commit:
7042a79
The commit message talks about interpolating the scan to a full 180 degrees, i think the replaced code might have just been commented out but not deleted. Im not sure commented code means something is broken, are you seeing other issues?

@hzlijianjun
Copy link
Author

hzlijianjun commented Jan 8, 2021

@richmattes Thanks for looking into this.
I have a 360 degress scaning lidar, for which I was going to write a custom laser driver. My custom laser driver would provider scaned data as following:
data.min_angle = 0;
data.resolution = 1;
data.ranges_count = 360

I debout that my scaned data may unmatch with following logical of VFH_Class::ProcessLaser method:

for(i = 0; i < 181; i++)
{
unsigned int index = (int)rint(i/db);
//assert(index >= 0 && index < data.ranges_count);
if(index < 0 || index >= data.ranges_count)
continue;
this->laser_ranges[i*2][0] = data.ranges[index] * 1e3;
// this->laser_ranges[i*2][1] = index;
// b += db;
}

And why is "i*2" this way but not "i" in the line:
this->laser_ranges[i*2][0] = data.ranges[index] * 1e3;

Can you show me some light on this?
Thanks!

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

2 participants