Classes | Typedefs | Enumerations | Functions
urg_sensor.h File Reference

URG sensor. More...

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

Go to the source code of this file.

Classes

struct  urg_t
 URG sensor. More...
 

Typedefs

typedef urg_measurement_type_t(* urg_error_handler) (const char *status, void *urg)
 

Enumerations

enum  { URG_SCAN_INFINITY = 0, URG_MAX_ECHO = 3 }
 
enum  urg_measurement_type_t {
  URG_DISTANCE, URG_DISTANCE_INTENSITY, URG_MULTIECHO, URG_MULTIECHO_INTENSITY,
  URG_STOP, URG_UNKNOWN
}
 
enum  urg_range_data_byte_t { URG_COMMUNICATION_3_BYTE, URG_COMMUNICATION_2_BYTE }
 

Functions

void urg_close (urg_t *urg)
 
int urg_get_distance (urg_t *urg, long data[], long *time_stamp, unsigned long long *system_time_stamp)
 
int urg_get_distance_intensity (urg_t *urg, long data[], unsigned short intensity[], long *time_stamp, unsigned long long *system_time_stamp)
 
int urg_get_multiecho (urg_t *urg, long data_multi[], long *time_stamp, unsigned long long *system_time_stamp)
 
int urg_get_multiecho_intensity (urg_t *urg, long data_multi[], unsigned short intensity_multi[], long *time_stamp, unsigned long long *system_time_stamp)
 
int urg_is_stable (urg_t *urg)
 
int urg_laser_off (urg_t *urg)
 
int urg_laser_on (urg_t *urg)
 
int urg_open (urg_t *urg, urg_connection_type_t connection_type, const char *device_or_address, long baudrate_or_port)
 
int urg_reboot (urg_t *urg)
 
long urg_scip_decode (const char data[], int size)
 SCIP 文字列のデコード. More...
 
const char * urg_sensor_firmware_date (urg_t *urg)
 
const char * urg_sensor_firmware_version (urg_t *urg)
 
const char * urg_sensor_product_type (urg_t *urg)
 
const char * urg_sensor_protocol_version (urg_t *urg)
 returns the protocol version More...
 
const char * urg_sensor_serial_id (urg_t *urg)
 
const char * urg_sensor_state (urg_t *urg)
 
const char * urg_sensor_status (urg_t *urg)
 
const char * urg_sensor_vendor (urg_t *urg)
 returns the vendor name More...
 
int urg_set_communication_data_size (urg_t *urg, urg_range_data_byte_t data_byte)
 
void urg_set_error_handler (urg_t *urg, urg_error_handler handler)
 
int urg_set_scanning_parameter (urg_t *urg, int first_step, int last_step, int skip_step)
 
void urg_set_timeout_msec (urg_t *urg, int msec)
 タイムアウト時間の設定 More...
 
void urg_sleep (urg_t *urg)
 
int urg_start_measurement (urg_t *urg, urg_measurement_type_t type, int scan_times, int skip_scan)
 
int urg_start_time_stamp_mode (urg_t *urg)
 
int urg_stop_measurement (urg_t *urg)
 
int urg_stop_time_stamp_mode (urg_t *urg)
 
long urg_time_stamp (urg_t *urg)
 
void urg_wakeup (urg_t *urg)
 

Detailed Description

URG sensor.

URG 用の基本的な関数を提供します。

Author
Satofumi KAMIMURA
Id
urg_sensor.h,v 540bc11f70c8 2011/05/08 23:04:49 satofumi

Definition in file urg_sensor.h.

Typedef Documentation

typedef urg_measurement_type_t(* urg_error_handler) (const char *status, void *urg)

error handler

Definition at line 62 of file urg_sensor.h.

Enumeration Type Documentation

anonymous enum
Enumerator
URG_SCAN_INFINITY 
URG_MAX_ECHO 

Definition at line 54 of file urg_sensor.h.

Enumerator
URG_DISTANCE 
URG_DISTANCE_INTENSITY 
URG_MULTIECHO 
URG_MULTIECHO_INTENSITY 
URG_STOP 
URG_UNKNOWN 

Definition at line 35 of file urg_sensor.h.

Enumerator
URG_COMMUNICATION_3_BYTE 
URG_COMMUNICATION_2_BYTE 

Definition at line 48 of file urg_sensor.h.

Function Documentation

void urg_close ( urg_t urg)
See also
urg_open()

Definition at line 745 of file urg_sensor.c.

int urg_get_distance ( urg_t urg,
long  data[],
long *  time_stamp,
unsigned long long *  system_time_stamp 
)
See also
urg_start_measurement(), urg_max_data_size()

Definition at line 934 of file urg_sensor.c.

int urg_get_distance_intensity ( urg_t urg,
long  data[],
unsigned short  intensity[],
long *  time_stamp,
unsigned long long *  system_time_stamp 
)

Example

1 int data_size = urg_max_data_size(&urg);
2 long *data = malloc(data_size * sizeof(long));
3 long *intensity = malloc(data_size * sizeof(unsigned short));
4 
5 ...
6 
7 urg_start_measurement(&urg, URG_DISTANCE_INTENSITY, 1, 0);
8 int n = urg_get_distance_intensity(&urg, data, intesnity, NULLL);
See also
urg_start_measurement(), urg_max_data_size()

Definition at line 943 of file urg_sensor.c.

int urg_get_multiecho ( urg_t urg,
long  data_multi[],
long *  time_stamp,
unsigned long long *  system_time_stamp 
)

Example

