21 int main(
int argc,
char *argv[])
24 const char device[] =
"/dev/ttyACM0";
28 printf(
"UrgCtrl::connect: %s\n", urg.
what());
47 const double rad90 = 90.0 * M_PI / 180.0;
55 enum { CaptureTimes = 10 };
57 for (
int i = 0; i < CaptureTimes;) {
62 int n = urg.
capture(data, ×tamp);
69 printf(
"timestamp: %ld, (%d), %ld\n",
70 timestamp,
getTicks(), timestamp - pre_timestamp);
71 pre_timestamp = timestamp;
73 for (
int j = 0; j < n; ++j) {
75 printf(
"%d:%ld, ", j, data[j]);