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

Use converters when recording a bag file #57

Merged
merged 22 commits into from
Nov 29, 2018

Conversation

botteroa-si
Copy link
Contributor

@botteroa-si botteroa-si commented Oct 31, 2018

This PR is based on #56. It includes:

  • the addition of the option -f, --serialization-format for the CLI verb record
  • the serialization-format option defaults to the rmw format of the incoming messages
  • if a conversion is needed, the appropriate converter plugin is used during the record process, and if such plugin does not exists, the record process fails gracefully
  • now each topic has its own rmw serialization format (for the moment, though, a bag file can be played only if all topics have the same format. Since it is not yet possible to edit a bag file, this is not a problem. The possibility to play a bag with different serialization formats will be added in a followup PR)

@anhosi
Copy link
Contributor

anhosi commented Nov 22, 2018

Fixes #16

@anhosi anhosi force-pushed the feature/use_converters_in_writer branch from eeff3fc to e479b2b Compare November 26, 2018 09:57
@anhosi
Copy link
Contributor

anhosi commented Nov 26, 2018

CI

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

@Martin-Idel-SI
Copy link
Contributor

This PR is now based on #64 - after this PR is merged, the number of files changed will shrink to 63.

The changeset still comprises a lot of files since we change the behaviour of the storage plugin: Instead of writing one topic type per storage storage, now every topic has its own type. This needs to be changed in the sqlite3 backend all the way to the printing statements.

botteroa-si and others added 20 commits November 27, 2018 10:16
- Use converters in Writer::write() when input rmw serialization format is different from desired storage serialization format
- Add new field in rosbag2::StorageOptions to keep track of the rmw format given by the user to store the message in
- Add 'serialization_format' field to TopicMetadata
- Add 'serialization_forat' column in 'topics' table in sqlite storage
- Remove 'storage_format' from BagMetadata and use the TopicMetadata field directly, instead
- the field 'rmw_serialization_format' has been moved from rosbag2::StorageOptions to rosbag2_transport::RecordOptions, because it's a topic property rather than a storage one.
- Currently all topics in a bag file must have the same serialization format
- The tests have been updated accordingly
- This assures that if one of the converter plugins does not exist, the database is not created
…r plugins do not exists

- Both a test for record and play has been added
…specified at CLI level

- Tests to check that the serialization format is written in the database have also been added.
- update pluginlib descriptions file after several renames
- fix export of missing includes folder
- one of the main test goals can only be ssen by valgrind or sanitizers
- enable leak sanitizer for gcc builds only (for now)
N.B. This exposes an pre-existing memory leak (not fixed here).
- topic_name member needs to be freed
- provide a setter for convenience
- Directly assigning a string literal in the test is not sufficient as
  this would be static memory that does not need to be freed.
This allows manual usage of valgrind.
@anhosi anhosi force-pushed the feature/use_converters_in_writer branch from f0eb3ab to aa73556 Compare November 27, 2018 15:18
@anhosi
Copy link
Contributor

anhosi commented Nov 27, 2018

New CI after rebase

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

ros2bag/ros2bag/verb/record.py Outdated Show resolved Hide resolved
rosbag2/CMakeLists.txt Show resolved Hide resolved
rosbag2/src/rosbag2/types/ros2_message.cpp Show resolved Hide resolved
rosbag2/include/rosbag2/writer.hpp Show resolved Hide resolved
rosbag2/src/rosbag2/converter.cpp Outdated Show resolved Hide resolved
rosbag2/include/rosbag2/converter.hpp Show resolved Hide resolved
rosbag2/src/rosbag2/converter.cpp Outdated Show resolved Hide resolved
rosbag2/src/rosbag2/converter.cpp Outdated Show resolved Hide resolved
rosbag2/src/rosbag2/sequential_reader.cpp Show resolved Hide resolved
@@ -25,6 +25,7 @@ struct RecordOptions
public:
bool all;
std::vector<std::string> topics;
std::string rmw_serialization_format;
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't this be a vector of strings? Ideally, each topic is associated with a serialization format (even if it's not supported yet).

Copy link
Contributor

Choose a reason for hiding this comment

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

I would do this only when this feature is being implemented. I am not yet sure how this should look like (or even how the cli usage should be). E.g. a map might also be an alternative.

@Karsten1987 Karsten1987 merged commit 30c4733 into ros2:master Nov 29, 2018
@anhosi anhosi deleted the feature/use_converters_in_writer branch November 29, 2018 09:53
target_compile_definitions(test_ros2_message PRIVATE "ROSBAG2_BUILDING_DLL")
if(NOT DISABLE_SANITIZERS)
target_compile_options(test_ros2_message PUBLIC $<$<CXX_COMPILER_ID:GNU>:-fsanitize=leak>)
target_link_libraries(test_ros2_message $<$<CXX_COMPILER_ID:GNU>:-fsanitize=leak>)
Copy link
Member

Choose a reason for hiding this comment

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

Just for the record: in the Jenkins CI jobs which are using Docker the leak sanitizer was never used for the test. See ros-infrastructure/ros_buildfarm#832.

james-rms added a commit to james-rms/rosbag2 that referenced this pull request Nov 17, 2022
* rosbag2_storage_mcap: add storage preset profiles

Signed-off-by: James Smith <james@foxglove.dev>

* mcap_vendor: update to mcap v0.5.0

Signed-off-by: James Smith <james@foxglove.dev>

Signed-off-by: James Smith <james@foxglove.dev>
james-rms added a commit to james-rms/rosbag2 that referenced this pull request Nov 17, 2022
* rosbag2_storage_mcap: add storage preset profiles

Signed-off-by: James Smith <james@foxglove.dev>

* mcap_vendor: update to mcap v0.5.0

Signed-off-by: James Smith <james@foxglove.dev>

Signed-off-by: James Smith <james@foxglove.dev>
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.

None yet

6 participants