38 namespace data_processing {
50 return measurement_data;
53 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
54 std::vector<uint8_t>::const_iterator data_ptr =
60 return measurement_data;
105 std::vector<uint8_t>::const_iterator data_ptr,
122 uint32_t maxexpectedbeams = 2751;
123 if (numBeams > maxexpectedbeams)
125 ROS_WARN(
"Field Number Beams has a value larger then the expected Number of Beams for the " 126 "laserscanners. Skipping this measurement.");
127 ROS_WARN(
"Max expected beams: %i", maxexpectedbeams);
128 ROS_WARN(
"Number beams according to the datafield: %i", numBeams);
134 for (uint32_t i = 0; i < numBeams; i++)
142 const uint16_t offset,
143 std::vector<uint8_t>::const_iterator data_ptr,
149 bool valid =
static_cast<bool>(status & (0x01 << 0));
150 bool infinite =
static_cast<bool>(status & (0x01 << 1));
151 bool glare =
static_cast<bool>(status & (0x01 << 2));
152 bool reflector =
static_cast<bool>(status & (0x01 << 3));
153 bool contamination =
static_cast<bool>(status & (0x01 << 4));
154 bool contamination_warning =
static_cast<bool>(status & (0x01 << 5));
163 contamination_warning));
bool checkIfPreconditionsAreMet(const datastructure::Data &data) const
bool checkIfDataContainsNeededParsedBlocks(const datastructure::Data &data) const
ParseMeasurementData()
Constructor of the parser.
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.
bool checkIfMeasurementDataIsPublished(const datastructure::Data &data) const
Class containing the data of a single scan point.
uint32_t getNumberOfBeams() const
Getter for the number of beams.
uint8_t readUint8LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset in big little encoding.
The data class containing all data blocks of a measurement.
void setScanPointsInMeasurementData(std::vector< uint8_t >::const_iterator data_ptr, datastructure::MeasurementData &measurement_data)
void setIsEmpty(bool is_empty)
Set if measurement data is enabled.
uint32_t readUint32LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in little endian encoding.
void addScanPointToMeasurementData(uint16_t offset, std::vector< uint8_t >::const_iterator data_ptr, datastructure::MeasurementData &measurement_data) const
void setStartAngleAndDelta(const datastructure::Data &data)
void setNumberOfBeams(const uint32_t &number_of_beams)
Setter for the number of beams.
Class containing all scanpoints of a single measurement.
void setNumberOfBeamsInMeasurementData(std::vector< uint8_t >::const_iterator data_ptr, datastructure::MeasurementData &measurement_data) const
void setDataInMeasurementData(std::vector< uint8_t >::const_iterator data_ptr, datastructure::MeasurementData &measurement_data)
datastructure::MeasurementData parseUDPSequence(const datastructure::PacketBuffer &buffer, datastructure::Data &data)
Parses the measurement data if it is enabled.
std::shared_ptr< DataHeader > getDataHeaderPtr() const
Gets the data header.
void addScanPoint(ScanPoint scan_point)
Add a single scanpoint to the vector of scanpoints.
uint16_t readUint16LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 16-bit integer at offset in little endian encoding.
std::shared_ptr< DerivedValues > getDerivedValuesPtr() const
Gets the derived values.