Skip to content

Commit

Permalink
Add app_id and app_metadata attributes (#90)
Browse files Browse the repository at this point in the history
* Add app_id and app_metadata to config

Signed-off-by: Jesus Perez <[email protected]>

* Forthcoming version updated

Signed-off-by: Jesus Perez <[email protected]>

* Apply suggestions

Signed-off-by: Jesus Perez <[email protected]>

* Uncrustify

Signed-off-by: Jesus Perez <[email protected]>

---------

Signed-off-by: Jesus Perez <[email protected]>
  • Loading branch information
jepemi authored Nov 16, 2023
1 parent 0d0c59a commit 445b11a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ddsrecorder/src/cpp/command_receiver/CommandReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ bool CommandReceiver::init()

// CREATE THE PARTICIPANT
pqos.name("DdsRecorderCommandReceiver");

// Set app properties
pqos.properties().properties().emplace_back(
"fastdds.application.id",
participant_configuration_->app_id,
"true");
pqos.properties().properties().emplace_back(
"fastdds.application.metadata",
participant_configuration_->app_metadata,
"true");

participant_ = DomainParticipantFactory::get_instance()->create_participant(domain_, pqos);

if (participant_ == nullptr)
Expand Down
5 changes: 5 additions & 0 deletions ddsrecorder_yaml/src/cpp/recorder/YamlReaderConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ void RecorderConfiguration::load_ddsrecorder_configuration_(
// Create Simple Participant Configuration
simple_configuration = std::make_shared<SimpleParticipantConfiguration>();
simple_configuration->id = "SimpleRecorderParticipant";
simple_configuration->app_id = "DDS_RECORDER";
simple_configuration->app_metadata = "";
simple_configuration->is_repeater = false;

/////
// Create Recorder Participant Configuration
recorder_configuration = std::make_shared<ParticipantConfiguration>();
recorder_configuration->id = "RecorderRecorderParticipant";
recorder_configuration->app_id = "DDS_RECORDER";
// TODO: fill metadata field once its content has been defined.
recorder_configuration->app_metadata = "";
recorder_configuration->is_repeater = false;

/////
Expand Down
5 changes: 5 additions & 0 deletions ddsrecorder_yaml/src/cpp/replayer/YamlReaderConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ void ReplayerConfiguration::load_ddsreplayer_configuration_(
// WARNING: Replayer configuration must have been parsed beforehand
mcap_reader_configuration = std::make_shared<McapReaderParticipantConfiguration>();
mcap_reader_configuration->id = "McapReaderParticipant";
mcap_reader_configuration->app_id = "DDS_REPLAYER";
mcap_reader_configuration->app_metadata = "";
mcap_reader_configuration->is_repeater = false;
mcap_reader_configuration->begin_time = begin_time;
mcap_reader_configuration->end_time = end_time;
Expand All @@ -99,6 +101,9 @@ void ReplayerConfiguration::load_ddsreplayer_configuration_(
// Create Replayer Participant Configuration
replayer_configuration = std::make_shared<SimpleParticipantConfiguration>();
replayer_configuration->id = "ReplayerParticipant";
replayer_configuration->app_id = "DDS_REPLAYER";
// TODO: fill metadata field once its content has been defined.
replayer_configuration->app_metadata = "";
replayer_configuration->is_repeater = false;

/////
Expand Down
10 changes: 10 additions & 0 deletions ddsreplayer/src/cpp/tool/DdsReplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ DdsReplayer::DdsReplayer(
fastdds::dds::DomainParticipantQos pqos;
pqos.name("DdsReplayer_dynTypesPublisher");

// Set app properties
pqos.properties().properties().emplace_back(
"fastdds.application.id",
configuration.replayer_configuration->app_id,
"true");
pqos.properties().properties().emplace_back(
"fastdds.application.metadata",
configuration.replayer_configuration->app_metadata,
"true");

// Set as server in TypeLookup service
pqos.wire_protocol().builtin.typelookup_config.use_client = false;
pqos.wire_protocol().builtin.typelookup_config.use_server = true;
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 @@ -15,6 +15,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).
* Set `app_id` and `app_metadata` attributes on *DDS Record & Replay* participants.

.. warning::

Expand Down

0 comments on commit 445b11a

Please sign in to comment.