constants.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of Willow Garage, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 #ifndef ROSBAG_CONSTANTS_H
36 #define ROSBAG_CONSTANTS_H
37 
38 #include <string>
39 #include <stdint.h>
40 
41 namespace rosbag {
42 
43 // Bag file version to write
44 static const std::string VERSION = "2.0";
45 
46 // Header field delimiter
47 static const unsigned char FIELD_DELIM = '=';
48 
49 // Current header fields
50 static const std::string OP_FIELD_NAME = "op";
51 static const std::string TOPIC_FIELD_NAME = "topic";
52 static const std::string VER_FIELD_NAME = "ver";
53 static const std::string COUNT_FIELD_NAME = "count";
54 static const std::string INDEX_POS_FIELD_NAME = "index_pos"; // 1.2+
55 static const std::string CONNECTION_COUNT_FIELD_NAME = "conn_count"; // 2.0+
56 static const std::string CHUNK_COUNT_FIELD_NAME = "chunk_count"; // 2.0+
57 static const std::string CONNECTION_FIELD_NAME = "conn"; // 2.0+
58 static const std::string COMPRESSION_FIELD_NAME = "compression"; // 2.0+
59 static const std::string SIZE_FIELD_NAME = "size"; // 2.0+
60 static const std::string TIME_FIELD_NAME = "time"; // 2.0+
61 static const std::string START_TIME_FIELD_NAME = "start_time"; // 2.0+
62 static const std::string END_TIME_FIELD_NAME = "end_time"; // 2.0+
63 static const std::string CHUNK_POS_FIELD_NAME = "chunk_pos"; // 2.0+
64 
65 // Legacy header fields
66 static const std::string MD5_FIELD_NAME = "md5"; // <2.0
67 static const std::string TYPE_FIELD_NAME = "type"; // <2.0
68 static const std::string DEF_FIELD_NAME = "def"; // <2.0
69 static const std::string SEC_FIELD_NAME = "sec"; // <2.0
70 static const std::string NSEC_FIELD_NAME = "nsec"; // <2.0
71 static const std::string LATCHING_FIELD_NAME = "latching"; // <2.0
72 static const std::string CALLERID_FIELD_NAME = "callerid"; // <2.0
73 
74 // Current "op" field values
75 static const unsigned char OP_MSG_DATA = 0x02;
76 static const unsigned char OP_FILE_HEADER = 0x03;
77 static const unsigned char OP_INDEX_DATA = 0x04;
78 static const unsigned char OP_CHUNK = 0x05;
79 static const unsigned char OP_CHUNK_INFO = 0x06;
80 static const unsigned char OP_CONNECTION = 0x07;
81 
82 // Legacy "op" field values
83 static const unsigned char OP_MSG_DEF = 0x01;
84 
85 // Bytes reserved for file header record (4KB)
86 static const uint32_t FILE_HEADER_LENGTH = 4 * 1024;
87 
88 // Index data record version to write
89 static const uint32_t INDEX_VERSION = 1;
90 
91 // Chunk info record version to write
92 static const uint32_t CHUNK_INFO_VERSION = 1;
93 
94 // Compression types
95 static const std::string COMPRESSION_NONE = "none";
96 static const std::string COMPRESSION_BZ2 = "bz2";
97 static const std::string COMPRESSION_LZ4 = "lz4";
98 
99 } // namespace rosbag
100 
101 #endif
static const std::string COMPRESSION_BZ2
Definition: constants.h:96
static const std::string END_TIME_FIELD_NAME
Definition: constants.h:62
static const std::string CHUNK_COUNT_FIELD_NAME
Definition: constants.h:56
static const std::string COMPRESSION_FIELD_NAME
Definition: constants.h:58
static const std::string LATCHING_FIELD_NAME
Definition: constants.h:71
static const std::string VER_FIELD_NAME
Definition: constants.h:52
static const std::string COMPRESSION_LZ4
Definition: constants.h:97
static const std::string CONNECTION_FIELD_NAME
Definition: constants.h:57
static const std::string INDEX_POS_FIELD_NAME
Definition: constants.h:54
static const std::string NSEC_FIELD_NAME
Definition: constants.h:70
static const unsigned char OP_CONNECTION
Definition: constants.h:80
static const std::string DEF_FIELD_NAME
Definition: constants.h:68
static const unsigned char OP_MSG_DATA
Definition: constants.h:75
static const unsigned char OP_CHUNK
Definition: constants.h:78
static const std::string VERSION
Definition: constants.h:44
static const std::string CHUNK_POS_FIELD_NAME
Definition: constants.h:63
unsigned int uint32_t
Definition: stdint.h:80
static const std::string START_TIME_FIELD_NAME
Definition: constants.h:61
static const uint32_t CHUNK_INFO_VERSION
Definition: constants.h:92
static const std::string OP_FIELD_NAME
Definition: constants.h:50
static const std::string TYPE_FIELD_NAME
Definition: constants.h:67
static const std::string COUNT_FIELD_NAME
Definition: constants.h:53
static const unsigned char OP_FILE_HEADER
Definition: constants.h:76
static const unsigned char OP_INDEX_DATA
Definition: constants.h:77
static const std::string SEC_FIELD_NAME
Definition: constants.h:69
static const unsigned char FIELD_DELIM
Definition: constants.h:47
static const std::string TIME_FIELD_NAME
Definition: constants.h:60
Definition: bag.h:66
static const std::string CONNECTION_COUNT_FIELD_NAME
Definition: constants.h:55
static const uint32_t FILE_HEADER_LENGTH
Definition: constants.h:86
static const std::string MD5_FIELD_NAME
Definition: constants.h:66
static const unsigned char OP_CHUNK_INFO
Definition: constants.h:79
static const std::string SIZE_FIELD_NAME
Definition: constants.h:59
static const std::string COMPRESSION_NONE
Definition: constants.h:95
static const std::string TOPIC_FIELD_NAME
Definition: constants.h:51
static const unsigned char OP_MSG_DEF
Definition: constants.h:83
static const std::string CALLERID_FIELD_NAME
Definition: constants.h:72
static const uint32_t INDEX_VERSION
Definition: constants.h:89


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:43:16