pcapng_json_parser.h
Go to the documentation of this file.
1 #include "sick_scan/sick_scan_base.h" /* Base definitions included in all header files, added by add_sick_scan_base_header.py. Do not edit this line. */
2 /*
3  * @brief pcapng_json_parser parses jsonfiles converted from pcapng-files by pcap_json_converter.
4  *
5  * Copyright (C) 2021 Ing.-Buero Dr. Michael Lehning, Hildesheim
6  * Copyright (C) 2021 SICK AG, Waldkirch
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * All rights reserved.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions are met:
24  *
25  * * Redistributions of source code must retain the above copyright
26  * notice, this list of conditions and the following disclaimer.
27  * * Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * * Neither the name of SICK AG nor the names of its
31  * contributors may be used to endorse or promote products derived from
32  * this software without specific prior written permission
33  * * Neither the name of Ing.-Buero Dr. Michael Lehning nor the names of its
34  * contributors may be used to endorse or promote products derived from
35  * this software without specific prior written permission
36  *
37  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
41  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
43  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
44  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
45  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
47  * POSSIBILITY OF SUCH DAMAGE.
48  *
49  * Authors:
50  * Michael Lehning <michael.lehning@lehning.de>
51  *
52  * Copyright 2021 SICK AG
53  * Copyright 2021 Ing.-Buero Dr. Michael Lehning
54  *
55  */
56 #ifndef __PCAPNG_JSON_PARSER_H_INCLUDED
57 #define __PCAPNG_JSON_PARSER_H_INCLUDED
58 
59 #include <cstdint>
60 #include <map>
61 #include <string>
62 #include <vector>
63 
64 #include "sick_scan/ros_wrapper.h"
65 
66 namespace sick_scan_xd
67 {
72  {
73  public:
74 
75  JsonScanData(double _timestamp = 0, const std::vector<uint8_t>& _data = std::vector<uint8_t>()) : timestamp(_timestamp), data(_data) {}
76  double timestamp; // relative timestamp in seconds
77  std::vector<uint8_t> data; // binary cola data 0x02020202....
78  };
79 
84  {
85  public:
86 
95  static bool parseJsonfile(const std::string & json_filename, const std::vector<std::string> & scandatatypes, double start_time, std::vector<sick_scan_xd::JsonScanData> & scandata);
96 
102  static std::vector<std::string> split(const std::string & s, char delimiter);
103 
104  protected:
105 
106  }; // class PcapngJsonParser
107 
108 } // namespace sick_scan_xd
109 #endif // __PCAPNG_JSON_PARSER_H_INCLUDED
s
XmlRpcServer s
pcap_json_converter.json_filename
string json_filename
Definition: pcap_json_converter.py:124
sick_scan_xd::PcapngJsonParser::split
static std::vector< std::string > split(const std::string &s, char delimiter)
Splits a comma separated string into its parts.
Definition: pcapng_json_parser.cpp:74
sick_scan_xd::PcapngJsonParser::parseJsonfile
static bool parseJsonfile(const std::string &json_filename, const std::vector< std::string > &scandatatypes, double start_time, std::vector< sick_scan_xd::JsonScanData > &scandata)
Parses a jsonfile and returns a list of binary scandata messages of given type.
Definition: pcapng_json_parser.cpp:92
sick_scan_xd::JsonScanData::data
std::vector< uint8_t > data
Definition: pcapng_json_parser.h:77
sick_scan_xd
Definition: abstract_parser.cpp:65
sick_scan_xd::JsonScanData::timestamp
double timestamp
Definition: pcapng_json_parser.h:76
sick_scan_xd::JsonScanData::JsonScanData
JsonScanData(double _timestamp=0, const std::vector< uint8_t > &_data=std::vector< uint8_t >())
Definition: pcapng_json_parser.h:75
sick_scan_xd::PcapngJsonParser
class PcapngJsonParser parses jsonfiles converted from pcapng-files by pcap_json_converter.
Definition: pcapng_json_parser.h:83
sick_scan_base.h
ros_wrapper.h
sick_scan_xd::JsonScanData
class JsonScanData: utility container for binary scandata incl. timestamp
Definition: pcapng_json_parser.h:71


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:09