説明を見る。00001 #ifndef QRK_LIDAR_H
00002 #define QRK_LIDAR_H
00003
00016 #include <vector>
00017 #include <cstddef>
00018
00019
00020 namespace qrk
00021 {
00023 class Lidar
00024 {
00025 public:
00026 typedef enum {
00027 Distance,
00028 Distance_intensity,
00029 Multiecho,
00030 Multiecho_intensity,
00031 } measurement_type_t;
00032
00033 typedef enum {
00034 Serial,
00035 Ethernet,
00036 } connection_type_t;
00037
00038 virtual ~Lidar(void)
00039 {
00040 }
00041
00042 virtual const char* what(void) const = 0;
00043
00044 virtual bool open(const char* device_name, long baudrate,
00045 connection_type_t type) = 0;
00046 virtual void close(void) = 0;
00047 virtual bool is_open(void) const = 0;
00048
00049 virtual void set_timeout_msec(int msec) = 0;
00050
00051 virtual bool laser_on(void) = 0;
00052 virtual bool laser_off(void) = 0;
00053
00054 virtual void reboot(void) = 0;
00055
00056 virtual void sleep(void) = 0;
00057 virtual void wakeup(void) = 0;
00058 virtual bool is_stable(void) = 0;
00059
00061 virtual bool start_measurement(measurement_type_t type,
00062 int scan_times, int skip_scan) = 0;
00063
00065 virtual bool get_distance(std::vector<long>& data,
00066 long *time_stamp) = 0;
00067 virtual bool get_distance_intensity(std::vector<long>& data,
00068 std::vector<unsigned short>&
00069 intensity,
00070 long *time_stamp) = 0;
00071
00072 virtual bool get_multiecho(std::vector<long>& data_multi,
00073 long* time_stamp) = 0;
00074
00075 virtual bool get_multiecho_intensity(std::vector<long>& data_multiecho,
00076 std::vector<unsigned short>&
00077 intensity_multiecho,
00078 long* time_stamp) = 0;
00079
00080 virtual bool set_scanning_parameter(int first_step, int last_step,
00081 int skip_step) = 0;
00082
00084 virtual void stop_measurement(void) = 0;
00085
00087 virtual bool set_sensor_time_stamp(long time_stamp) = 0;
00088
00090 virtual double index2rad(int index) const = 0;
00091 virtual double index2deg(int index) const = 0;
00092 virtual int rad2index(double radian) const = 0;
00093 virtual int deg2index(double degree) const = 0;
00094 virtual int rad2step(double radian) const = 0;
00095 virtual int deg2step(double degree) const = 0;
00096 virtual double step2rad(int step) const = 0;
00097 virtual double step2deg(int step) const = 0;
00098 virtual int step2index(int step) const = 0;
00099
00100 virtual int min_step(void) const = 0;
00101 virtual int max_step(void) const = 0;
00102 virtual long min_distance(void) const = 0;
00103 virtual long max_distance(void) const = 0;
00104 virtual long scan_usec(void) const = 0;
00105 virtual int max_data_size(void) const = 0;
00106 virtual int max_echo_size(void) const = 0;
00107
00108 virtual const char* product_type(void) const = 0;
00109 virtual const char* firmware_version(void) const = 0;
00110 virtual const char* serial_id(void) const = 0;
00111 virtual const char* status(void) const = 0;
00112 virtual const char* state(void) const = 0;
00113
00114 virtual int raw_write(const char* data, size_t data_size) = 0;
00115 virtual int raw_read(char* data, size_t max_data_size, int timeout) = 0;
00116 virtual int raw_readline(char* data, size_t max_data_size,
00117 int timeout) = 0;
00118 };
00119 }
00120
00121 #endif