00001 #ifndef QRK_M_URG_CTRL_H
00002 #define QRK_M_URG_CTRL_H
00003
00013 #include "UrgCtrl.h"
00014
00015
00016 namespace qrk
00017 {
00021 class mUrgCtrl : public RangeSensor
00022 {
00023 mUrgCtrl(void);
00024 mUrgCtrl(const mUrgCtrl& rhs);
00025 mUrgCtrl& operator = (const mUrgCtrl& rhs);
00026
00027 struct pImpl;
00028 std::auto_ptr<pImpl> pimpl;
00029
00030 public:
00034 enum {
00035 DefaultBaudrate = 115200,
00036 Infinity = 0,
00037 };
00038
00039
00083 explicit mUrgCtrl(int argc, char *argv[]);
00084 ~mUrgCtrl(void);
00085
00086 const char* what(void) const;
00087
00088 bool connect(const char* device, long baudrate = DefaultBaudrate);
00089 void setConnection(Connection* con);
00090 Connection* connection(void);
00091 void disconnect(void);
00092 bool isConnected(void) const;
00093
00094 long minDistance(void) const;
00095 long maxDistance(void) const;
00096 int maxScanLines(void) const;
00097
00098 void setRetryTimes(size_t times);
00099
00100 int scanMsec(void) const;
00101
00102 void setCaptureMode(RangeCaptureMode mode);
00103 RangeCaptureMode captureMode(void);
00104
00105 void setCaptureRange(int begin_index, int end_index);
00106 void setCaptureFrameInterval(size_t interval);
00107 void setCaptureTimes(size_t times);
00108 size_t remainCaptureTimes(void);
00109 void setCaptureSkipLines(size_t skip_lines);
00110
00111 int capture(std::vector<long>& data, long* timestamp = NULL);
00112 int captureWithIntensity(std::vector<long>& data,
00113 std::vector<long>& intensity_data,
00114 long* timestamp = NULL);
00115 void stop(void);
00116
00117 bool setTimestamp(int ticks = 0, int* response_msec = NULL,
00118 int* force_delay_msec = NULL);
00119
00120 bool setLaserOutput(bool on);
00121
00122 double index2rad(const int index) const;
00123 int rad2index(const double radian) const;
00124
00125 void setParameter(const RangeSensorParameter& parameter);
00126 RangeSensorParameter parameter(void) const;
00127 bool loadParameter(void);
00128
00129 bool versionLines(std::vector<std::string>& lines);
00130
00131 void reboot(void);
00132 void reset(void);
00133 };
00134 }
00135
00136 #endif