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

Store schema with IDL encoding #85

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class McapHandler : public ddspipe::participants::ISchemaHandler
~McapHandler();

/**
* @brief Create and store in \c schemas_ a ROS 2 schema (.msg format).
* @brief Create and store in \c schemas_ an OMG IDL schema (.idl format).
* Any samples following this schema that were received before the schema itself are moved to the memory buffer
* to be written with the next batch.
* Previously created channels (for this type) associated with a blank schema are updated to use the new one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ void McapHandler::add_schema(
}

// Schema not found, generate from dynamic type and store
std::string schema_text = generate_ros2_schema(dynamic_type);
std::string schema_text = generate_idl_schema(dynamic_type);

logInfo(DDSRECORDER_MCAP_HANDLER, "\nAdding schema with name " << type_name << " :\n" << schema_text << "\n");

// Create schema and add it to writer and to schemas map
mcap::Schema new_schema(type_name, "ros2msg", schema_text);
mcap::Schema new_schema(type_name, "omgidl", schema_text);
// WARNING: passing as non-const to MCAP library
mcap_writer_.addSchema(new_schema);

Expand Down Expand Up @@ -837,7 +837,7 @@ mcap::ChannelId McapHandler::create_channel_id_nts_(
logInfo(DDSRECORDER_MCAP_HANDLER,
"Schema not found for type: " << topic.type_name << ". Creating blank schema...");

mcap::Schema blank_schema(topic.type_name, "ros2msg", "");
mcap::Schema blank_schema(topic.type_name, "omgidl", "");
mcap_writer_.addSchema(blank_schema);
schemas_.insert({topic.type_name, std::move(blank_schema)});

Expand Down
1 change: 1 addition & 0 deletions docs/rst/notes/forthcoming_version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Next release will include the following **DDS Recorder & Replay internal adjustm

* Store *DDS Record & Replay* version in metadata record of the generated MCAP files.
* Move dynamic types storage from metadata to attachments MCAP section.
* Store schemas in OMG IDL format (instead of ROS 2 msg).

.. warning::

Expand Down
6 changes: 6 additions & 0 deletions docs/rst/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,27 @@ github
gMock
Gtest
guid
IDL
IPv
kubernetes
localhost
metatraffic
microcontroller
middleware
msg
multicast
mutex
OMG
QoS
Redistributable
replayable
replayer
Requiredness
ROS
runtime
scalable
schema
schemas
timepoint
utils
validator
Expand Down
Loading