36 int main(
int argc,
char **argv)
38 std::cout <<
"Hello world!" << std::endl;
39 std::string scanner_ip(
"192.168.1.71");
42 for(
int i=0; i<2; i++ )
44 std::cout <<
"Connecting to scanner at " << scanner_ip <<
" ... ";
45 if (driver.
connect(scanner_ip, 80))
46 std::cout <<
"OK" << std::endl;
49 std::cout <<
"FAILED!" << std::endl;
50 std::cerr <<
"Connection to scanner at " << scanner_ip <<
" failed!" << std::endl;
57 std::cout <<
"Current scanner settings:" << std::endl;
58 std::cout <<
"============================================================" << std::endl;
59 for (
const auto& p : params)
60 std::cout << p.first <<
" : " << p.second << std::endl;
61 std::cout <<
"============================================================" << std::endl;
66 std::cout <<
"Starting capturing: ";
68 std::cout <<
"OK" << std::endl;
71 std::cout <<
"FAILED!" << std::endl;
75 for (
int s = 0;
s < 5;
s++)
77 std::this_thread::sleep_for(std::chrono::seconds(1));
78 int scans_captured = 0;
80 for (
int i = 0; i < scans_available; i++)
82 auto scandata = driver.
getScan();
85 std::cout <<
"Received " << scans_captured <<
" from scanner" << std::endl;
88 std::cout <<
"Trying to stop capture" << std::endl;
90 std::cout <<
"Stopping capture: " << driver.
stopCapturing() << std::endl;
94 std::cout <<
"Goodbye world!" << std::endl;
Driver for the laserscanner R2000 of Pepperl+Fuchs.
bool setSamplesPerScan(unsigned int samples)
bool setScanFrequency(unsigned int frequency)
bool connect(const std::string hostname, int port=80)
std::size_t getFullScansAvailable() const
Get the total number of fully received laserscans available.
const std::map< std::string, std::string > & getParameters()
int main(int argc, char **argv)