趣味で作ってるロボット用ソフトウェア
 All Classes Files Functions Enumerations Enumerator Friends Pages
Lms_driver.h
Go to the documentation of this file.
1 #ifndef HRK_LMS_DRIVER_H
2 #define HRK_LMS_DRIVER_H
3 
9 #include <memory>
10 #include "Lidar.h"
11 
12 
13 namespace hrk
14 {
15  class Lms_driver : public Lidar
16  {
17  public:
18  enum {
19  Default_port = 2111,
20  };
21 
22  Lms_driver();
23  virtual ~Lms_driver();
24 
25  const char* what() const;
26 
27  bool open(const std::string& device_name_or_ip_address,
28  long baudrate_or_port_number, connection_t type = Ethernet);
29  bool open(Connection* connection);
30 
31  bool is_booting();
32 
33  void close();
34  bool is_open() const;
35  void set_connection(Connection* connection);
37 
38  bool start_measurement(measurement_t type = Distance,
39  int scan_times = Infinity_scan_times,
40  int skip_scan = 0);
41  bool get_distance(std::vector<long>& data,
42  long *time_stamp = NULL);
43  bool get_distance_intensity(std::vector<long>& data,
44  std::vector<unsigned short>&
45  intensity,
46  long *time_stamp);
47  bool get_multiecho(std::vector<long>& data_multi,
48  long* time_stamp);
49  bool get_multiecho_intensity(std::vector<long>& data_multiecho,
50  std::vector<unsigned short>&
51  intensity_multiecho,
52  long* time_stamp);
53  bool set_scanning_parameter(int first_step, int last_step,
54  int skip_step);
55  void stop_measurement();
56  bool set_sensor_time_stamp(long time_stamp);
57 
58  double index2rad(int index) const;
59  double index2deg(int index) const;
60  int rad2index(double radian) const;
61  int deg2index(double degree) const;
62 
63  double step2rad(int step) const;
64  double step2deg(int step) const;
65  int rad2step(double radian) const;
66  int deg2step(double degree) const;
67 
68  int min_step() const;
69  int max_step() const;
70  int front_step() const;
71  int total_steps() const;
72  long min_distance() const;
73  long max_distance() const;
74  long scan_usec() const;
75  int max_data_size() const;
76  int max_echo_size() const;
77 
78  std::string sensor_series_name() const;
79  std::string sensor_product_name() const;
80  std::string sensor_product_version() const;
81  std::string serial_id() const;
82 
83  private:
84  Lms_driver(const Lms_driver& rhs);
85  Lms_driver& operator = (const Lms_driver& rhs);
86 
87  struct pImpl;
88  std::auto_ptr<pImpl> pimpl;
89  };
90 }
91 
92 #endif
Connection * connection()
接続オブジェクトを返す
Definition: Lms_driver.cpp:598
Lidar インターフェース
Lidar インターフェース
Definition: Lidar.h:18
距離
Definition: Lidar.h:31
bool set_scanning_parameter(int first_step, int last_step, int skip_step)
Definition: Lms_driver.cpp:693
接続のインターフェース
Definition: Connection.h:21
bool is_open() const
接続しているかを返す
Definition: Lms_driver.cpp:585
void set_connection(Connection *connection)
接続オブジェクトを設定する
Definition: Lms_driver.cpp:591
measurement_t
Definition: Lidar.h:30
void close()
接続を閉じる
Definition: Lms_driver.cpp:579
Definition: Lms_driver.h:15
const char * what() const
状態を示すメッセージを返す
Definition: Lms_driver.cpp:548
bool is_booting()
Definition: Lms_driver.cpp:572