Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_parameter_value not present in Jazzy for rosapi_node #926

Closed
MoffKalast opened this issue May 9, 2024 · 3 comments
Closed

get_parameter_value not present in Jazzy for rosapi_node #926

MoffKalast opened this issue May 9, 2024 · 3 comments
Labels

Comments

@MoffKalast
Copy link

Description
Apparently the API has changed in the new release:

Traceback (most recent call last):
  File "/opt/ros/jazzy/lib/rosapi/rosapi_node", line 41, in <module>
    from rosapi import glob_helper, objectutils, params, proxy
  File "/opt/ros/jazzy/lib/python3.12/site-packages/rosapi/params.py", line 41, in <module>
    from ros2param.api import call_get_parameters, call_set_parameters, get_parameter_value
ImportError: cannot import name 'get_parameter_value' from 'ros2param.api' (/opt/ros/jazzy/lib/python3.12/site-packages/ros2param/api/__init__.py)
[ros2run]: Process exited with failure 1
  • Library Version: ros-jazzy-rosbridge-suite:arm64/noble 1.3.2-3noble.20240502.173308 uptodate
  • ROS Version: Jazzy
  • Platform / OS: Ubuntu 24.04 Server, aarch64

Steps To Reproduce
ros2 run rosapi rosapi_node

Expected Behavior
Rosapi doesn't crash.

Actual Behavior
Rosapi crashes. 😃

@MoffKalast MoffKalast added the bug label May 9, 2024
@earwole1
Copy link

@MoffKalast

We are attempting to upgrade from humble to jazzy today and this also breaks rosbridge_server, as in:
ros2 launch rosbridge_server rosbridge_websocket_launch.xml

Looks like this change was made back in Nov 2023: see here

The solution appears to be to import from rclpy:
from rclpy.parameter import get_parameter_value

Tested this locally and the behavior has been resolved. Just need to add a PR

@rubenanapu
Copy link

The solution appears to be to import from rclpy:
from rclpy.parameter import get_parameter_value

Awesome.

The file I added the suggested import was:

/opt/ros/jazzy/lib/python3.12/site-packages/ros2param/api/__init__.py

It worked like a charm.

@sea-bass
Copy link
Contributor

Closed by #932 -- thanks again @Oberacda!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants