Skip to content

Commit 174005f

Browse files
Add support for automatic discovery range (#262)
* Write the ROS_AUTOMATIC_DISCOVERY_RANGE and ROS_STATIC_PEERS envars * Unset ROS_STATIC_PEERS if there are no peers, rather than setting an empty string
1 parent 02714d8 commit 174005f

File tree

1 file changed

+13
-0
lines changed
  • clearpath_generator_common/clearpath_generator_common/bash

1 file changed

+13
-0
lines changed

clearpath_generator_common/clearpath_generator_common/bash/generator.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,17 @@ def generate_setup_bash(self) -> None:
8787
else:
8888
bash_writer.add_unset('ROS_DISCOVERY_SERVER')
8989

90+
# ROS automatic discovery range
91+
bash_writer.add_export(
92+
'ROS_AUTOMATIC_DISCOVERY_RANGE',
93+
self.clearpath_config.system.middleware.automatic_discovery_range.upper(),
94+
)
95+
if len(self.clearpath_config.system.middleware.static_peers) > 0:
96+
bash_writer.add_export(
97+
'ROS_STATIC_PEERS',
98+
f'"{";".join(self.clearpath_config.system.middleware.static_peers)}"',
99+
)
100+
else:
101+
bash_writer.add_unset('ROS_STATIC_PEERS')
102+
90103
bash_writer.close()

0 commit comments

Comments
 (0)