Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rcl] Improve handling of dynamic discovery (ros2#1023)
* Get discovery preferences from the environment Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net> * Support specification of discovery range and static peers Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net> * Add some debug helpers Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net> * Cleanup the LOCALHOST_ONLY deprecation a bit. Only print out the warning if it is actually specified. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Rewrite parsing of static peers. Mostly to get rid of the use of strtok_r, which is dangerous and also should not be used on our static environment variables. Instead, use rcutils_split(), which is much better. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Fix some silly bugs. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> * Use names instead of integers for discovery range env vars Signed-off-by: Michael X. Grey <grey@openrobotics.org> * Add support for dynamic allocation This commit adds support for dynamic allocation for unlimited number of static peers. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Add a warning if ROS_AUTOMATIC_DISCOVERY_OFF is set and STATIC_PEERS are set. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Update to latest rmw API Signed-off-by: Michael X. Grey <grey@openrobotics.org> * Uncrustify Signed-off-by: Michael X. Grey <grey@openrobotics.org> * Update for rmw_discovery_options_t changes Signed-off-by: Shane Loretz <sloretz@google.com> * Address feedback: use strncmp Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Address feedback: Log levels Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Address feedback: remove TODO Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Address feedback: rename function Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * ddress feedback: Docstring Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Address feedback: comment Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Add `RCL_RET_ERROR` if fini fails. Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * `snprintf`->`rcutils_snprintf` Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Rename tests Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * rcl_get_discovery_automatic_range -> rcl_get_automatic_discovery_range in test Signed-off-by: Shane Loretz <sloretz@google.com> * Annotate tests Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * More comments Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Style Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Style Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Uncrustify Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * Constness and warning Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> * address TODO about IP address validation in the static peers Signed-off-by: William Woodall <william@osrfoundation.org> * NOT_SET and SYSTEM_DEFAULT values Signed-off-by: Shane Loretz <sloretz@google.com> * refactor discovery options to handle env vars better and simplify stringifying enums Signed-off-by: William Woodall <william@osrfoundation.org> * fixup docs Signed-off-by: William Woodall <william@osrfoundation.org> * (re)improve the discovery range debug message Signed-off-by: William Woodall <william@osrfoundation.org> * Set discovery options to NOT_SET to detect user changse Signed-off-by: Shane Loretz <sloretz@google.com> * lint Signed-off-by: Shane Loretz <sloretz@google.com> * strncpy_s on windows Signed-off-by: Shane Loretz <sloretz@google.com> * Change default range to SUBNET, and allow configuring it at build time Signed-off-by: Shane Loretz <sloretz@google.com> --------- Signed-off-by: Geoffrey Biggs <gbiggs@killbots.net> Signed-off-by: Chris Lalancette <clalancette@openrobotics.org> Signed-off-by: Michael X. Grey <grey@openrobotics.org> Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai> Signed-off-by: Shane Loretz <sloretz@google.com> Signed-off-by: William Woodall <william@osrfoundation.org> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> Co-authored-by: Michael X. Grey <grey@openrobotics.org> Co-authored-by: Arjo Chakravarty <arjoc@intrinsic.ai> Co-authored-by: Shane Loretz <sloretz@google.com> Co-authored-by: William Woodall <william@osrfoundation.org>
- Loading branch information