Skip to content

Commit c49a298

Browse files
Support ROS 2 Easy Mode (#495)
* Refs #22870: Support Easy Mode tag Signed-off-by: Carlosespicur <[email protected]> * Refs #22870: Apply suggested changes Signed-off-by: Carlosespicur <[email protected]> * Refs #22870: Apply suggested changes. Signed-off-by: Carlosespicur <[email protected]> --------- Signed-off-by: Carlosespicur <[email protected]>
1 parent 1f2108e commit c49a298

File tree

6 files changed

+70
-2
lines changed

6 files changed

+70
-2
lines changed

ddsrouter_yaml/test/unittest/participants/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ set(TEST_SOURCES
6161
set(TEST_LIST
6262
get_participant
6363
get_participant_negative
64+
get_easy_mode_ip
6465
)
6566

6667
set(TEST_EXTRA_LIBRARIES

ddsrouter_yaml/test/unittest/participants/YamlGetSimpleParticipantConfigurationTest.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,35 @@ TEST(YamlGetSimpleParticipantConfigurationTest, get_participant_negative)
133133
}
134134
}
135135

136+
TEST(YamlGetSimpleParticipantConfigurationTest, get_easy_mode_ip)
137+
{
138+
ddsrouter::core::types::ParticipantKind kind = ddsrouter::core::types::ParticipantKind::simple;
139+
ddspipe::core::types::ParticipantId id = ddspipe::core::testing::random_participant_id();
140+
ddspipe::core::types::DomainId domain;
141+
ddspipe::participants::types::IpType easy_mode_ip = "127.0.0.1";
142+
143+
// Create a configuration with this kind and this id
144+
Yaml yml;
145+
Yaml yml_participant;
146+
147+
148+
ddspipe::yaml::testing::participantid_to_yaml(yml_participant, id);
149+
ddsrouter::yaml::testing::participantkind_to_yaml(yml_participant, kind);
150+
ddspipe::yaml::testing::domain_to_yaml(yml_participant, domain);
151+
ddspipe::yaml::testing::easy_mode_ip_to_yaml(yml_participant, easy_mode_ip);
152+
153+
yml["participant"] = yml_participant;
154+
155+
// Read Yaml
156+
ddspipe::participants::SimpleParticipantConfiguration result =
157+
ddspipe::yaml::YamlReader::get<ddspipe::participants::SimpleParticipantConfiguration>(yml,
158+
"participant",
159+
ddspipe::yaml::YamlReaderVersion::LATEST);
160+
161+
// Check result
162+
ASSERT_EQ(easy_mode_ip, result.easy_mode_ip);
163+
}
164+
136165
int main(
137166
int argc,
138167
char** argv)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def select_css(html_css_dir):
243243
#
244244
# This is also used if you do content translation via gettext catalogs.
245245
# Usually you set "language" from the command line for these cases.
246-
language = None
246+
language = 'en'
247247

248248
# There are two options for replacing |today|: either, you set today to some
249249
# non-false value, then it is used:

docs/rst/notes/forthcoming_version.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@
55
###################
66
Forthcoming Version
77
###################
8+
9+
Next release will include the following **major changes**:
10+
11+
* Add support to configure ROS 2 Easy Mode in the *yaml* configuration file.
12+
13+
- New ``ros2-easy-mode`` tag added. Check :ref:`user_manual_configuration_easy_mode` section.

docs/rst/notes/notes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
.. _release_notes:
44

5-
.. .. include:: forthcoming_version.rst
5+
.. include:: forthcoming_version.rst
66

77
##############
88
Version v3.1.0

docs/rst/user_manual/configuration.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,26 @@ However, a user may desire to force the use of one of the two, which can be acco
646646

647647
Participants configured with ``transport: shm`` will only communicate with applications using Shared Memory Transport exclusively (with disabled UDP transport).
648648

649+
.. _user_manual_configuration_easy_mode:
650+
651+
ROS 2 Easy Mode Configuration
652+
-----------------------------
653+
654+
DDS Router allows configuring the address of a remote discovery server when using
655+
:ref:`Simple Participants <user_manual_participants_simple>` with
656+
`ROS 2 Easy Mode <https://docs.vulcanexus.org/en/latest/rst/enhancements/easy_mode/easy_mode.html>`__
657+
through the ``ros2-easy-mode`` tag:
658+
659+
.. code-block:: yaml
660+
661+
ros2-easy-mode: "2.2.2.2" # Remote discovery server address
662+
663+
.. warning::
664+
This configuration is incompatible with the ``transports`` tag.
665+
Setting ``ros2-easy-mode`` other than ``transports: builtin``
666+
will prevent Easy Mode from being configured.
667+
668+
For now, only IPv4 addresses are supported.
649669

650670
.. _user_manual_configuration_interface_whitelist:
651671

@@ -1062,6 +1082,18 @@ A complete example of all the configurations described on this page can be found
10621082
10631083
####################
10641084
1085+
# Simple DDS Participant configured with ROS 2 Easy Mode
1086+
1087+
- name: Participant1 # Participant Name = Participant1
1088+
1089+
kind: simple # Participant Kind = local (= simple)
1090+
1091+
domain: 7 # DomainId = 7
1092+
1093+
ros2-easy-mode: "2.2.2.2" # Remote discovery server address
1094+
1095+
####################
1096+
10651097
# Discovery Server DDS Participant with ROS GuidPrefix so a local ROS 2 Client could connect to it
10661098
# This Discovery Server will listen in ports 11600 and 11601 in localhost
10671099

0 commit comments

Comments
 (0)