VisiLibity Frequently Asked Questions


I am getting computation errors. What should I do?

Programs may crash if (1) the robustness constant &epsilon is chosen poorly, or (2) the environment model is not &epsilon -valid (see answer to next question). Before reporting a bug, try varying &epsilon by a few orders of magnitude in both directions or checking evironment &epsilon -validity using the Enviroment::is_valid method. Note &epsilon should never be set to zero except when performing certain debugging procedures on the VisiLibity code itself. To start, try setting &epsilon to a number a couple orders of magnitude smaller than the smallest featrure in the environment, e.g., double &epsilon = 0.0000001; This means you must include an &epsilon in all function calls, i.e., do not use the default argument &epsilon=0.0. For example, you need to add &epsilon at Visibility_Polygon(observer, env, epsilon).

Will VisiLibity work for polygonal environments where the edges of distinct polygons intersect?

No, VisiLibity R-1 is not meant to operate on environments where edges of distinct polygons intersect. For correctness of computation, in addition to choosing suitable &epsilon, the environment must be `` &epsilon -valid''. This can be checked using the Environment::is_valid() method. An environment is &epsilon -valid if none of its outer boundary or holes intersect each other, and there is a distance at least &epsilon between any features (vertices and edges), and there can be no redundant vertices (e.g. don't list the first vertex redundantly also as the last) in the polygon vertex lists.

If your environment is not &epsilon -valid and you want VisiLibity to work for your application, then you must perform preprocessing to enforce &epsilon -validity. I plan to remove the &epsilon -validity precondition in the next version of VisiLibity; until then I appologize for the inconvenience.

Should I cache a Visibility_Graph if I'm performing many shortest path queries in the same Environment?

Yes. Here's how:
1) Define a small &epsilon like this: double epsilon = 0.000000001; This is very important, otherwise there are robustness/degeneracy problems.
2) Construct your environment like this: VisiLibity::Environment environment( filename );
2) Construct the visibility graph like this: VisiLibity::Visibility_Graph visibility_graph( environment, epsilon );
3) Make path queries like this: Polyline path = environment.shortest_path( startpoint, endpoint, visibility_graph, epsilon );

I am unable to compile VisiLibity under Microsoft Windows. What should I do?

VisiLibity R-1 uses definitions which do not exist in the Microsoft Visual Studio compilers. To add these definitions, uncomment these lines in the header visilibity.hpp
//Uncomment these lines when compiling under
//Microsoft Visual Studio
/*
#include<limits>
#define NAN std::numeric_limits<double>::quiet_NaN()
#define INFINITY std::numeric_limits<double>::infinity()
#define M_PI 3.141592653589793238462643
#define and &&
#define or ||
*/
Alternatively, you could get a Gnu compiler working on your machine. Some helpful hints on getting a Gnu complier running on a Windows machine can be found under Notes on Matlab Interface under Windows.

How do I make VisiLibity work on a 64-bit machine?

To compile VisiLibity on a pure 64-bit system, add -fPIC to the CXXFLAGS in the makefile. Also, if Matlab does not link to the correct libraries, try changing the symlinks in /usr/local/MATLAB/R2010b/sys/os/glnxa64/ to the correct ones in /usr/lib/