1 long *data_multi = malloc(3 * urg_max_data_size(&urg) * sizeof(long));
2 
3 ...
4 
5 urg_start_measurement(&urg, URG_MULTIECHO, 1, 0);
6 int n = urg_get_distance_intensity(&urg, data_multi, NULLL);
See also
urg_start_measurement(), urg_max_data_size()

Definition at line 955 of file urg_sensor.c.

int urg_get_multiecho_intensity ( urg_t urg,
long  data_multi[],
unsigned short  intensity_multi[],
long *  time_stamp,
unsigned long long *  system_time_stamp 
)

Example

1 int data_size = urg_max_data_size(&urg);
2 long *data_multi = malloc(3 * data_size * sizeof(long));
3 long *intensity_multi = malloc(3 * data_size * sizeof(unsigned short));
4 
5 ...
6 
7 urg_start_measurement(&urg, URG_DISTANCE_INTENSITY, 1, 0);
8 int n = urg_get_multiecho_intensity(&urg, data_multi,
9 intesnity_multi, NULLL);
See also
urg_start_measurement(), urg_max_data_size()

Definition at line 965 of file urg_sensor.c.

int urg_is_stable ( urg_t urg)

Definition at line 1122 of file urg_sensor.c.

int urg_laser_off ( urg_t urg)

Definition at line 1070 of file urg_sensor.c.

int urg_laser_on ( urg_t urg)

Definition at line 1046 of file urg_sensor.c.

int urg_open ( urg_t urg,
urg_connection_type_t  connection_type,
const char *  device_or_address,
long  baudrate_or_port 
)
See also
urg_close()

Definition at line 684 of file urg_sensor.c.

int urg_reboot ( urg_t urg)
Examples:
reboot_test.c.

Definition at line 1076 of file urg_sensor.c.

long urg_scip_decode ( const char  data[],
int  size 
)

SCIP 文字列のデコード.

Definition at line 364 of file urg_sensor.c.

const char* urg_sensor_firmware_date ( urg_t urg)

Definition at line 1268 of file urg_sensor.c.

const char* urg_sensor_firmware_version ( urg_t urg)

Definition at line 1244 of file urg_sensor.c.

const char* urg_sensor_product_type ( urg_t urg)

Definition at line 1180 of file urg_sensor.c.

const char* urg_sensor_protocol_version ( urg_t urg)

returns the protocol version

Parameters
[in]URG
Returns
The current protocol version

Definition at line 1300 of file urg_sensor.c.

const char* urg_sensor_serial_id ( urg_t urg)

Definition at line 1201 of file urg_sensor.c.

const char* urg_sensor_state ( urg_t urg)

Definition at line 1350 of file urg_sensor.c.

const char* urg_sensor_status ( urg_t urg)

Definition at line 1325 of file urg_sensor.c.

const char* urg_sensor_vendor ( urg_t urg)

returns the vendor name

Parameters
[in]URG
Returns
The vendor name

Definition at line 1221 of file urg_sensor.c.

int urg_set_communication_data_size ( urg_t urg,
urg_range_data_byte_t  data_byte 
)
void urg_set_error_handler ( urg_t urg,
urg_error_handler  handler 
)

Definition at line 1375 of file urg_sensor.c.

int urg_set_scanning_parameter ( urg_t urg,
int  first_step,
int  last_step,
int  skip_step 
)

Example

1 urg_set_scanning_parameter(&urg, urg_deg2step(&urg, -45),
2 urg_deg2step(&urg, +45), 1);
3 urg_start_measurement(&urg, URG_DISTANCE, 0);
4 int n = urg_get_distance(&urg, data, NULL);
5 for (int i = 0; i < n; ++i) {
6 printf("%d [mm], %d [deg]\n", data[i], urg_index2deg(&urg, i));
7 }
See also
urg_step_min_max(), urg_rad2step(), urg_deg2step()

Definition at line 1009 of file urg_sensor.c.

void urg_set_timeout_msec ( urg_t urg,
int  msec 
)

タイムアウト時間の設定

Parameters
[in,out]urgURG センサ管理
[in]msecタイムアウトする時間 [msec]
Attention
urg_open() を呼び出すと timeout の設定値はデフォルト値に初期化されるため、この関数は urg_open() 後に呼び出すこと。

Definition at line 755 of file urg_sensor.c.

void urg_sleep ( urg_t urg)

Definition at line 1101 of file urg_sensor.c.

int urg_start_measurement ( urg_t urg,
urg_measurement_type_t  type,
int  scan_times,
int  skip_scan 
)
int urg_start_time_stamp_mode ( urg_t urg)

Definition at line 761 of file urg_sensor.c.

int urg_stop_measurement ( urg_t urg)

Example

1 urg_start_measurement(&urg, URG_DISTANCE, URG_SCAN_INFINITY, 0);
2 for (int i = 0; i < 10; ++i) {
3 urg_get_distance(&urg, data, NULL);
4 }
5 urg_stop_measurement(&urg);
See also
urg_start_measurement()

Definition at line 978 of file urg_sensor.c.

int urg_stop_time_stamp_mode ( urg_t urg)

Definition at line 813 of file urg_sensor.c.

long urg_time_stamp ( urg_t urg)

Definition at line 780 of file urg_sensor.c.

void urg_wakeup ( urg_t urg)

Definition at line 1116 of file urg_sensor.c.



urg_c
Author(s): Satofumi Kamimura , Katsumi Kimoto, Adrian Boeing
autogenerated on Wed Jun 10 2020 03:48:10