Skip to content

Commit c3436aa

Browse files
committed
Remove 'node_' prefix from members and arguments.
Distro A, OPSEC #4584. You may have additional rights; please see https://rosmilitary.org/faq/?category=ros-2-license Signed-off-by: matthew.lanting <[email protected]>
1 parent d81f036 commit c3436aa

File tree

9 files changed

+115
-115
lines changed

9 files changed

+115
-115
lines changed

launch_ros/launch_ros/actions/lifecycle_node.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def unblock(future):
123123
self.__logger.error(
124124
"Failed to make transition '{}' for LifecycleNode '{}'".format(
125125
ChangeState.valid_transitions[request.transition.id],
126-
self.node_name,
126+
self.name,
127127
)
128128
)
129129

@@ -142,20 +142,20 @@ def execute(self, context: launch.LaunchContext) -> Optional[List[Action]]:
142142
143143
Delegated to :meth:`launch.actions.ExecuteProcess.execute`.
144144
"""
145-
self.prepare(context) # ensure self.node_name is expanded
146-
if '<node_name_unspecified>' in self.node_name:
147-
raise RuntimeError('node_name unexpectedly incomplete for lifecycle node')
145+
self.prepare(context) # ensure self.name is expanded
146+
if '<node_name_unspecified>' in self.name:
147+
raise RuntimeError('name unexpectedly incomplete for lifecycle node')
148148
node = get_ros_node(context)
149149
# Create a subscription to monitor the state changes of the subprocess.
150150
self.__rclpy_subscription = node.create_subscription(
151151
lifecycle_msgs.msg.TransitionEvent,
152-
'{}/transition_event'.format(self.node_name),
152+
'{}/transition_event'.format(self.name),
153153
functools.partial(self._on_transition_event, context),
154154
10)
155155
# Create a service client to change state on demand.
156156
self.__rclpy_change_state_client = node.create_client(
157157
lifecycle_msgs.srv.ChangeState,
158-
'{}/change_state'.format(self.node_name))
158+
'{}/change_state'.format(self.name))
159159
# Register an event handler to change states on a ChangeState lifecycle event.
160160
context.register_event_handler(launch.EventHandler(
161161
matcher=lambda event: isinstance(event, ChangeState),

launch_ros/launch_ros/actions/load_composable_nodes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def execute(
210210
# resolve target container node name
211211

212212
if is_a_subclass(self.__target_container, ComposableNodeContainer):
213-
self.__final_target_container_name = self.__target_container.node_name
213+
self.__final_target_container_name = self.__target_container.name
214214
elif isinstance(self.__target_container, SomeSubstitutionsType_types_tuple):
215215
subs = normalize_to_list_of_substitutions(self.__target_container)
216216
self.__final_target_container_name = perform_substitutions(
@@ -253,11 +253,11 @@ def get_composable_node_load_request(
253253
request.plugin_name = perform_substitutions(
254254
context, composable_node_description.node_plugin
255255
)
256-
if composable_node_description.node_name is not None:
256+
if composable_node_description.name is not None:
257257
request.node_name = perform_substitutions(
258-
context, composable_node_description.node_name
258+
context, composable_node_description.name
259259
)
260-
expanded_ns = composable_node_description.node_namespace
260+
expanded_ns = composable_node_description.namespace
261261
if expanded_ns is not None:
262262
expanded_ns = perform_substitutions(context, expanded_ns)
263263
base_ns = context.launch_configurations.get('ros_namespace', None)

launch_ros/launch_ros/actions/node.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(
127127
:param: ros_arguments list of ROS arguments for the node
128128
:param: arguments list of extra arguments for the node
129129
"""
130-
self.__node_desc = NodeDescription(node_name=name, node_namespace=namespace,
130+
self.__node_desc = NodeDescription(name=name, namespace=namespace,
131131
parameters=parameters, remappings=remappings)
132132
executable_keywords = inspect.signature(Executable).parameters.keys()
133133
ros_exec_kwargs = {key: val for key, val in kwargs.items() if key in executable_keywords}
@@ -136,8 +136,8 @@ def __init__(
136136
nodes=[self.__node_desc], **ros_exec_kwargs)
137137
super().__init__(process_description=self.__ros_exec, **kwargs)
138138

139-
def is_node_name_fully_specified(self):
140-
return self.__node_desc.is_node_name_fully_specified()
139+
def is_name_fully_specified(self):
140+
return self.__node_desc.is_name_fully_specified()
141141

142142
@staticmethod
143143
def parse_nested_parameters(params, parser):
@@ -217,12 +217,12 @@ def parse(cls, entity: Entity, parser: Parser):
217217
ros_args = entity.get_attr('ros_args', optional=True)
218218
if ros_args is not None:
219219
kwargs['ros_arguments'] = ExecuteProcess._parse_cmdline(ros_args, parser)
220-
node_name = entity.get_attr('node-name', optional=True)
221-
if node_name is not None:
222-
kwargs['node_name'] = parser.parse_substitution(node_name)
223-
node_name = entity.get_attr('name', optional=True)
224-
if node_name is not None:
225-
kwargs['name'] = parser.parse_substitution(node_name)
220+
name = entity.get_attr('node-name', optional=True)
221+
if name is not None:
222+
kwargs['name'] = parser.parse_substitution(name)
223+
name = entity.get_attr('name', optional=True)
224+
if name is not None:
225+
kwargs['name'] = parser.parse_substitution(name)
226226
exec_name = entity.get_attr('exec_name', optional=True)
227227
if exec_name is not None:
228228
kwargs['exec_name'] = parser.parse_substitution(exec_name)
@@ -250,29 +250,29 @@ def parse(cls, entity: Entity, parser: Parser):
250250
return cls, kwargs
251251

252252
@property
253-
def node_package(self):
254-
"""Getter for node_package."""
253+
def package(self):
254+
"""Getter for package."""
255255
return self.__ros_exec.package
256256

257257
@property
258-
def node_executable(self):
259-
"""Getter for node_executable."""
258+
def executable(self):
259+
"""Getter for executable."""
260260
return self.__ros_exec.executable
261261

262262
@property
263-
def node_name(self):
264-
"""Getter for node_name."""
265-
return self.__node_desc.node_name
263+
def name(self):
264+
"""Getter for name."""
265+
return self.__node_desc.name
266266

267267
@property
268268
def ros_exec(self):
269269
"""Getter for ros_exec."""
270270
return self.__ros_exec
271271

272272
@property
273-
def expanded_node_namespace(self):
274-
"""Getter for expanded_node_namespace."""
275-
return self.__node_desc.expanded_node_namespace
273+
def expanded_namespace(self):
274+
"""Getter for expanded_namespace."""
275+
return self.__node_desc.expanded_namespace
276276

277277
@property
278278
def expanded_remapping_rules(self):

launch_ros/launch_ros/descriptions/composable_node.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ def __init__(
5858
self.__package = normalize_to_list_of_substitutions(package)
5959
self.__node_plugin = normalize_to_list_of_substitutions(plugin)
6060

61-
self.__node_name = None # type: Optional[List[Substitution]]
61+
self.__name = None # type: Optional[List[Substitution]]
6262
if name is not None:
63-
self.__node_name = normalize_to_list_of_substitutions(name)
63+
self.__name = normalize_to_list_of_substitutions(name)
6464

65-
self.__node_namespace = None # type: Optional[List[Substitution]]
65+
self.__namespace = None # type: Optional[List[Substitution]]
6666
if namespace is not None:
67-
self.__node_namespace = normalize_to_list_of_substitutions(namespace)
67+
self.__namespace = normalize_to_list_of_substitutions(namespace)
6868

6969
self.__parameters = None # type: Optional[Parameters]
7070
if parameters is not None:
@@ -135,14 +135,14 @@ def node_plugin(self) -> List[Substitution]:
135135
return self.__node_plugin
136136

137137
@property
138-
def node_name(self) -> Optional[List[Substitution]]:
138+
def name(self) -> Optional[List[Substitution]]:
139139
"""Get node name as a sequence of substitutions to be performed."""
140-
return self.__node_name
140+
return self.__name
141141

142142
@property
143-
def node_namespace(self) -> Optional[List[Substitution]]:
143+
def namespace(self) -> Optional[List[Substitution]]:
144144
"""Get node namespace as a sequence of substitutions to be performed."""
145-
return self.__node_namespace
145+
return self.__namespace
146146

147147
@property
148148
def parameters(self) -> Optional[Parameters]:

0 commit comments

Comments
 (0)