56 #ifndef __SIM_LOC_RESULT_PORT_PARSER_H_INCLUDED 57 #define __SIM_LOC_RESULT_PORT_PARSER_H_INCLUDED 82 virtual bool decode(
const std::vector<uint8_t> & binary_data);
88 virtual std::vector<uint8_t>
encode(
void);
105 static void parseAssert(
bool assertion,
const std::string & assertion_msg,
const std::string & info,
const std::string & file,
int line);
117 template<
typename T>
size_t copyBytesToValue(
const std::vector<uint8_t> & binary_data,
size_t start_byte, T & value,
const std::string & info =
"",
bool little_endian =
false);
128 template<
typename T>
size_t copyBytesToArray(
const std::vector<uint8_t> & binary_data,
size_t start_byte, std::vector<T> & dst_array,
const std::string & info =
"");
152 virtual uint16_t
computeChecksum(
const std::vector<uint8_t> & binary_data,
bool binary_data_with_trailer =
true);
169 virtual size_t decodeResultPortHeader(
const std::vector<uint8_t> & binary_data,
size_t start_byte, sick_scan::SickLocResultPortHeaderMsg & telegram_header);
179 virtual size_t decodeResultPortPayload(
const std::vector<uint8_t> & binary_data,
size_t start_byte, sick_scan::SickLocResultPortPayloadMsg & telegram_payload);
189 virtual size_t decodeResultPortTrailer(
const std::vector<uint8_t> & binary_data,
size_t start_byte, sick_scan::SickLocResultPortCrcMsg & telegram_trailer);
197 template<
typename T>
void encodePushValue(T value, std::vector<uint8_t> & binary_data,
bool little_endian =
false);
204 virtual void encodeResultPortHeader(
const sick_scan::SickLocResultPortHeaderMsg & telegram_header, std::vector<uint8_t> & binary_data);
211 virtual void encodeResultPortPayload(
const sick_scan::SickLocResultPortPayloadMsg & telegram_payload, std::vector<uint8_t> & binary_data);
231 #endif // __SIM_LOC_RESULT_PORT_PARSER_H_INCLUDED size_t copyBytesToValue(const std::vector< uint8_t > &binary_data, size_t start_byte, T &value, const std::string &info="", bool little_endian=false)
sick_scan::SickLocResultPortTelegramMsg m_result_port_telegram
the result port telegram decoded from binary data
virtual sick_scan::SickLocResultPortTelegramMsg & getTelegramMsg(void)
std::string m_publish_frame_id
frame_id of published ros messages (type SickLocResultPortTelegramMsg)
void encodePushValue(T value, std::vector< uint8_t > &binary_data, bool little_endian=false)
virtual size_t decodeResultPortTrailer(const std::vector< uint8_t > &binary_data, size_t start_byte, sick_scan::SickLocResultPortCrcMsg &telegram_trailer)
size_t copyBytesToArray(const std::vector< uint8_t > &binary_data, size_t start_byte, std::vector< T > &dst_array, const std::string &info="")
virtual void encodeResultPortHeader(const sick_scan::SickLocResultPortHeaderMsg &telegram_header, std::vector< uint8_t > &binary_data)
virtual const sick_scan::SickLocResultPortTelegramMsg & getTelegramMsg(void) const
virtual size_t decodeResultPortHeader(const std::vector< uint8_t > &binary_data, size_t start_byte, sick_scan::SickLocResultPortHeaderMsg &telegram_header)
virtual void encodeResultPortTrailer(uint16_t checksum, std::vector< uint8_t > &binary_data)
virtual uint16_t computeChecksum(const std::vector< uint8_t > &binary_data, bool binary_data_with_trailer=true)
virtual bool isLittleEndianPayload(uint16_t payload_type)
virtual void encodeResultPortPayload(const sick_scan::SickLocResultPortPayloadMsg &telegram_payload, std::vector< uint8_t > &binary_data)
static void parseAssert(bool assertion, const std::string &assertion_msg, const std::string &info, const std::string &file, int line)
ResultPortParser(const std::string &frame_id="")
bool m_little_endian_payload
true if payload type is 0x06c2 (little endian), default: false (payload encoded in big endian format)...
virtual size_t decodeResultPortPayload(const std::vector< uint8_t > &binary_data, size_t start_byte, sick_scan::SickLocResultPortPayloadMsg &telegram_payload)
virtual std::vector< uint8_t > encode(void)
virtual bool decode(const std::vector< uint8_t > &binary_data)