ethz-asl / nbvplanner

A real-time capable exploration and inspection path planner (next best view planning)
353 stars 121 forks source link

rtt.cpp: Possible errors in computation of visibility inside gain #9

Closed johuber closed 7 years ago

johuber commented 7 years ago

Hi, I used the visibility computation from the gain() function in rrt.cpp and found two issues:

  1. in rrt.cpp, line 529 if(dir.norm()>rangeSq) The function norm() computes the actual norm, not the square of it. Hence shouldn't this be changed to: if(dir.transpose().dot(dir)>rangeSq)

  2. in rrt.cpp, line 547: if(!inFoV) Don't we want to break this loop, when a point is INSIDE the field of view. Hence this should be: if(inFOV) Otherwise only points OUTSIDE the FoV will be used for the computation of the gain, which does not make sense.

I used this code to compute the visibility within my own work, and it did only give the proper results after I made those two changes.

I just noticed that the 2nd point was changed due to the closed issue #6 . However, after this change the computation is wrong, the way it was done before was correct.

birchera commented 7 years ago

Hi @johuber, both of your points make sense. I am going to take a closer look asap.