Skip to content

Commit

Permalink
Making DirectNode visible (removing hidden node prefix) to have consi…
Browse files Browse the repository at this point in the history
…stent node naming for ros2cli.
  • Loading branch information
AAlon committed Dec 10, 2018
1 parent e478a01 commit 3bccd8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions ros2cli/ros2cli/node/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO(mikaelarguedas) revisit this once it's specified
HIDDEN_NODE_PREFIX = '_'
CLI_NODE_NAME_PREFIX = 'ros2cli_node'
5 changes: 2 additions & 3 deletions ros2cli/ros2cli/node/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import rclpy

from ros2cli.node import HIDDEN_NODE_PREFIX, CLI_NODE_NAME_PREFIX
from ros2cli.node import CLI_NODE_NAME_PREFIX
DEFAULT_TIMEOUT = 0.5


Expand All @@ -33,8 +33,7 @@ def timer_callback():

node_name_suffix = getattr(
args, 'node_name_suffix', '_%d' % os.getpid())
node_name_prefix = HIDDEN_NODE_PREFIX + CLI_NODE_NAME_PREFIX
self.node = rclpy.create_node(node_name_prefix + node_name_suffix)
self.node = rclpy.create_node(CLI_NODE_NAME_PREFIX + node_name_suffix)
timeout = getattr(args, 'spin_time', DEFAULT_TIMEOUT)
timer = self.node.create_timer(timeout, timer_callback)

Expand Down

0 comments on commit 3bccd8a

Please sign in to comment.