RobotWebTools / rosbridge_suite

Server Implementations of the rosbridge v2 Protocol
https://robotwebtools.github.io
BSD 3-Clause "New" or "Revised" License
897 stars 514 forks source link

get_parameter_value not present in Jazzy for rosapi_node #926

Closed MoffKalast closed 2 months ago

MoffKalast commented 4 months ago

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

Steps To Reproduce ros2 run rosapi rosapi_node

Expected Behavior Rosapi doesn't crash.

Actual Behavior Rosapi crashes. :smiley:

earwole1 commented 4 months ago

@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 commented 3 months ago

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 commented 2 months ago

Closed by #932 -- thanks again @Oberacda!