Skip to content

Commit

Permalink
Store schema with IDL encoding (#85)
Browse files Browse the repository at this point in the history
* Store schema with IDL encoding

Signed-off-by: Juan Lopez Fernandez <[email protected]>

* Update release notes

Signed-off-by: Juan Lopez Fernandez <[email protected]>

* Fix spell check

Signed-off-by: Juan Lopez Fernandez <[email protected]>

---------

Signed-off-by: Juan Lopez Fernandez <[email protected]>
  • Loading branch information
juanlofer-eprosima authored Oct 11, 2023
1 parent 83a0211 commit 2cf838c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
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

0 comments on commit 2cf838c

Please sign in to comment.