38 namespace data_processing {
42 m_reader_ptr = std::make_shared<sick::data_processing::ReadWriteHelper>();
53 return intrusion_data;
56 const uint8_t* data_ptr(buffer.
getBuffer().data() +
60 return intrusion_data;
113 std::vector<sick::datastructure::IntrusionDatum> intrusion_datums;
119 const uint8_t*& data_ptr,
120 std::vector<sick::datastructure::IntrusionDatum>& intrusion_datums)
const 124 for (uint8_t i_set = 0; i_set < 24; ++i_set)
131 intrusion_datums.push_back(datum);
139 uint32_t numBytesToRead =
m_reader_ptr->readuint32_tLittleEndian(data_ptr, offset);
147 uint32_t num_read_flags = 0;
148 std::vector<bool> flags;
149 for (uint16_t num_read_bytes = 0;
153 uint8_t bitset =
m_reader_ptr->readuint8_tLittleEndian(data_ptr, offset + num_read_bytes);
155 i_bit++, num_read_flags++)
157 flags.push_back(static_cast<bool>(bitset & (0x01 << i_bit)));
bool checkIfIntrusionDataIsPublished(const datastructure::Data &data) const
uint16_t m_num_scan_points
datastructure::IntrusionData parseUDPSequence(const datastructure::PacketBuffer &buffer, datastructure::Data &data)
Parse a udp sequence to read the intrusion data if enabled.
uint16_t getNumScanPoints() const
int32_t getSize() const
Returns size of flag vector.
A packetbuffer for the raw data from the sensor.
uint16_t setSizeInIntrusionDatum(const uint16_t offset, const uint8_t *&data_ptr, sick::datastructure::IntrusionDatum &datum) const
Class containing a single IntrusionDatum.
void setFlagsVector(const std::vector< bool > &flags_vector)
Setter for the flag vector.
std::shared_ptr< sick::data_processing::ReadWriteHelper > m_reader_ptr
uint16_t setFlagsInIntrusionDatum(const uint16_t offset, const uint8_t *&data_ptr, sick::datastructure::IntrusionDatum &datum) const
The data class containing all data blocks of a measurement.
Class containing all IntrusionDatums.
const VectorBuffer & getBuffer() const
Getter to return the VectorBuffer saved in the PacketBuffer.
void setNumScanPoints(const uint16_t num_scan_points)
void setIntrusionDataVector(const std::vector< IntrusionDatum > &intrusion_data_vector)
Setter for the vector of IntrusionDatums.
bool checkIfPreconditionsAreMet(const datastructure::Data &data) const
bool checkIfDataContainsNeededParsedBlocks(const datastructure::Data &data) const
void setDataInIntrusionData(const uint8_t *&data_ptr, datastructure::IntrusionData &intrusion_data) const
std::shared_ptr< DataHeader > getDataHeaderPtr() const
Gets the data header.
void setIsEmpty(bool is_empty)
Set if intrusion data has been enabled.
void setSize(const int32_t &size)
Setter of the size for the flag vector.
ParseIntrusionData()
Constructor of the parser.
std::shared_ptr< DerivedValues > getDerivedValuesPtr() const
Gets the derived values.
void setDataInIntrusionDatums(const uint8_t *&data_ptr, std::vector< sick::datastructure::IntrusionDatum > &intrusion_datums) const