Example that shows how to acquire Sick LD-MRS laser measurements.
- Warning
- For the moment, this example is only working on UNIX platforms since the Sick LD-MRS driver was not ported to Windows.
#include <visp/vpDebug.h>
#include <visp/vpSickLDMRS.h>
#include <visp/vpParseArgv.h>
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
int main()
{
try {
vpSickLDMRS laser;
std::string ip = "131.254.12.119";
laser.setIpAddress(ip);
laser.setup();
unsigned long int iter = 0;
for ( ; ; ) {
if (laser.measure(laserscan) == false)
continue;
iter ++;
std::cout << "iter: " << iter << " time: "
}
return 0;
}
std::cout << "Catch an exception: " << e << std::endl;
return 1;
}
}
#else // #ifdef UNIX
int main()
{
std::cout << "This example is only working on UNIX platforms \n"
<< "since the Sick LD-MRS driver was not ported to Windows."
<< std::endl;
return 0;
}
#endif // #ifdef UNIX