Skip to content

Commit 1e8dc3b

Browse files
committed
remove ros domain id manipulation
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
1 parent 75d2270 commit 1e8dc3b

File tree

6 files changed

+8
-82
lines changed

6 files changed

+8
-82
lines changed

nexus_demos/launch/inter_workcell.launch.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def activate_node(target_node: LifecycleNode, depend_node: LifecycleNode = None)
108108

109109

110110
def launch_setup(context, *args, **kwargs):
111-
ros_domain_id = LaunchConfiguration("ros_domain_id")
112111
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
113112
use_multiple_transporters = LaunchConfiguration("use_multiple_transporters")
114113
zenoh_config_package = LaunchConfiguration("zenoh_config_package")
@@ -245,7 +244,6 @@ def launch_setup(context, *args, **kwargs):
245244
launch_arguments={
246245
"zenoh_config_package": zenoh_config_package,
247246
"zenoh_router_config_filename": zenoh_router_config_filename,
248-
"ros_domain_id": ros_domain_id.perform(context),
249247
}.items(),
250248
)
251249
]
@@ -259,7 +257,6 @@ def launch_setup(context, *args, **kwargs):
259257
)
260258

261259
return [
262-
SetEnvironmentVariable("ROS_DOMAIN_ID", ros_domain_id),
263260
zenoh_router,
264261
SetEnvironmentVariable(
265262
"ZENOH_SESSION_CONFIG_URI",
@@ -288,11 +285,6 @@ def generate_launch_description():
288285

289286
return launch.LaunchDescription(
290287
[
291-
DeclareLaunchArgument(
292-
"ros_domain_id",
293-
default_value="0",
294-
description="ROS_DOMAIN_ID environment variable",
295-
),
296288
DeclareLaunchArgument(
297289
"use_fake_hardware",
298290
default_value="true",

nexus_demos/launch/launch.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,8 @@ def launch_setup(context, *args, **kwargs):
5151
run_workcell_2 = LaunchConfiguration("run_workcell_2")
5252
workcell_2_remap_task_types = LaunchConfiguration("workcell_2_remap_task_types")
5353

54-
inter_workcell_domain_id = 0
55-
workcell_1_domain_id = 0
56-
workcell_2_domain_id = 0
5754
log_msg = ""
5855

59-
if "ROS_DOMAIN_ID" in os.environ:
60-
inter_workcell_domain_id = int(os.environ["ROS_DOMAIN_ID"])
61-
workcell_1_domain_id = int(os.environ["ROS_DOMAIN_ID"])
62-
workcell_2_domain_id = int(os.environ["ROS_DOMAIN_ID"])
63-
if not 0 < inter_workcell_domain_id < 230:
64-
log_msg += (
65-
"ROS_DOMAIN_ID not within the range of 0 to 230, setting it to 0. \n"
66-
)
67-
inter_workcell_domain_id = 0
68-
69-
log_msg += f"Inter-workcell has ROS_DOMAIN_ID {inter_workcell_domain_id}\n"
70-
if run_workcell_1.perform(context).lower() == "true":
71-
log_msg += f"Workcell 1 has ROS_DOMAIN_ID {workcell_1_domain_id}\n"
72-
if run_workcell_2.perform(context).lower() == "true":
73-
log_msg += f"Workcell 2 has ROS_DOMAIN_ID {workcell_2_domain_id}\n"
74-
7556
main_bt_filename = "main.xml"
7657
remap_task_types = """{
7758
pick_and_place: [place_on_amr, place_on_conveyor, pick_from_amr, pick_from_conveyor],
@@ -93,7 +74,6 @@ def launch_setup(context, *args, **kwargs):
9374
)
9475
],
9576
launch_arguments={
96-
"ros_domain_id": str(inter_workcell_domain_id),
9777
"zenoh_config_package": "nexus_demos",
9878
"zenoh_router_config_filename": "config/zenoh/inter_workcell_router_config.json5",
9979
"zenoh_session_config_filename": "config/zenoh/inter_workcell_session_config.json5",
@@ -129,7 +109,6 @@ def launch_setup(context, *args, **kwargs):
129109
"remap_task_types": workcell_1_remap_task_types,
130110
"task_checker_plugin": "nexus::task_checkers::FilepathChecker",
131111
"max_jobs": max_workcell_jobs,
132-
"ros_domain_id": str(workcell_1_domain_id),
133112
"headless": headless,
134113
"controller_config_package": "nexus_demos",
135114
"planner_config_package": "nexus_demos",
@@ -169,7 +148,6 @@ def launch_setup(context, *args, **kwargs):
169148
launch_arguments={
170149
"zenoh_config_package": "nexus_demos",
171150
"zenoh_router_config_filename": "config/zenoh/workcell_1_connection_router_config.json5",
172-
"ros_domain_id": str(workcell_1_domain_id),
173151
}.items(),
174152
condition=IfCondition(run_workcell_1),
175153
)
@@ -197,7 +175,6 @@ def launch_setup(context, *args, **kwargs):
197175
"remap_task_types": workcell_2_remap_task_types,
198176
"task_checker_plugin": "nexus::task_checkers::FilepathChecker",
199177
"max_jobs": max_workcell_jobs,
200-
"ros_domain_id": str(workcell_2_domain_id),
201178
"headless": headless,
202179
"controller_config_package": "nexus_demos",
203180
"planner_config_package": "nexus_demos",
@@ -237,7 +214,6 @@ def launch_setup(context, *args, **kwargs):
237214
launch_arguments={
238215
"zenoh_config_package": "nexus_demos",
239216
"zenoh_router_config_filename": "config/zenoh/workcell_2_connection_router_config.json5",
240-
"ros_domain_id": str(workcell_2_domain_id),
241217
}.items(),
242218
condition=IfCondition(run_workcell_2),
243219
)

nexus_demos/launch/workcell.launch.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@
3737
from typing import List
3838

3939

40-
def activate_node_service(node_name, ros_domain_id):
40+
def activate_node_service(node_name):
4141
activate_node_proc = ExecuteProcess(
4242
cmd=[
4343
'python3',
4444
[FindPackageShare('nexus_demos'), "/scripts/activate_node.py"],
4545
node_name,
46-
],
47-
additional_env={'ROS_DOMAIN_ID': ros_domain_id},
46+
]
4847
)
4948

5049
def check_activate_return_code(event, _):
@@ -77,7 +76,6 @@ def launch_setup(context, *args, **kwargs):
7776
bt_path = LaunchConfiguration("bt_path")
7877
task_checker_plugin = LaunchConfiguration("task_checker_plugin")
7978
max_jobs = LaunchConfiguration("max_jobs")
80-
ros_domain_id = LaunchConfiguration("ros_domain_id")
8179
headless = LaunchConfiguration("headless")
8280
controller_config_package = LaunchConfiguration("controller_config_package")
8381
planner_config_package = LaunchConfiguration("planner_config_package")
@@ -198,14 +196,12 @@ def launch_setup(context, *args, **kwargs):
198196
launch_arguments={
199197
"zenoh_config_package": zenoh_config_package,
200198
"zenoh_router_config_filename": zenoh_router_config_filename,
201-
'ros_domain_id': ros_domain_id.perform(context),
202199
}.items(),
203200
)
204201
]
205202
)
206203

207204
return [
208-
SetEnvironmentVariable('ROS_DOMAIN_ID', ros_domain_id),
209205
zenoh_router,
210206
SetEnvironmentVariable(
211207
"ZENOH_SESSION_CONFIG_URI",
@@ -282,7 +278,7 @@ def launch_setup(context, *args, **kwargs):
282278
)
283279
]
284280
),
285-
activate_node_service("motion_planner_server", ros_domain_id.perform(context)),
281+
activate_node_service("motion_planner_server"),
286282
]
287283

288284

@@ -307,11 +303,6 @@ def generate_launch_description():
307303
default_value="1",
308304
description="Maximum number of parallel jobs that this workcell is allowed to handle.",
309305
),
310-
DeclareLaunchArgument(
311-
"ros_domain_id",
312-
default_value="0",
313-
description="ROS_DOMAIN_ID environment variable",
314-
),
315306
DeclareLaunchArgument(
316307
"headless",
317308
default_value="true",

nexus_demos/launch/workcell_1_tf.launch.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
def launch_setup(context, *args, **kwargs):
2424
"""Publish static TFs.
2525
"""
26-
ros_domain_id = LaunchConfiguration("ros_domain_id")
2726
zenoh_config_package = LaunchConfiguration("zenoh_config_package")
2827
zenoh_session_config_filename = LaunchConfiguration("zenoh_session_config_filename")
2928

@@ -155,7 +154,6 @@ def launch_setup(context, *args, **kwargs):
155154
)
156155

157156
return [
158-
SetEnvironmentVariable('ROS_DOMAIN_ID', ros_domain_id),
159157
SetEnvironmentVariable(
160158
"ZENOH_SESSION_CONFIG_URI",
161159
PathJoinSubstitution(
@@ -175,11 +173,6 @@ def launch_setup(context, *args, **kwargs):
175173
def generate_launch_description():
176174
return LaunchDescription(
177175
[
178-
DeclareLaunchArgument(
179-
"ros_domain_id",
180-
default_value="0",
181-
description="ROS_DOMAIN_ID environment variable",
182-
),
183176
DeclareLaunchArgument(
184177
name="zenoh_config_package",
185178
default_value="nexus_demos",

nexus_demos/launch/workcell_2_tf.launch.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
def launch_setup(context, *args, **kwargs):
2424
"""Publish static TFs.
2525
"""
26-
ros_domain_id = LaunchConfiguration("ros_domain_id")
2726
zenoh_config_package = LaunchConfiguration("zenoh_config_package")
2827
zenoh_session_config_filename = LaunchConfiguration("zenoh_session_config_filename")
2928

@@ -157,7 +156,6 @@ def launch_setup(context, *args, **kwargs):
157156
)
158157

159158
return [
160-
SetEnvironmentVariable('ROS_DOMAIN_ID', ros_domain_id),
161159
SetEnvironmentVariable(
162160
"ZENOH_SESSION_CONFIG_URI",
163161
PathJoinSubstitution(
@@ -177,11 +175,6 @@ def launch_setup(context, *args, **kwargs):
177175
def generate_launch_description():
178176
return LaunchDescription(
179177
[
180-
DeclareLaunchArgument(
181-
"ros_domain_id",
182-
default_value="0",
183-
description="ROS_DOMAIN_ID environment variable",
184-
),
185178
DeclareLaunchArgument(
186179
name="zenoh_config_package",
187180
default_value="nexus_demos",

nexus_demos/launch/zenoh_router.launch.py

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030

3131
def launch_setup(context, *args, **kwargs):
32-
ros_domain_id = LaunchConfiguration("ros_domain_id")
3332
log_level = LaunchConfiguration("log_level")
3433
zenoh_config_package = LaunchConfiguration("zenoh_config_package")
3534
zenoh_router_config_filename = LaunchConfiguration("zenoh_router_config_filename")
@@ -45,7 +44,6 @@ def launch_setup(context, *args, **kwargs):
4544
cmd=cmd,
4645
shell=True,
4746
additional_env={
48-
"ROS_DOMAIN_ID": ros_domain_id.perform(context),
4947
"ZENOH_ROUTER_CONFIG_URI": PathJoinSubstitution([
5048
FindPackageShare(zenoh_config_package),
5149
zenoh_router_config_filename
@@ -57,40 +55,23 @@ def launch_setup(context, *args, **kwargs):
5755
return [zenoh_router_exec]
5856

5957
def generate_launch_description():
60-
declared_arguments = []
61-
62-
declared_arguments.append(
63-
DeclareLaunchArgument(
64-
name="ros_domain_id",
65-
default_value="0",
66-
description="ROS_DOMAIN_ID environment variable",
67-
)
68-
)
69-
70-
declared_arguments.append(
58+
declared_arguments = [
7159
DeclareLaunchArgument(
7260
name="log_level",
7361
default_value="zenoh=debug",
7462
description="Log level of zenoh router",
75-
)
76-
)
77-
78-
declared_arguments.append(
63+
),
7964
DeclareLaunchArgument(
8065
name="zenoh_config_package",
8166
default_value="nexus_demos",
8267
description="Package containing RWM Zenoh configurations",
83-
)
84-
)
85-
86-
declared_arguments.append(
68+
),
8769
DeclareLaunchArgument(
8870
name="zenoh_router_config_filename",
8971
default_value="config/zenoh/system_orchestrator_router_config.json5",
9072
description="RMW Zenoh configuration filepath",
91-
)
92-
)
93-
73+
),
74+
]
9475
return LaunchDescription(
9576
declared_arguments + [OpaqueFunction(function=launch_setup)]
9677
)

0 commit comments

Comments
 (0)