From 58143271723ad14c09aba3599eb5a94f68e89bff Mon Sep 17 00:00:00 2001 From: roncapat Date: Wed, 25 Oct 2023 22:18:28 +0200 Subject: [PATCH] Cpplint Signed-off-by: roncapat --- .../rosbag2_storage/topic_metadata.hpp | 1 + .../include/rosbag2_storage/yaml.hpp | 1 + rosbag2_storage_mcap/src/mcap_storage.cpp | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/rosbag2_storage/include/rosbag2_storage/topic_metadata.hpp b/rosbag2_storage/include/rosbag2_storage/topic_metadata.hpp index 32b9b8afdd..fec92b6127 100644 --- a/rosbag2_storage/include/rosbag2_storage/topic_metadata.hpp +++ b/rosbag2_storage/include/rosbag2_storage/topic_metadata.hpp @@ -16,6 +16,7 @@ #define ROSBAG2_STORAGE__TOPIC_METADATA_HPP_ #include +#include #include "rclcpp/qos.hpp" namespace rosbag2_storage diff --git a/rosbag2_storage/include/rosbag2_storage/yaml.hpp b/rosbag2_storage/include/rosbag2_storage/yaml.hpp index 5f35dbb7c8..abf8ed2f11 100644 --- a/rosbag2_storage/include/rosbag2_storage/yaml.hpp +++ b/rosbag2_storage/include/rosbag2_storage/yaml.hpp @@ -14,6 +14,7 @@ #ifndef ROSBAG2_STORAGE__YAML_HPP_ #define ROSBAG2_STORAGE__YAML_HPP_ +#include #include #include #include diff --git a/rosbag2_storage_mcap/src/mcap_storage.cpp b/rosbag2_storage_mcap/src/mcap_storage.cpp index d912430779..3b38e8f7fd 100644 --- a/rosbag2_storage_mcap/src/mcap_storage.cpp +++ b/rosbag2_storage_mcap/src/mcap_storage.cpp @@ -439,9 +439,11 @@ void MCAPStorage::read_metadata() const auto metadata_it = channel.metadata.find("offered_qos_profiles"); if (metadata_it != channel.metadata.end()) { auto node = YAML::Load(metadata_it->second); - auto decoded = YAML::decode_for_version>(YAML::Load(metadata_it->second), metadata_.version); + auto decoded = YAML::decode_for_version>( + YAML::Load(metadata_it->second), metadata_.version); topic_info.topic_metadata.offered_qos_profiles.reserve(decoded.size()); - std::copy(decoded.begin(), decoded.end(), topic_info.topic_metadata.offered_qos_profiles.begin()); + std::copy(decoded.begin(), decoded.end(), + topic_info.topic_metadata.offered_qos_profiles.begin()); } const auto type_hash_it = channel.metadata.find("topic_type_hash"); if (type_hash_it != channel.metadata.end()) { @@ -818,14 +820,15 @@ void MCAPStorage::create_topic(const rosbag2_storage::TopicMetadata & topic, channel.topic = topic.name; channel.messageEncoding = topic_info.topic_metadata.serialization_format; channel.schemaId = schema_id; - + std::vector to_encode; to_encode.reserve(topic_info.topic_metadata.offered_qos_profiles.size()); - std::transform( - topic_info.topic_metadata.offered_qos_profiles.begin(), - topic_info.topic_metadata.offered_qos_profiles.end(), - to_encode.begin(), - [](auto & qos){return static_cast(qos);}); + std::transform(topic_info.topic_metadata.offered_qos_profiles.begin(), + topic_info.topic_metadata.offered_qos_profiles.end(), + to_encode.begin(), + [](auto & qos) { + return static_cast(qos); + }); auto yaml_node = YAML::convert>::encode(to_encode); channel.metadata.emplace("offered_qos_profiles", yaml_node.as()); channel.metadata.emplace("topic_type_hash", topic_info.topic_metadata.type_description_hash);