30 int main(
int argc,
char * argv[]) {
36 if ((argc != 2 && argc != 3) || (argc == 2 && strcasecmp(argv[1],
"--help") == 0)) {
37 cout <<
"Usage: lms2xx_set_variant PATH [BAUD RATE]" << endl
38 <<
"Ex: lms2xx_set_variant /dev/ttyUSB0 9600" << endl;
50 if ((desired_baud = SickLMS2xx::StringToSickBaud(argv[2])) == SickLMS2xx::SICK_BAUD_UNKNOWN) {
51 cerr <<
"Invalid baud value! Valid values are: 9600, 19200, 38400, and 500000" << endl;
60 unsigned int values[SickLMS2xx::SICK_MAX_NUM_MEASUREMENTS] = {0};
61 unsigned int num_values = 0;
71 cerr <<
"Initialize failed! Are you using the correct device path?" << endl;
90 cout <<
"\tSetting variant to 100/0.25" << std::endl << flush;
91 sick_lms_2xx.
SetSickVariant(SickLMS2xx::SICK_SCAN_ANGLE_100,SickLMS2xx::SICK_SCAN_RESOLUTION_25);
96 cout <<
"\tAcquiring some measurements..." << endl;
97 for(
unsigned int i = 0; i < 10; i++) {
103 cout <<
"\t Num. Values: " << num_values << endl;
110 cout << std::endl <<
"\tSetting variant to 180/0.50" << endl;
111 sick_lms_2xx.
SetSickVariant(SickLMS2xx::SICK_SCAN_ANGLE_180,SickLMS2xx::SICK_SCAN_RESOLUTION_50);
116 cout <<
"\tAcquiring some measurements..." << endl;
117 for(
unsigned int i = 0; i < 10; i++) {
123 cout <<
"\t Num. Values: " << num_values << endl;
130 cerr <<
"An error occurred!" << endl;
136 cerr <<
"Oops... Your Sick is an LMS Fast!" << endl;
137 cerr <<
"It doesn't support the variant command." << endl;
148 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...