Skip to content

Commit

Permalink
Expose the QoS object wrapper (ros2#910)
Browse files Browse the repository at this point in the history
* Expose the Rosbag2QoS class for use

Signed-off-by: Geoffrey Biggs <[email protected]>
Co-authored-by: Emerson Knapp <[email protected]>
  • Loading branch information
gbiggs and Emerson Knapp authored Nov 23, 2021
1 parent 4792327 commit e9686a3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
8 changes: 2 additions & 6 deletions rosbag2_transport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ function(create_tests_for_rmw_implementation)
endif()

rosbag2_transport_add_gmock(test_play
src/rosbag2_transport/qos.cpp
test/rosbag2_transport/test_play.cpp
INCLUDE_DIRS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/rosbag2_transport>
LINK_LIBS rosbag2_transport
AMENT_DEPS test_msgs rosbag2_test_common
${SKIP_TEST})
Expand Down Expand Up @@ -140,11 +138,9 @@ function(create_tests_for_rmw_implementation)
AMENT_DEPS test_msgs rosbag2_test_common)

rosbag2_transport_add_gmock(test_qos
src/rosbag2_transport/qos.cpp
test/rosbag2_transport/test_qos.cpp
INCLUDE_DIRS
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/rosbag2_transport>
INCLUDE_DIRS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
LINK_LIBS rosbag2_transport
AMENT_DEPS rosbag2_test_common yaml_cpp_vendor)

rosbag2_transport_add_gmock(test_record
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "rclcpp/node_interfaces/node_graph_interface.hpp"
#include "rclcpp/qos.hpp"

#include "rosbag2_transport/visibility_control.hpp"

#ifdef _WIN32
// This is necessary because of a bug in yaml-cpp's cmake
#define YAML_CPP_DLL
Expand All @@ -37,11 +39,12 @@
namespace rosbag2_transport
{
/// Simple wrapper around rclcpp::QoS to provide a default constructor for YAML deserialization.
class Rosbag2QoS : public rclcpp::QoS
class ROSBAG2_TRANSPORT_PUBLIC Rosbag2QoS : public rclcpp::QoS
{
public:
Rosbag2QoS()
: rclcpp::QoS(rmw_qos_profile_default.depth) {}

explicit Rosbag2QoS(const rclcpp::QoS & value)
: rclcpp::QoS(value) {}

Expand Down Expand Up @@ -80,14 +83,14 @@ class Rosbag2QoS : public rclcpp::QoS
namespace YAML
{
template<>
struct convert<rmw_time_t>
struct ROSBAG2_TRANSPORT_PUBLIC convert<rmw_time_t>
{
static Node encode(const rmw_time_t & time);
static bool decode(const Node & node, rmw_time_t & time);
};

template<>
struct convert<rosbag2_transport::Rosbag2QoS>
struct ROSBAG2_TRANSPORT_PUBLIC convert<rosbag2_transport::Rosbag2QoS>
{
static Node encode(const rosbag2_transport::Rosbag2QoS & qos);
static bool decode(const Node & node, rosbag2_transport::Rosbag2QoS & qos);
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/src/rosbag2_transport/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include "rosbag2_storage/storage_filter.hpp"

#include "qos.hpp"
#include "rosbag2_transport/qos.hpp"

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/src/rosbag2_transport/qos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "rclcpp/logging.hpp"

#include "qos.hpp"
#include "rosbag2_transport/qos.hpp"

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/src/rosbag2_transport/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "rosbag2_interfaces/srv/snapshot.hpp"

#include "qos.hpp"
#include "rosbag2_transport/qos.hpp"
#include "topic_filter.hpp"

#ifdef _WIN32
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/test/rosbag2_transport/test_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "test_msgs/msg/basic_types.hpp"
#include "test_msgs/message_fixtures.hpp"

#include "qos.hpp"
#include "rosbag2_transport/qos.hpp"

#include "rosbag2_play_test_fixture.hpp"
#include "rosbag2_transport_test_fixture.hpp"
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/test/rosbag2_transport/test_qos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "rmw/types.h"

#include "qos.hpp"
#include "rosbag2_transport/qos.hpp"

TEST(TestQoS, serialization)
{
Expand Down
2 changes: 1 addition & 1 deletion rosbag2_transport/test/rosbag2_transport/test_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "test_msgs/msg/arrays.hpp"
#include "test_msgs/message_fixtures.hpp"

#include "qos.hpp"
#include "rosbag2_transport/qos.hpp"
#include "record_integration_fixture.hpp"

TEST_F(RecordIntegrationTestFixture, published_messages_from_multiple_topics_are_recorded)
Expand Down

0 comments on commit e9686a3

Please sign in to comment.