8 #include "../../third-party/realsense-file/rosbag/rosbag_storage/include/rosbag/bag.h" 9 #include "../../third-party/realsense-file/rosbag/rosbag_storage/include/rosbag/view.h" 37 for (
auto&&
m : entire_bag_view)
39 topics_to_message_types[
m.getTopic()].push_back(
m.getDataType());
42 path = bag.getFileName();
43 for (
auto rit =
path.rbegin(); rit !=
path.rend(); ++rit)
45 if (*rit ==
'\\' || *rit ==
'/')
51 version =
tmpstringstream() << bag.getMajorVersion() <<
"." << bag.getMinorVersion();
52 file_duration = get_duration(bag);
53 size = 1.0 * bag.getSize() / (1024LL * 1024LL);
74 file_duration = other.file_duration;
77 version = other.version;
80 topics_to_message_types = other.topics_to_message_types;
83 other.file_duration = std::chrono::nanoseconds::zero();
84 other.file_name.clear();
86 other.version.clear();
88 other.compression_info.compressed = 0;
89 other.compression_info.uncompressed = 0;
90 other.compression_info.compression_type =
"";
91 other.topics_to_message_types.clear();
96 if (cache.find(
key) != cache.end())
100 std::ostringstream oss;
102 cache[
key] = oss.str();
109 std::regex exp(R
"RRR(/device_\d+/sensor_\d+/.*_\d+/(image|imu))RRR"); 110 return std::regex_search(info->
topic, exp);
115 std::map<std::tuple<std::string, std::string, std::string, std::string, rs2rosinternal::Time, uint64_t>,
std::string>
cache;
rosbag_content(rosbag_content &&other)
rosbag_content(const rosbag_content &other)
std::chrono::nanoseconds file_duration
std::map< std::tuple< std::string, std::string, std::string, std::string, rs2rosinternal::Time, uint64_t >, std::string > cache
GLsizei const GLchar *const * path
rosbag_inspector::compression_info compression_info
GLsizei const GLchar *const * string
rosbag_content(const std::string &file)
std::string const & getMD5Sum() const
std::chrono::nanoseconds get_duration(const rosbag::Bag &bag)
def info(name, value, persistent=False)
rs2rosinternal::Time const & getTime() const
A class pointing into a bag file.
unsigned __int64 uint64_t
std::string compression_type
std::chrono::duration< uint64_t, std::nano > nanoseconds
compression_info(const std::tuple< std::string, uint64_t, uint64_t > &t)
std::string const & getTopic() const
std::string const & getDataType() const
std::map< std::string, std::vector< std::string > > topics_to_message_types
std::string getCallerId() const
std::string instanciate_and_cache(const rosbag::MessageInstance &m, uint64_t count)