00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 00024 // -- END LICENSE BLOCK ------------------------------------------------ 00025 00026 //---------------------------------------------------------------------- 00033 //---------------------------------------------------------------------- 00034 00035 #ifndef SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSEMEASUREMENTDATA_H 00036 #define SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSEMEASUREMENTDATA_H 00037 00038 #include <sick_safetyscanners/datastructure/Data.h> 00039 #include <sick_safetyscanners/datastructure/MeasurementData.h> 00040 #include <sick_safetyscanners/datastructure/PacketBuffer.h> 00041 00042 #include <sick_safetyscanners/data_processing/ReadWriteHelper.h> 00043 00044 #include <string> 00045 #include <vector> 00046 00047 namespace sick { 00048 namespace data_processing { 00049 00053 class ParseMeasurementData 00054 { 00055 public: 00059 ParseMeasurementData(); 00060 00069 datastructure::MeasurementData parseUDPSequence(const datastructure::PacketBuffer& buffer, 00070 datastructure::Data& data); 00071 00072 private: 00073 float m_angle; 00074 float m_angle_delta; 00075 std::shared_ptr<sick::data_processing::ReadWriteHelper> m_reader_ptr; 00076 void setDataInMeasurementData(const uint8_t*& data_ptr, 00077 datastructure::MeasurementData& measurement_data); 00078 void setNumberOfBeamsInMeasurementData(const uint8_t*& data_ptr, 00079 datastructure::MeasurementData& measurement_data) const; 00080 void setStartAngleAndDelta(const datastructure::Data& data); 00081 void setScanPointsInMeasurementData(const uint8_t*& data_ptr, 00082 datastructure::MeasurementData& measurement_data); 00083 void addScanPointToMeasurementData(uint16_t offset, 00084 const uint8_t*& data_ptr, 00085 datastructure::MeasurementData& measurement_data) const; 00086 bool checkIfPreconditionsAreMet(const datastructure::Data& data) const; 00087 bool checkIfMeasurementDataIsPublished(const datastructure::Data& data) const; 00088 bool checkIfDataContainsNeededParsedBlocks(const datastructure::Data& data) const; 00089 }; 00090 00091 } // namespace data_processing 00092 } // namespace sick 00093 00094 #endif // SICK_SAFETYSCANNERS_DATA_PROCESSING_PARSEMEASUREMENTDATA_H