#include <ScannerSickS300.hpp>
Classes | |
struct | ParamType |
struct | ScanPolarType |
Public Types | |
enum | { SCANNER_S300_READ_BUF_SIZE = 10000, READ_BUF_SIZE = 10000, WRITE_BUF_SIZE = 10000 } |
Public Member Functions | |
bool | getScan (std::vector< double > &vdDistanceM, std::vector< double > &vdAngleRAD, std::vector< double > &vdIntensityAU) |
bool | open (const char *pcPort, int iBaudRate) |
void | purgeScanBuf () |
void | resetStartup () |
ScannerSickS300 () | |
void | startScanner () |
void | stopScanner () |
~ScannerSickS300 () | |
Private Member Functions | |
void | convertScanToPolar (std::vector< int > viScanRaw, std::vector< ScanPolarType > &vecScanPolar) |
unsigned int | createCRC (unsigned char *ptrData, int Size) |
unsigned int | getUnsignedWord (unsigned char msb, unsigned char lsb) |
Private Attributes | |
double | m_dBaudMult |
int | m_iPosReadBuf2 |
ParamType | m_Param |
unsigned char | m_ReadBuf [READ_BUF_SIZE+10] |
unsigned char | m_ReadBuf2 [READ_BUF_SIZE+10] |
SerialIO | m_SerialIO |
unsigned int | m_uiSumReadBytes |
std::vector< int > | m_viScanRaw |
Static Private Attributes | |
static const double | c_dPi |
static const unsigned char | c_StartBytes [10] |
static const unsigned short | crc_LookUpTable [256] |
Driver class for the laser scanner SICK S300 Professional. This driver only supports use with 500KBaud in cont. mode
S300 header format in continuous mode:
| 00 00 00 00 | 4 byte reply header
Now starts the actual telegram
| 00 00 | data block number (fixed) | xx xx | size of data telegram (should be dec 1104) | FF 07 | fixed | xx xx | protocol version | 0x 00 | status: 00 00 = normal, 01 00 = lockout | xx xx xx xx | scan number | xx xx | telegram number | BB BB | fixed | 11 11 | fixed ... data | xx xx | CRC
Readout of buffer starts with Reply-Header Reply-Header:byte 0 to 3 = 4 bytes Telegram (as it is stored in the Buffer): Position in the telegram Header: bytes 4 to 23 = 20 bytes bytes 0 to 19 Data: bytes 24 to 1105 = 1082 bytes bytes 20 to 1101 CRC: bytes 1106, 1107 = 2 bytes bytes 1102, 1103
for easier parsing Reply-Header and Telegram-Header are combined in the folllowing --> Headerlength = 24 bytes (iHeaderLength) --> Total length in buffer is 1108 bytes --> Telegram length (read from telegram) is 1104 bytes (iDataLength)
Definition at line 102 of file ScannerSickS300.hpp.
anonymous enum |
Definition at line 88 of file ScannerSickS300.hpp.
brics_oodl::ScannerSickS300::ScannerSickS300 | ( | ) |
brics_oodl::ScannerSickS300::~ScannerSickS300 | ( | ) |
void brics_oodl::ScannerSickS300::convertScanToPolar | ( | std::vector< int > | viScanRaw, | |
std::vector< ScanPolarType > & | vecScanPolar | |||
) | [private] |
unsigned int brics_oodl::ScannerSickS300::createCRC | ( | unsigned char * | ptrData, | |
int | Size | |||
) | [private] |
bool brics_oodl::ScannerSickS300::getScan | ( | std::vector< double > & | vdDistanceM, | |
std::vector< double > & | vdAngleRAD, | |||
std::vector< double > & | vdIntensityAU | |||
) |
unsigned int brics_oodl::ScannerSickS300::getUnsignedWord | ( | unsigned char | msb, | |
unsigned char | lsb | |||
) | [inline, private] |
Definition at line 151 of file ScannerSickS300.hpp.
bool brics_oodl::ScannerSickS300::open | ( | const char * | pcPort, | |
int | iBaudRate | |||
) |
Opens serial port.
pcPort | used "COMx" or "/dev/tty1" | |
iBaudRate | baud rate |
void brics_oodl::ScannerSickS300::purgeScanBuf | ( | ) |
void brics_oodl::ScannerSickS300::resetStartup | ( | ) |
void brics_oodl::ScannerSickS300::startScanner | ( | ) |
void brics_oodl::ScannerSickS300::stopScanner | ( | ) |
const double brics_oodl::ScannerSickS300::c_dPi [static, private] |
Definition at line 134 of file ScannerSickS300.hpp.
const unsigned char brics_oodl::ScannerSickS300::c_StartBytes[10] [static, private] |
Definition at line 133 of file ScannerSickS300.hpp.
const unsigned short brics_oodl::ScannerSickS300::crc_LookUpTable[256] [static, private] |
Definition at line 132 of file ScannerSickS300.hpp.
double brics_oodl::ScannerSickS300::m_dBaudMult [private] |
Definition at line 138 of file ScannerSickS300.hpp.
int brics_oodl::ScannerSickS300::m_iPosReadBuf2 [private] |
Definition at line 145 of file ScannerSickS300.hpp.
Definition at line 137 of file ScannerSickS300.hpp.
unsigned char brics_oodl::ScannerSickS300::m_ReadBuf[READ_BUF_SIZE+10] [private] |
Definition at line 141 of file ScannerSickS300.hpp.
unsigned char brics_oodl::ScannerSickS300::m_ReadBuf2[READ_BUF_SIZE+10] [private] |
Definition at line 142 of file ScannerSickS300.hpp.
Definition at line 148 of file ScannerSickS300.hpp.
unsigned int brics_oodl::ScannerSickS300::m_uiSumReadBytes [private] |
Definition at line 143 of file ScannerSickS300.hpp.
std::vector<int> brics_oodl::ScannerSickS300::m_viScanRaw [private] |
Definition at line 144 of file ScannerSickS300.hpp.