40 namespace data_processing {
49 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
50 std::vector<uint8_t>::const_iterator data_ptr = vec_ptr->begin();
61 for (uint8_t i = 0; i < code_length; i++)
75 if ((type_code_interface_1 ==
'Z' && type_code_interface_2 ==
'A') ||
76 (type_code_interface_1 ==
'A' && type_code_interface_2 ==
'A'))
80 else if (type_code_interface_1 ==
'I' && type_code_interface_2 ==
'Z')
84 else if ((type_code_interface_1 ==
'P' && type_code_interface_2 ==
'Z') ||
85 (type_code_interface_1 ==
'L' && type_code_interface_2 ==
'Z'))
89 else if (type_code_interface_1 ==
'A' && type_code_interface_2 ==
'N')
104 if ((type_code_interface_1 ==
'3' && type_code_interface_2 ==
'0') ||
105 (type_code_interface_1 ==
'4' && type_code_interface_2 ==
'0') ||
106 (type_code_interface_1 ==
'5' && type_code_interface_2 ==
'5'))
110 else if (type_code_interface_1 ==
'9' && type_code_interface_2 ==
'0')
float readMaxRange(std::vector< uint8_t >::const_iterator data_ptr) const
bool parseTCPSequence(const datastructure::PacketBuffer &buffer, datastructure::TypeCode &type_code) const
Parses a tcp sequence to read the type code of the sensor.
A packetbuffer for the raw data from the sensor.
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
std::string readTypeCode(std::vector< uint8_t >::const_iterator data_ptr) const
void setInterfaceType(const uint8_t &interface_type)
Sets the interface type for the scanner.
ParseTypeCodeData()
Constructor of the parser.
uint8_t readInterfaceType(std::vector< uint8_t >::const_iterator data_ptr) const
void setMaxRange(const float &max_distance)
Sets the max range for the scanner.
void setTypeCode(const std::string &type_code)
Sets the type code for the scanner.
Class containing the type code of a laser scanner.
uint8_t readUint8(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset.
uint16_t readUint16LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 16-bit integer at offset in little endian encoding.