Skip to content

Commit

Permalink
Address merge conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Orlov <[email protected]>
  • Loading branch information
MichaelOrlov committed Aug 9, 2024
1 parent 75c3baa commit df4710f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 57 deletions.
9 changes: 0 additions & 9 deletions rosbag2_py/test/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,10 @@
import os
from pathlib import Path

<<<<<<< HEAD
import pytest

from rosbag2_py import bag_rewrite, StorageOptions
from rosbag2_test_common import TESTED_STORAGE_IDS
=======
import common # noqa
from rosbag2_py import (
bag_rewrite,
get_default_storage_id,
StorageOptions,
) # noqa: E402
>>>>>>> 5da1796 ([Humble] Add topics with zero message counts to the SQLiteStorage::get_metadata(). (#1722))

RESOURCES_PATH = Path(os.environ['ROSBAG2_PY_TEST_RESOURCES_DIR'])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ void SqliteStorage::prepare_for_reading()
void SqliteStorage::fill_topics_and_types()
{
if (database_->field_exists("topics", "offered_qos_profiles")) {
<<<<<<< HEAD:rosbag2_storage_sqlite3/src/rosbag2_storage_sqlite3/sqlite_storage.cpp
if (database_->field_exists("topics", "type_description_hash")) {
auto statement = database_->prepare_statement(
"SELECT name, type, serialization_format, offered_qos_profiles, type_description_hash"
Expand All @@ -610,16 +609,6 @@ void SqliteStorage::fill_topics_and_types()
all_topics_and_types_.push_back(
{std::get<0>(result), std::get<1>(result), std::get<2>(result), std::get<3>(result), ""});
}
=======
auto statement = database_->prepare_statement(
"SELECT name, type, serialization_format, offered_qos_profiles FROM topics ORDER BY id;");
auto query_results =
statement->execute_query<std::string, std::string, std::string, std::string>();

for (auto result : query_results) {
all_topics_and_types_.push_back(
{std::get<0>(result), std::get<1>(result), std::get<2>(result), std::get<3>(result)});
>>>>>>> 5da1796 ([Humble] Add topics with zero message counts to the SQLiteStorage::get_metadata(). (#1722)):rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
}
} else {
auto statement = database_->prepare_statement(
Expand All @@ -628,11 +617,7 @@ void SqliteStorage::fill_topics_and_types()

for (auto result : query_results) {
all_topics_and_types_.push_back(
<<<<<<< HEAD:rosbag2_storage_sqlite3/src/rosbag2_storage_sqlite3/sqlite_storage.cpp
{std::get<0>(result), std::get<1>(result), std::get<2>(result), "", ""});
=======
{std::get<0>(result), std::get<1>(result), std::get<2>(result), ""});
>>>>>>> 5da1796 ([Humble] Add topics with zero message counts to the SQLiteStorage::get_metadata(). (#1722)):rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
}
}
}
Expand Down Expand Up @@ -703,32 +688,22 @@ void SqliteStorage::read_metadata()
std::string, std::string, std::string, int, rcutils_time_point_value_t,
rcutils_time_point_value_t, std::string, std::string>();

<<<<<<< HEAD:rosbag2_storage_sqlite3/src/rosbag2_storage_sqlite3/sqlite_storage.cpp
for (auto result : query_results) {
metadata_.topics_with_message_count.push_back(
{
{std::get<0>(result), std::get<1>(result), std::get<2>(result), std::get<6>(
result), std::get<7>(result)},
static_cast<size_t>(std::get<3>(result))
const rosbag2_storage::TopicMetadata topic_metadata{std::get<0>(result),
std::get<1>(result), std::get<2>(result), std::get<6>(result), std::get<7>(result)};
auto & topics_list = metadata.topics_with_message_count;
auto it = std::find_if(
topics_list.begin(), topics_list.end(),
[&topic_metadata = topic_metadata](const rosbag2_storage::TopicInformation & topic_info) {
return topic_info.topic_metadata == topic_metadata;
});
=======
for (auto result : query_results) {
const rosbag2_storage::TopicMetadata topic_metadata{std::get<0>(result),
std::get<1>(result), std::get<2>(result), std::get<6>(result)};
auto & topics_list = metadata.topics_with_message_count;
auto it = std::find_if(
topics_list.begin(), topics_list.end(),
[&topic_metadata = topic_metadata](const rosbag2_storage::TopicInformation & topic_info) {
return topic_info.topic_metadata == topic_metadata;
});
if (it != topics_list.end()) {
it->message_count = static_cast<size_t>(std::get<3>(result));
} else {
metadata.topics_with_message_count.push_back(
{topic_metadata, static_cast<size_t>(std::get<3>(result))}
);
}
>>>>>>> 5da1796 ([Humble] Add topics with zero message counts to the SQLiteStorage::get_metadata(). (#1722)):rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
if (it != topics_list.end()) {
it->message_count = static_cast<size_t>(std::get<3>(result));
} else {
metadata.topics_with_message_count.push_back(
{topic_metadata, static_cast<size_t>(std::get<3>(result))}
);
}

metadata_.message_count += std::get<3>(result);
min_time = std::get<4>(result) < min_time ? std::get<4>(result) : min_time;
Expand Down Expand Up @@ -771,21 +746,13 @@ void SqliteStorage::read_metadata()
rcutils_time_point_value_t>();

for (auto result : query_results) {
<<<<<<< HEAD:rosbag2_storage_sqlite3/src/rosbag2_storage_sqlite3/sqlite_storage.cpp
metadata_.topics_with_message_count.push_back(
{
{std::get<0>(result), std::get<1>(result), std::get<2>(
result), "", ""},
static_cast<size_t>(std::get<3>(result))
=======
const rosbag2_storage::TopicMetadata topic_metadata{std::get<0>(result),
std::get<1>(result), std::get<2>(result), ""};
std::get<1>(result), std::get<2>(result), "", ""};
auto & topics_list = metadata.topics_with_message_count;
auto it = std::find_if(
topics_list.begin(), topics_list.end(),
[&topic_metadata = topic_metadata](const rosbag2_storage::TopicInformation & topic_info) {
return topic_info.topic_metadata == topic_metadata;
>>>>>>> 5da1796 ([Humble] Add topics with zero message counts to the SQLiteStorage::get_metadata(). (#1722)):rosbag2_storage_default_plugins/src/rosbag2_storage_default_plugins/sqlite/sqlite_storage.cpp
});
if (it != topics_list.end()) {
it->message_count = static_cast<size_t>(std::get<3>(result));
Expand Down

0 comments on commit df4710f

Please sign in to comment.