Go to the documentation of this file.00001 #include "urg_sensor.h"
00002 #include "urg_utils.h"
00003
00004 int main(void)
00005 {
00006 const char connect_device[] = "/dev/ttyACM0";
00007 const long connect_baudrate = 115200;
00008 urg_t urg;
00009 int first_step;
00010 int last_step;
00011 int skip_step;
00012 int scan_times;
00013 int skip_scan;
00014 int ret;
00015
00016
00017
00018
00019 ret = urg_open(&urg, URG_SERIAL, connect_device, connect_baudrate);
00020
00021
00022
00023
00024 first_step = urg_rad2step(&urg, -45);
00025 last_step = urg_rad2step(&urg, +45);
00026 skip_step = 0;
00027 ret = urg_set_scanning_parameter(&urg, first_step, last_step, skip_step);
00028
00029
00030
00031
00032 scan_times = 123;
00033 skip_scan = 0;
00034 ret = urg_start_measurement(&urg, URG_DISTANCE, scan_times, skip_scan);
00035
00036 return 0;
00037 }