Skip to content

Commit

Permalink
Warning: get_parameter_value() is deprecated. (#866)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Nov 3, 2023
1 parent 6724a58 commit 3f0ae33
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ros2component/ros2component/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import rcl_interfaces.msg

import rclpy
from rclpy.parameter import get_parameter_value
from rclpy.task import Future

from ros2cli.node.strategy import NodeStrategy
from ros2node.api import get_node_names
from ros2node.api import get_service_server_info
from ros2param.api import get_parameter_value
from ros2pkg.api import get_executable_paths
from ros2pkg.api import PackageNotFound

Expand Down
8 changes: 0 additions & 8 deletions ros2param/ros2param/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@
# limitations under the License.

import sys
import warnings

from rcl_interfaces.msg import ParameterType
import rclpy
from rclpy.parameter import get_parameter_value as rclpy_get_parameter_value
from rclpy.parameter import parameter_dict_from_yaml_file
from rclpy.parameter import parameter_value_to_python
from rclpy.parameter_client import AsyncParameterClient
from ros2cli.node.direct import DirectNode


def get_parameter_value(*, string_value):
warnings.warn('get_parameter_value() is deprecated. '
'Use rclpy.parameter.get_parameter_value instead')
return rclpy_get_parameter_value(string_value)


def get_value(*, parameter_value):
"""Get the value from a ParameterValue."""
value = None
Expand Down
2 changes: 1 addition & 1 deletion ros2param/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pytest

from rcl_interfaces.msg import ParameterType
from ros2param.api import get_parameter_value
from rclpy.parameter import get_parameter_value


@pytest.mark.parametrize(
Expand Down

0 comments on commit 3f0ae33

Please sign in to comment.