Open hzlijianjun opened 3 years ago
I'm not entirely sure. The source code was changed in this commit: https://github.com/playerproject/player/commit/7042a798ac1dc558d1a06faf78d267668cdb479e 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?
@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 "i2" this way but not "i" in the line: ` this->laser_ranges[i2][0] = data.ranges[index] * 1e3;`
Can you show me some light on this? Thanks!
https://github.com/playerproject/player/blob/b05878f9a803f981604fda1efffa2ac1ae28329d/server/drivers/position/vfh/vfh.cc#L725