24 int main(
int argc,
char* argv[])
30 unsigned int values[SickLMS2xx::SICK_MAX_NUM_MEASUREMENTS] = {0};
31 unsigned int num_values = 0;
34 if ((argc != 2 && argc != 3) || (argc == 2 && strcasecmp(argv[1],
"--help") == 0)) {
35 cout <<
"Usage: lms2xx_simple_app PATH [BAUD RATE]" << endl
36 <<
"Ex: lms2xx_simple_app /dev/ttyUSB0 9600" << endl;
48 if ((desired_baud = SickLMS2xx::StringToSickBaud(argv[2])) == SickLMS2xx::SICK_BAUD_UNKNOWN) {
49 cerr <<
"Invalid baud value! Valid values are: 9600, 19200, 38400, and 500000" << endl;
67 cerr <<
"Initialize failed! Are you using the correct device path?" << endl;
76 for (
unsigned int i=0; i < 10; i++) {
78 cout <<
"\t Num. Values: " << num_values << endl;
85 cerr <<
"An error occurred!" << endl;
96 cerr <<
"Uninitialize failed!" << endl;
SickLMS2xx * sick_lms_2xx
int main(int argc, char *argv[])
Definition of class SickLMS2xx. Code by Jason C. Derenick and Thomas H. Miller. Contact derenick(at)l...