/usr/include/urg/UrgDevice.h is in liburg0-dev 0.8.18-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 | #ifndef QRK_URG_DEVICE_H
#define QRK_URG_DEVICE_H
/*!
\file
\brief URG sensor control
\author Satofumi KAMIMURA
$Id: UrgDevice.h 1846 2010-06-13 23:26:56Z satofumi $
*/
#include "RangeSensor.h"
#include "Coordinate.h"
namespace qrk
{
class Connection;
//! URG sensor control
class UrgDevice : public Coordinate, public RangeSensor
{
public:
//! Parameter of options
enum {
DefaultBaudrate = 115200, //!< [bps]
DefaultRetryTimes = 8,
Infinity = 0,
Off = 0, //!< Laser is off
On = 1, //!< Laser is on
};
UrgDevice(void);
virtual ~UrgDevice(void);
const char* what(void) const;
bool connect(const char* device, long baudrate = DefaultBaudrate);
void setConnection(Connection* con);
Connection* connection(void);
void disconnect(void);
bool isConnected(void) const;
long minDistance(void) const;
long maxDistance(void) const;
int maxScanLines(void) const;
/*!
\brief Set number of retry times when connection failed
The retry counter is cleared when connect normaly.
\param[in] times retry times
\attention Data acquisition mode is valid only at #AutoCapture
*/
void setRetryTimes(size_t times);
/*!
\brief Set number of scan data stored internally
\param[in] size Number of scanning data to be stored
*/
void setCapturesSize(size_t size);
/*!
\brief Time taken for 1scan.
\return Time taken for 1scan.[msec]
*/
int scanMsec(void) const;
/*!
\brief Specification of data acquisition mode
\param[in] mode The mode defined by #RangeCaptureMode can be specified
\see captureMode()
*/
void setCaptureMode(RangeCaptureMode mode);
/*!
\brief Data acquisition mode
\return Present data acquisition mode
\see setCaptureMode()
*/
RangeCaptureMode captureMode(void);
/*!
\brief Specifies the range of data acquisition
\ref Refer to scip_capture_parameter_section.
\param[in] begin_index Measurement beginning position
\param[in] end_index Measurement end position
*/
void setCaptureRange(int begin_index, int end_index);
/*!
\brief Acquisition interval of scanning data
The data traffic between URG and the library can be decreased by lowering the frequency of data acquisition.
\ref refer to scip_capture_parameter_section
\param[in] interval capture interval
*/
void setCaptureFrameInterval(size_t interval);
/*!
\brief Specify the frequency of data acquisition
\ref Refer to scip_capture_parameter_section
\param[in] times Frequency of data acquisition
\attention Specify #UrgInfinityTimes to acquire data infinity times.
\attention Data acquisition mode is valid only at #AutoCapture, #IntensityCapture.
*/
void setCaptureTimes(size_t times);
/*!
\brief Get number of remaining capture times
\return number of remaining capture times
\attention Data acquisition mode is valid only at #AutoCapture, #IntensityCapture
*/
size_t remainCaptureTimes(void);
/*!
\brief Specify the number of scanline to be skipped.
The number of thinning out of acquisition data in one scanning is specified.
\param[in] skip_lines number of scanline to be skipped.
For example, if number of scan lines to be skipped = 1 , then will be
\verbatim
100, 101, 103, 104, 105, 100, ... \endverbatim
In case, number of scanlines to be skipped = 2, then acquired data will be
\verbatim
100, 103, 100, ... \endverbatim
(The shortest distance data is returned. )\n
As a result, the data traffic between URG and the library can be decreased.
However, the volume of data that capture() returns doesnot change.
Returns \verbatim
100, 100, 103, 103, 100, 100, ... \endverbatim
To guarantee the operation of rad2index() and index2rad(), volume of data does not changing :.
*/
void setCaptureSkipLines(size_t skip_lines);
int capture(std::vector<long>& data, long* timestamp = NULL);
/*
\brief Get intensity data and distance data.
\attention Only Top-URG and Classic-URG supports this fuction (2008-12-24)
*/
int captureWithIntensity(std::vector<long>& data,
std::vector<long>& intensity_data,
long* timestamp = NULL);
/*!
\brief Stop data acquisition
\attention Data acquisition mode is valid only at #AutoCapture, #IntensityCapture
*/
void stop(void);
bool setTimestamp(int timestamp = 0, int* response_msec = NULL,
int* force_delay_msec = NULL);
long recentTimestamp(void) const;
/*!
\brief Laser turn Off/ turn On
\param[in] on true to turn On , false to turn off
*/
bool setLaserOutput(bool on);
double index2rad(const int index) const;
int rad2index(const double radian) const;
void setParameter(const RangeSensorParameter& parameter);
RangeSensorParameter parameter(void) const;
/*!
\brief Again read the URG parameter
\retval true success
\retval false error
*/
bool loadParameter(void);
/*!
\brief Get version information
\param[out] lines Storage location of version information
\retval true success
\retval false error
<b>Example</b>
- \ref viewVvSample.cpp
*/
bool versionLines(std::vector<std::string>& lines);
/*!
\brief Reboot URG
\attention Only Top-URG (2010-02-04)
*/
bool reboot(void);
protected:
virtual void captureReceived(void);
private:
UrgDevice(const UrgDevice& rhs);
UrgDevice& operator = (const UrgDevice& rhs);
struct pImpl;
std::auto_ptr<pImpl> pimpl;
};
}
#endif /* !QRK_URG_DEVICE_H */
|