qrk::mUrgCtrl Class Reference
モニタ対応の URG 制御
More...
#include <mUrgCtrl.h>
List of all members.
Detailed Description
モニタ対応の URG 制御
Definition at line 18 of file mUrgCtrl.h.
Member Enumeration Documentation
オプション用パラメータ
- Enumerator:
DefaultBaudrate |
接続時のデフォルトボーレート
|
Infinity |
無限回のデータ取得
|
Definition at line 26 of file mUrgCtrl.h.
Constructor & Destructor Documentation
qrk::mUrgCtrl::mUrgCtrl |
( |
void |
|
) |
[private] |
qrk::mUrgCtrl::mUrgCtrl |
( |
const mUrgCtrl & |
rhs |
) |
[private] |
qrk::mUrgCtrl::mUrgCtrl |
( |
int |
argc, |
|
|
char * |
argv[] | |
|
) |
| | [explicit] |
コンストラクタ
動作モードを指定する
使用例
#include <mUrgCtrl.h>
using namespace qrk;
using namespace std;
int main(int argc, char *argv[])
{
mUrgCtrl urg(argc, argv);
if (! urg.connect("COM4")) {
...
}
long timestamp = 0;
vector<long> data;
urg.capture(data, ×tamp);
...
}
- See also:
- UrgCtrl
qrk::mUrgCtrl::~mUrgCtrl |
( |
void |
|
) |
|
Member Function Documentation
int qrk::mUrgCtrl::capture |
( |
std::vector< long > & |
data, |
|
|
long * |
timestamp = NULL | |
|
) |
| | [virtual] |
Get data.
Get data and store it in buffer.
- Parameters:
-
[out] | data | Buffer to store data |
[out] | timestamp | Time stamp |
- Returns:
- Number of data recieved.
- Return values:
-
Implements qrk::RangeSensor.
int qrk::mUrgCtrl::captureWithIntensity |
( |
std::vector< long > & |
data, |
|
|
std::vector< long > & |
intensity_data, |
|
|
long * |
timestamp = NULL | |
|
) |
| | [virtual] |
bool qrk::mUrgCtrl::connect |
( |
const char * |
device, |
|
|
long |
baudrate = DefaultBaudrate | |
|
) |
| | [virtual] |
Connection.
- Parameters:
-
[in] | device | Connected device name |
[in] | baudrate | Baudrate |
- Return values:
-
| true | Success |
| false | Failure |
Example
const char device[] = "/dev/ttyACM0";
const long baudrate = 115200;
UrgCtrl sensor;
if (! sensor.connect(device, baudrate)) {
printf("connect: %s\n", sensor.what());
exit(1);
}
Implements qrk::RangeSensor.
Connection* qrk::mUrgCtrl::connection |
( |
void |
|
) |
[virtual] |
void qrk::mUrgCtrl::disconnect |
( |
void |
|
) |
[virtual] |
double qrk::mUrgCtrl::index2rad |
( |
const int |
index |
) |
const [virtual] |
bool qrk::mUrgCtrl::isConnected |
( |
void |
|
) |
const [virtual] |
Returns connection status.
- Return values:
-
| true | If connected. |
| false | if disconnected. |
Implements qrk::RangeSensor.
bool qrk::mUrgCtrl::loadParameter |
( |
void |
|
) |
|
long qrk::mUrgCtrl::maxDistance |
( |
void |
|
) |
const [virtual] |
Get valid maximum distance.
- Returns:
- Valid maximum distance
Implements qrk::RangeSensor.
int qrk::mUrgCtrl::maxScanLines |
( |
void |
|
) |
const [virtual] |
long qrk::mUrgCtrl::minDistance |
( |
void |
|
) |
const [virtual] |
Get valid minimum distance.
- Returns:
- valid minimum distance
Implements qrk::RangeSensor.
int qrk::mUrgCtrl::rad2index |
( |
const double |
radian |
) |
const [virtual] |
void qrk::mUrgCtrl::reboot |
( |
void |
|
) |
|
size_t qrk::mUrgCtrl::remainCaptureTimes |
( |
void |
|
) |
|
void qrk::mUrgCtrl::reset |
( |
void |
|
) |
|
int qrk::mUrgCtrl::scanMsec |
( |
void |
|
) |
const [virtual] |
void qrk::mUrgCtrl::setCaptureFrameInterval |
( |
size_t |
interval |
) |
|
void qrk::mUrgCtrl::setCaptureRange |
( |
int |
begin_index, |
|
|
int |
end_index | |
|
) |
| | |
void qrk::mUrgCtrl::setCaptureSkipLines |
( |
size_t |
skip_lines |
) |
|
void qrk::mUrgCtrl::setCaptureTimes |
( |
size_t |
times |
) |
|
void qrk::mUrgCtrl::setConnection |
( |
Connection * |
con |
) |
[virtual] |
bool qrk::mUrgCtrl::setLaserOutput |
( |
bool |
on |
) |
[virtual] |
Update URG parameter.
- Parameters:
-
[in] | parameter | data used to update URG parameter |
Implements qrk::RangeSensor.
void qrk::mUrgCtrl::setRetryTimes |
( |
size_t |
times |
) |
|
bool qrk::mUrgCtrl::setTimestamp |
( |
int |
timestamp = 0 , |
|
|
int * |
response_msec = NULL , |
|
|
int * |
force_delay_msec = NULL | |
|
) |
| | [virtual] |
Sets the timestamp value. Sensor returs this timestamp value.
Sets the time stamp that can be acquired with capture().
- Parameters:
-
[in] | ticks | Set value of time stamp at that time |
[out] | response_msec | Response time for sending and receiving message [msec] |
[in] | force_delay_msec | Forced delay |
- Return values:
-
| true | Success |
| false | Failure |
Implements qrk::RangeSensor.
void qrk::mUrgCtrl::stop |
( |
void |
|
) |
|
bool qrk::mUrgCtrl::versionLines |
( |
std::vector< std::string > & |
lines |
) |
|
const char* qrk::mUrgCtrl::what |
( |
void |
|
) |
const [virtual] |
Returns internal status.
- Returns:
- String that represent internal status
Example
UrgCtrl sensor;
if (! sensor.connect(device, baudrate)) {
printf("connect: %s\n", sensor.what());
exit(1);
}
Implements qrk::RangeSensor.
Member Data Documentation
The documentation for this class was generated from the following file: