|
hokuyo
|
#include <hokuyo.hh>
Classes | |
| struct | DeviceInfo |
| struct | SimpleCommand |
| struct | StatusCode |
Public Types | |
| enum | ERROR_CODES { OK = 0, INTERNAL_COM_FAILED = 2, DEVICE_BUFFER_OVERFLOW = 3, BAD_COMMAND = 4, STRING_TOO_LONG = 5, BAD_STRING = 6, FIRMWARE_UPDATE = 7, LASER_MALFUNCTION = 8, HARDWARE_FAILURE = 9, NON_APPLICABLE = 10, BAD_REPLY = 100, DRIVER_BUFFER_OVERFLOW = 121, PROVIDED_BUFFER_TOO_SMALL = 122, BAD_STATE = 123, READ_FAILED = 124, BAD_RATE = 125, WRITE_FAILED = 126, READ_TIMEOUT = 127, NOT_SCIP2_CAPABLE = 128, BAD_HOST_RATE = 129, INCONSISTEN_RANGE_COUNT = 130, WRITE_TIMEOUT = 131, DUPLICATE = 132, UNKNOWN = 200, INTERNAL_ERROR = 201, UNKNOWN_DEVICE_VERSION = 202, END = 500 } |
Public Member Functions | |
| URG () | |
| ~URG () | |
| void | openURI (std::string const &filename) |
| bool | open (std::string const &filename) |
| bool | fullSerialReset () |
| bool | initCommunication (int timeout=1000) |
| bool | measureCommunicationLatency (int timeout=1000) |
| void | close () |
| DeviceInfo | getInfo () const |
| bool | startAcquisition (int nScans, int startStep=-1, int endStep=-1, int scanInterval=0, int clusterCount=1, bool includeRemission=false) |
| bool | stopAcquisition () |
| bool | readRanges (base::samples::LaserScan &range, int timeout=-1) |
| bool | setBaudrate (int brate) |
| int | getPacketCounter () |
| ERROR_CODES | error () const |
| char const * | errorString () const |
Static Public Member Functions | |
| static char const * | errorString (int error_code) |
Static Public Attributes | |
| static const int | MDMS_COMMAND_LENGTH = 15 |
| static const int | MDMS_TIMESTAMP_OFFSET = MDMS_COMMAND_LENGTH + 5 |
| static const int | MDMS_DATA_OFFSET = MDMS_TIMESTAMP_OFFSET + 6 |
Protected Member Functions | |
| int | extractPacket (uint8_t const *buffer, size_t buffer_size) const |
This class implements a driver for the Hokuyo laser range finders.
Note on error handling: all methods return a boolean argument. If the returned value is true, everything is fine. Otherwise, an error occured and the exact error code is returned by URG::error(). URG::ERROR_CODES lists all error codes and URG::errorString(int) can return a string describing the exact error.
| enum URG::ERROR_CODES |
All the possible error codes that can be returned by URG::error()
| URG::URG | ( | ) |
| URG::~URG | ( | ) |
| void URG::close | ( | ) |
Closes the device
|
inline |
Returns the last error code registered by the driver
|
static |
Returns the string describing the given error code
|
inline |
Returns a string describing the current error
|
protected |
| bool URG::fullSerialReset | ( | ) |
Performs a full reset of the device. After this call, the device baud rate is 19200 and it is not scanning
|
inline |
Returns the device info structure. This does not access the device, as the structure is read at initialization in open()
| int URG::getPacketCounter | ( | ) |
Returns the packet counter for the last received laser scan.
Note the packet counter is calculated from the internal time of the laser scanner.
| bool URG::initCommunication | ( | int | timeout = 1000 | ) |
Initializes communication to the device
| bool URG::measureCommunicationLatency | ( | int | timeout = 1000 | ) |
Measures communication latency
| bool URG::open | ( | std::string const & | filename | ) |
Open the device, reset it and read device information. After this call, the baud rate is 19200 and the device is not scanning
| void URG::openURI | ( | std::string const & | filename | ) |
Open the device, reset it and read device information. After this call, the baud rate is 19200 and the device is not scanning
| bool URG::readRanges | ( | base::samples::LaserScan & | range, |
| int | timeout = -1 |
||
| ) |
Gets a range reading and decodes it into range. If timeout is positive, it is how much time, in milliseconds, we should wait for an answer. If it is -1, it is set to twice the scan duration
| bool URG::setBaudrate | ( | int | brate | ) |
Sets the device baudrate (only possible for serial devices). +brate+ is the baud rate in bps, can be one of 19200, 57600 and 115200
If the device is not open yet, this baud rate will be set on startup (i.e. in open())
| bool URG::startAcquisition | ( | int | nScans, |
| int | startStep = -1, |
||
| int | endStep = -1, |
||
| int | scanInterval = 0, |
||
| int | clusterCount = 1, |
||
| bool | includeRemission = false |
||
| ) |
Start continuous acquisition. Call readRanges() to get a frame.
| bool URG::stopAcquisition | ( | ) |
Stop continuous acquisition
|
static |
For internal use
|
static |
For internal use
|
static |
For internal use
1.8.11