~vibhavp/ubuntu/saucy/urg/merge-from-debian

« back to all changes in this revision

Viewing changes to include/cpp/mUrgCtrl.h

  • Committer: Bazaar Package Importer
  • Author(s): Albert Huang
  • Date: 2011-05-20 11:33:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110520113303-u8niofzwzcea0osk
Tags: 0.8.12-1
* New upstream release (closes: #624987)
* Add debian/watch file
* Bump standards-version to 3.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef QRK_M_URG_CTRL_H
2
 
#define QRK_M_URG_CTRL_H
3
 
 
4
 
/*!
5
 
  \file
6
 
  \brief ���j�^�Ή��� URG ����
7
 
 
8
 
  \author Satofumi KAMIMURA
9
 
 
10
 
  $Id: mUrgCtrl.h 1684 2010-02-10 23:56:38Z satofumi $
11
 
*/
12
 
 
13
 
#include "UrgCtrl.h"
14
 
 
15
 
 
16
 
namespace qrk
17
 
{
18
 
  /*!
19
 
    \brief ���j�^�Ή��� URG ����
20
 
  */
21
 
  class mUrgCtrl : public RangeSensor
22
 
  {
23
 
    mUrgCtrl(void);
24
 
    mUrgCtrl(const mUrgCtrl& rhs);
25
 
    mUrgCtrl& operator = (const mUrgCtrl& rhs);
26
 
 
27
 
    struct pImpl;
28
 
    std::auto_ptr<pImpl> pimpl;
29
 
 
30
 
  public:
31
 
    /*!
32
 
      \brief �I�v�V�����p�p�����[�^
33
 
    */
34
 
    enum {
35
 
      DefaultBaudrate = 115200, //!< �ڑ����̃f�t�H���g�{�[���[�g
36
 
      Infinity = 0,             //!< ������̃f�[�^�擾
37
 
    };
38
 
 
39
 
 
40
 
    /*!
41
 
      \brief �R���X�g���N�^
42
 
 
43
 
      ���샂�[�h���w�肷��
44
 
 
45
 
      - Record ���[�h (-r �w��)
46
 
        - �擾�f�[�^�����O�t�@�C���ɏ����o��
47
 
 
48
 
      - Play ���[�h (-p �w��)
49
 
        - ���O�t�@�C���̃f�[�^���擾�f�[�^�Ƃ��Ĉ���
50
 
 
51
 
      �g�p��
52
 
      \code
53
 
// �v���O�������s���̈����� -r, -p ���w�肷�邱�Ƃœ��삪�ς��B
54
 
//
55
 
// % ./a.exe -r    �f�[�^���擾���‚A�L�^����
56
 
// % ./a.exe -p    �L�^�ς݂̃f�[�^���Đ�����
57
 
//
58
 
// �������A�L�^���ƍĐ����ł͓����v���O�������g�����ƁB
59
 
 
60
 
#include <mUrgCtrl.h>
61
 
 
62
 
using namespace qrk;
63
 
using namespace std;
64
 
 
65
 
 
66
 
int main(int argc, char *argv[])
67
 
{
68
 
  mUrgCtrl urg(argc, argv);
69
 
 
70
 
  if (! urg.connect("COM4")) {
71
 
    ...
72
 
  }
73
 
 
74
 
  long timestamp = 0;
75
 
  vector<long> data;
76
 
  urg.capture(data, &timestamp);
77
 
 
78
 
  ...
79
 
} \endcode
80
 
 
81
 
      \see UrgCtrl
82
 
    */
83
 
    explicit mUrgCtrl(int argc, char *argv[]);
84
 
    ~mUrgCtrl(void);
85
 
 
86
 
    const char* what(void) const;
87
 
 
88
 
    bool connect(const char* device, long baudrate = DefaultBaudrate);
89
 
    void setConnection(Connection* con);
90
 
    Connection* connection(void);
91
 
    void disconnect(void);
92
 
    bool isConnected(void) const;
93
 
 
94
 
    long minDistance(void) const;
95
 
    long maxDistance(void) const;
96
 
    int maxScanLines(void) const;
97
 
 
98
 
    void setRetryTimes(size_t times);
99
 
 
100
 
    int scanMsec(void) const;
101
 
 
102
 
    void setCaptureMode(RangeCaptureMode mode);
103
 
    RangeCaptureMode captureMode(void);
104
 
 
105
 
    void setCaptureRange(int begin_index, int end_index);
106
 
    void setCaptureFrameInterval(size_t interval);
107
 
    void setCaptureTimes(size_t times);
108
 
    size_t remainCaptureTimes(void);
109
 
    void setCaptureSkipLines(size_t skip_lines);
110
 
 
111
 
    int capture(std::vector<long>& data, long* timestamp = NULL);
112
 
    int captureWithIntensity(std::vector<long>& data,
113
 
                             std::vector<long>& intensity_data,
114
 
                             long* timestamp = NULL);
115
 
    void stop(void);
116
 
 
117
 
    bool setTimestamp(int ticks = 0, int* response_msec = NULL,
118
 
                      int* force_delay_msec = NULL);
119
 
 
120
 
    bool setLaserOutput(bool on);
121
 
 
122
 
    double index2rad(const int index) const;
123
 
    int rad2index(const double radian) const;
124
 
 
125
 
    void setParameter(const RangeSensorParameter& parameter);
126
 
    RangeSensorParameter parameter(void) const;
127
 
    bool loadParameter(void);
128
 
 
129
 
    bool versionLines(std::vector<std::string>& lines);
130
 
 
131
 
    void reboot(void);
132
 
    void reset(void);
133
 
  };
134
 
}
135
 
 
136
 
#endif /* !QRK_M_URG_CTRL_H */