Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make rosbag2 a metapackage #241

Merged
merged 5 commits into from
Jan 6, 2020
Merged

Make rosbag2 a metapackage #241

merged 5 commits into from
Jan 6, 2020

Conversation

Karsten1987
Copy link
Collaborator

fixes #174

As discussed in the top level ticket, this PR renames the existing rosbag2 package to rosbag2_cpp and introduces rosbag2 as a simple metapackage with only listing runtime dependencies.
The renaming also entails changing the namespace accordingly, which makes that PR pretty brutal.

Signed-off-by: Karsten Knese karsten@openrobotics.org

@Karsten1987
Copy link
Collaborator Author

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@Karsten1987
Copy link
Collaborator Author

windows again after fixing visibility macro:
Build Status

@Karsten1987
Copy link
Collaborator Author

Karsten1987 commented Dec 29, 2019

And a final round of windows CI:
Build Status

As listed in the CI output, compiling & testing up to rosbag2 encompasses now the following packages:

8. test
8.1. rosbag2_test_common
8.2. rosbag2_storage
8.3. rosbag2_compression
8.4. rosbag2_cpp
8.5. rosbag2_storage_default_plugins
8.6. rosbag2_converter_default_plugins
8.7. rosbag2_transport
8.8. rosbag2_tests
8.9. rosbag2

Putting this up for review.

Copy link
Contributor

@zmichaels11 zmichaels11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments:

  • The removal of type aliases in types.hpp could have been done separately
  • Could the code in rosbag2_cpp use the namespace rosbag2?

I want to give this PR another run through since its large.

rosbag2/package.xml Outdated Show resolved Hide resolved
@Karsten1987
Copy link
Collaborator Author

The namespace should always reflect the package name otherwise this would lead to confusion IMO. Also discussed here: #174 (comment)

As for the types, I agree this could have been separately, but really, this PR is already changing so many files and namespaces, that removing the aliases for the types doesn't make a huge impact either.

#include "test_msgs/message_fixtures.hpp"

using rosbag2::converter_interfaces::SerializationFormatConverter;
#include "../../../src/rosbag2_converter_default_plugins/cdr/cdr_converter.hpp"
#include "../../../src/rosbag2_converter_default_plugins/logging.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably for another PR, but shouldn't these be found via the CMakeLists.txt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is ok since the package's structure is known to the tests, but it can be fragile. You could create a relative path in CMake and pass it as a compiler definition instead. At least then it wouldn't be hardcoded in so many places. But the use of a relative path here is in principle safe.

@piraka9011
Copy link
Contributor

LGTM. It seems all the packages have been renamed correctly.

@zmichaels11
Copy link
Contributor

@Karsten1987 I think you should get more people's input before merging due to how big this is.
Besides that, LGTM

Copy link
Member

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me. It's a lot of churn, but now's the time to do it.

@piraka9011 piraka9011 changed the title make rosbag2 a metapackage Make rosbag2 a metapackage Jan 3, 2020
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@zmichaels11
Copy link
Contributor

zmichaels11 commented Jan 6, 2020

@Karsten1987 the build is probably going to fail due to a new unit test I added in the compression metadata PR that was just merged. I can add the fix if you want.

The changes needed are:

diff --git a/rosbag2_cpp/test/rosbag2_cpp/test_info.cpp b/rosbag2_cpp/test/rosbag2_cpp/test_info.cpp
index 40608fc..b3cec52 100644
--- a/rosbag2_cpp/test/rosbag2_cpp/test_info.cpp
+++ b/rosbag2_cpp/test/rosbag2_cpp/test_info.cpp
@@ -64,7 +64,7 @@ TEST_F(TemporaryDirectoryFixture, read_metadata_supports_version_2) {
     fout << bagfile;
   }
 
-  rosbag2::Info info;
+  rosbag2_cpp::Info info;
   const auto metadata = info.read_metadata(temporary_dir_path_, "sqlite3");
 
   EXPECT_EQ(metadata.version, 2);

and

diff --git a/rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp b/rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
index 278913c..a77c46d 100644
--- a/rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
+++ b/rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
@@ -141,9 +141,9 @@ TEST_F(SequentialWriterTest, open_throws_error_if_converter_plugin_does_not_exis
 }
 
 TEST_F(SequentialWriterTest, open_throws_error_on_invalid_splitting_size) {
-  auto sequential_writer = std::make_unique<rosbag2::writers::SequentialWriter>(
+  auto sequential_writer = std::make_unique<rosbag2_cpp::writers::SequentialWriter>(
     std::move(storage_factory_), converter_factory_, std::move(metadata_io_));
-  writer_ = std::make_unique<rosbag2::Writer>(std::move(sequential_writer));
+  writer_ = std::make_unique<rosbag2_cpp::Writer>(std::move(sequential_writer));
 
   // Set minimum file size greater than max bagfile size option
   const uint64_t min_split_file_size = 10;

Signed-off-by: Karsten Knese <karsten@openrobotics.org>
@Karsten1987
Copy link
Collaborator Author

Karsten1987 commented Jan 6, 2020

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status // buildfarm hiccup

@piraka9011
Copy link
Contributor

Running another windows build:

  • Windows Build Status

@Karsten1987
Copy link
Collaborator Author

windows: Build Status

@zmichaels11
Copy link
Contributor

@Karsten1987 I think we're good for merge on green CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

need for metapackage
4 participants