urg_utils.h File Reference

URG sensor utility. More...

#include "urg_c/urg_sensor.h"
Include dependency graph for urg_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


int urg_deg2index (const urg_t *urg, double degree)
int urg_deg2step (const urg_t *urg, double degree)
void urg_distance_min_max (const urg_t *urg, long *min_distance, long *max_distance)
const char * urg_error (const urg_t *urg)
double urg_index2deg (const urg_t *urg, int index)
double urg_index2rad (const urg_t *urg, int index)
int urg_max_data_size (const urg_t *urg)
int urg_rad2index (const urg_t *urg, double radian)
int urg_rad2step (const urg_t *urg, double radian)
long urg_scan_usec (const urg_t *urg)
double urg_step2deg (const urg_t *urg, int step)
int urg_step2index (const urg_t *urg, int step)
double urg_step2rad (const urg_t *urg, int step)
void urg_step_min_max (const urg_t *urg, int *min_step, int *max_step)

Detailed Description

URG sensor utility.

urg_utils.h,v 630ee326c5ce 2011/02/19 08:06:25 Satofumi

Definition in file urg_utils.h.

Function Documentation

◆ urg_deg2index()

int urg_deg2index ( const urg_t urg,
double  degree 

Definition at line 160 of file urg_utils.c.

◆ urg_deg2step()

int urg_deg2step ( const urg_t urg,
double  degree 

Definition at line 176 of file urg_utils.c.

◆ urg_distance_min_max()

void urg_distance_min_max ( const urg_t urg,
long *  min_distance,
long *  max_distance 


long min_distance, max_distance;
urg_distance_min_max(&urg, &min_distance, &max_distance);
for (int i = 0; i < n; ++i) {
long distance = data[i];
if ((distance < min_distance) || (distance > max_distance)) {

Definition at line 73 of file urg_utils.c.

◆ urg_error()

const char* urg_error ( const urg_t urg)


if (!urg_open(&urg, "/dev/ttyACM0", 115200, URG_SERIAL)) {
printf("urg_open: %s\n", urg_error(&urg));
return -1;

Definition at line 30 of file urg_utils.c.

◆ urg_index2deg()

double urg_index2deg ( const urg_t urg,
int  index 

Definition at line 138 of file urg_utils.c.

◆ urg_index2rad()

double urg_index2rad ( const urg_t urg,
int  index 


int n = urg_get_distance(&urg, data, NULL);
for (int i = 0; i < n; ++i) {
long distance = data[i];
double radian = urg_index2rad(i);
double x = distance * cos(radian);
double y = distance * sin(radian);
printf("%.1f, %.1f\n", x, y);
See also
urg_index2deg(), urg_rad2index(), urg_deg2index()

Definition at line 123 of file urg_utils.c.

◆ urg_max_data_size()

int urg_max_data_size ( const urg_t urg)

Definition at line 114 of file urg_utils.c.

◆ urg_rad2index()

int urg_rad2index ( const urg_t urg,
double  radian 

Definition at line 144 of file urg_utils.c.

◆ urg_rad2step()

int urg_rad2step ( const urg_t urg,
double  radian 

◆ urg_scan_usec()

long urg_scan_usec ( const urg_t urg)

Definition at line 104 of file urg_utils.c.

◆ urg_step2deg()

double urg_step2deg ( const urg_t urg,
int  step 

Definition at line 192 of file urg_utils.c.

◆ urg_step2index()

int urg_step2index ( const urg_t urg,
int  step 

Definition at line 198 of file urg_utils.c.

◆ urg_step2rad()

double urg_step2rad ( const urg_t urg,
int  step 

Definition at line 182 of file urg_utils.c.

◆ urg_step_min_max()

void urg_step_min_max ( const urg_t urg,
int *  min_step,
int *  max_step 


urg_step_min_max(&urg, &min_step, &max_step);
printf("range first: %d [deg]\n", urg_step2deg(&urg, min_step));
printf("range last : %d [deg]\n", urg_step2deg(&urg, max_step));
See also
urg_set_scanning_parameter(), urg_step2rad(), urg_step2deg()

Definition at line 91 of file urg_utils.c.

int urg_open(urg_t *urg, urg_connection_type_t connection_type, const char *device_or_address, long baudrate_or_port)
Definition: urg_sensor.c:684
void urg_step_min_max(const urg_t *urg, int *min_step, int *max_step)
Definition: urg_utils.c:91
int urg_get_distance(urg_t *urg, long data[], long *time_stamp, unsigned long long *system_time_stamp)
Definition: urg_sensor.c:934
void urg_distance_min_max(const urg_t *urg, long *min_distance, long *max_distance)
Definition: urg_utils.c:73
const char * urg_error(const urg_t *urg)
Definition: urg_utils.c:30
double urg_index2rad(const urg_t *urg, int index)
Definition: urg_utils.c:123
double urg_step2deg(const urg_t *urg, int step)
Definition: urg_utils.c:192
シリアル, USB 接続
Definition: urg_connection.h:33

Author(s): Satofumi Kamimura , Katsumi Kimoto, Adrian Boeing
autogenerated on Wed Mar 2 2022 01:08:11