URG sensor control. More...
#include <UrgCtrl.h>

Public Types | |
| enum | { DefaultBaudrate = 115200, DefaultRetryTimes = 8, Infinity = 0, Off = 0, On = 1 } |
Public Member Functions | |
| const char * | what (void) const |
| Returns internal status. | |
| bool | connect (const char *device, long baudrate=DefaultBaudrate) |
| Connection. | |
| void | setConnection (Connection *con) |
| Specifies the connection object. | |
| Connection * | connection (void) |
| Get connection object. | |
| void | disconnect (void) |
| Disconnect. | |
| bool | isConnected (void) const |
| Returns connection status. | |
| long | minDistance (void) const |
| Get valid minimum distance. | |
| long | maxDistance (void) const |
| Get valid maximum distance. | |
| int | maxScanLines (void) const |
| Get Max scan index. | |
| void | setRetryTimes (size_t times) |
| void | setCapturesSize (size_t size) |
| int | scanMsec (void) const |
| void | setCaptureMode (RangeCaptureMode mode) |
| RangeCaptureMode | captureMode (void) |
| void | setCaptureRange (int begin_index, int end_index) |
| void | setCaptureFrameInterval (size_t interval) |
| void | setCaptureTimes (size_t times) |
| size_t | remainCaptureTimes (void) |
| void | setCaptureSkipLines (size_t skip_lines) |
| int | capture (std::vector< long > &data, long *timestamp=NULL) |
| Get data. | |
| int | captureWithIntensity (std::vector< long > &data, std::vector< long > &intensity_data, long *timestamp=NULL) |
| void | stop (void) |
| bool | setTimestamp (int timestamp=0, int *response_msec=NULL, int *force_delay_msec=NULL) |
| Sets the timestamp value. Sensor returs this timestamp value. | |
| long | recentTimestamp (void) const |
| Latest time stamp value. | |
| bool | setLaserOutput (bool on) |
| double | index2rad (const int index) const |
| Radian to angle conversion of data index. | |
| int | rad2index (const double radian) const |
| radian Convert angle in radian to data index | |
| void | setParameter (const RangeSensorParameter ¶meter) |
| Update URG parameter. | |
| RangeSensorParameter | parameter (void) const |
| Get URG parameter. | |
| bool | loadParameter (void) |
| bool | versionLines (std::vector< std::string > &lines) |
| bool | reboot (void) |
| bool | reset (void) |
Protected Member Functions | |
| virtual void | captureReceived (void) |
| anonymous enum |
| const char * UrgCtrl::what | ( | void | ) | const [virtual] |
Returns internal status.
\return String that represent internal status <strong>Example</strong> <strong>Example</strong>
UrgCtrl sensor; if (! sensor.connect(device, baudrate)) { // Displays error message when connection is failed. printf("connect: %s\n", sensor.what()); exit(1); }
Implements qrk::RangeSensor.
Definition at line 39 of file UrgCtrl.cpp.
| bool UrgCtrl::connect | ( | const char * | device, |
| long | baudrate = DefaultBaudrate |
||
| ) | [virtual] |
\param[in] device Connected device name \param[in] baudrate Baudrate \retval true Success \retval false Failure <strong>Example</strong> <strong>Example</strong>
const char device[] = "/dev/ttyACM0"; const long baudrate = 115200; UrgCtrl sensor; // Connect to specified device if (! sensor.connect(device, baudrate)) { printf("connect: %s\n", sensor.what()); exit(1); }
Implements qrk::RangeSensor.
Definition at line 45 of file UrgCtrl.cpp.
| void UrgCtrl::setConnection | ( | Connection * | con | ) | [virtual] |
Specifies the connection object.
| [in] | con | Connection object |
Implements qrk::RangeSensor.
Definition at line 51 of file UrgCtrl.cpp.
| Connection * UrgCtrl::connection | ( | void | ) | [virtual] |
Get connection object.
Implements qrk::RangeSensor.
Definition at line 57 of file UrgCtrl.cpp.
| void UrgCtrl::disconnect | ( | void | ) | [virtual] |
| bool UrgCtrl::isConnected | ( | void | ) | const [virtual] |
Returns connection status.
| true | If connected. |
| false | if disconnected. |
Implements qrk::RangeSensor.
Definition at line 69 of file UrgCtrl.cpp.
| long UrgCtrl::minDistance | ( | void | ) | const [virtual] |
Get valid minimum distance.
Implements qrk::RangeSensor.
Definition at line 75 of file UrgCtrl.cpp.
| long UrgCtrl::maxDistance | ( | void | ) | const [virtual] |
Get valid maximum distance.
Implements qrk::RangeSensor.
Definition at line 81 of file UrgCtrl.cpp.
| int UrgCtrl::maxScanLines | ( | void | ) | const [virtual] |
Get Max scan index.
Implements qrk::RangeSensor.
Definition at line 87 of file UrgCtrl.cpp.
| int UrgCtrl::capture | ( | std::vector< long > & | data, |
| long * | timestamp = NULL |
||
| ) | [virtual] |
Get data.
Get data and store it in buffer.
| [out] | data | Buffer to store data |
| [out] | timestamp | Time stamp |
| <0 | Receiving failed |
Implements qrk::RangeSensor.
Definition at line 153 of file UrgCtrl.cpp.
| bool UrgCtrl::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().
| [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 |
| true | Success |
| false | Failure |
Implements qrk::RangeSensor.
Definition at line 173 of file UrgCtrl.cpp.
| long UrgCtrl::recentTimestamp | ( | void | ) | const [virtual] |
Latest time stamp value.
Reimplemented from qrk::RangeSensor.
Definition at line 180 of file UrgCtrl.cpp.
| double UrgCtrl::index2rad | ( | const int | index | ) | const [virtual] |
Radian to angle conversion of data index.
Front of sensor is considered as 0.0 in radians.
| [in] | index | Data index |
Implements qrk::RangeSensor.
Definition at line 192 of file UrgCtrl.cpp.
| int UrgCtrl::rad2index | ( | const double | radian | ) | const [virtual] |
radian Convert angle in radian to data index
Front of sensor is considered as 0.0 in radians.
| [in] | radian | angle [radian] |
Implements qrk::RangeSensor.
Definition at line 198 of file UrgCtrl.cpp.
| void UrgCtrl::setParameter | ( | const RangeSensorParameter & | parameter | ) | [virtual] |
Update URG parameter.
| [in] | parameter | data used to update URG parameter |
Implements qrk::RangeSensor.
Definition at line 204 of file UrgCtrl.cpp.
| RangeSensorParameter UrgCtrl::parameter | ( | void | ) | const [virtual] |
Get URG parameter.
Implements qrk::RangeSensor.
Definition at line 210 of file UrgCtrl.cpp.
1.7.6.1-20120122