Go to the documentation of this file.00001
00002
00003 #include "urg_sensor.h"
00004 #include "urg_utils.h"
00005 #include <stdlib.h>
00006
00007
00008 int main(void)
00009 {
00010 urg_t urg;
00011 int ret;
00012 long *length_data;
00013 int length_data_size;
00014
00015
00016 const char connect_device[] = "COM1";
00017 const long connect_baudrate = 115200;
00018
00019
00020 ret = urg_open(&urg, URG_SERIAL, connect_device, connect_baudrate);
00021
00022
00023
00024 length_data = (long *)malloc(sizeof(long) * urg_max_data_size(&urg));
00025
00026
00027
00028 ret = urg_start_measurement(&urg, URG_DISTANCE, 1, 0);
00029
00030
00031 length_data_size = urg_get_distance(&urg, length_data, NULL);
00032
00033
00034
00035 urg_close(&urg);
00036
00037 return 0;
00038 }