-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support ROS 2 Easy mode #139
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Carlosespicur <[email protected]>
6b398aa
to
c5b6575
Compare
Signed-off-by: Carlosespicur <[email protected]>
Signed-off-by: Carlosespicur <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we decided it would be a good idea to unset sensitive environment variables that may interfere with YAML configurations, which may be done in a generic method that could be implemented here.
Signed-off-by: Carlosespicur <[email protected]>
d97b6a7
to
fee5466
Compare
Change applied on fee5466 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #139 +/- ##
==========================================
+ Coverage 36.60% 38.00% +1.40%
==========================================
Files 170 153 -17
Lines 11567 6986 -4581
Branches 5286 2780 -2506
==========================================
- Hits 4234 2655 -1579
+ Misses 4586 2938 -1648
+ Partials 2747 1393 -1354 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
const char* env_vars[] = { | ||
"ROS2_EASY_MODE", | ||
"FASTDDS_ENVIRONMENT_FILE", | ||
"ROS_DISCOVERY_SERVER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about "ROS_SUPER_CLIENT" and "FASTDDS_BUILTIN_TRANSPORTS"? The first one should be in the list for sure, the other one could be useful though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion we decided not to block "FASTDDS_BUILTIN_TRANSPORTS" just in case we need it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes applied on f0d98af
@@ -395,6 +395,9 @@ fastdds::dds::DomainParticipantQos CommonParticipant::reckon_participant_qos_() | |||
|
|||
fastdds::dds::DomainParticipant* CommonParticipant::create_dds_participant_() | |||
{ | |||
// Unset environment variables that conflict with YAML configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Unset environment variables that conflict with YAML configuration | |
// Unset environment variables that conflict with configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add this to the RTPS common participant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes applied on f0d98af
|
||
for (const char* var : env_vars) | ||
{ | ||
#ifdef _WIN32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check this is the right macro or there is a more generic one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing this, we concluded that it should be the most suitable one. It is coherent with https://stackoverflow.com/questions/2989810/which-cross-platform-preprocessor-defines-win32-or-win32-or-win32
if (!simple_configuration->easy_mode_ip.empty()) | ||
{ | ||
// This option is incompatible with transport tag configurations, | ||
// so check that transport is set to the default value (builtin) | ||
if (simple_configuration->transport != core::types::TransportDescriptors::builtin) | ||
{ | ||
EPROSIMA_LOG_WARNING(SIMPLEPARTICIPANT, | ||
"Ignoring IP value: Easy mode configuration is incompatible with transport tag configurations."); | ||
} | ||
else | ||
{ | ||
// Check if the IP is a valid IPv4 address | ||
if (!fastdds::rtps::IPLocator::isIPv4(simple_configuration->easy_mode_ip)) | ||
{ | ||
EPROSIMA_LOG_WARNING(SIMPLEPARTICIPANT, | ||
"Ignoring Easy Mode IP value. It must be a valid IPv4 address."); | ||
} | ||
else | ||
{ | ||
params.easy_mode_ip = simple_configuration->easy_mode_ip; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move this logic to the is_valid
method, and perhaps it would be better to fail instead of just printing a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes applied on f0d98af
Signed-off-by: Carlosespicur <[email protected]>
7488a80
to
f0d98af
Compare
Signed-off-by: Carlosespicur <[email protected]>
Main Changes
This PR adds support for configuring easy mode in SimpleParticipants through the YAML configuration file using a new
ros2-easy-mode
tag.The option is incompatible with the transports configuration, so easy mode is only configured if it is set as default (
builtin
).Merge after: