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

Cannot get or set parameters with the type of PARAMETER_INTEGER_ARRAY #53

Closed
xhuan28 opened this issue Aug 14, 2019 · 5 comments
Closed
Assignees
Labels
bug ros2 Specific to ROS 2 only

Comments

@xhuan28
Copy link

xhuan28 commented Aug 14, 2019

I have several parameters whose type are PARAMETER_INTEGER_ARRAY. It seems that rqt_reconfigure hasn't support this type yet, since I was trying to launch rqt_reconfigure, it failed with the following error messages:

Traceback (most recent call last):
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/node_selector_widget.py", line 277, in _selection_changed_slot
self._selection_selected(index_current, rosnode_name_selected)
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/node_selector_widget.py", line 228, in _selection_selected
raise e
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/node_selector_widget.py", line 226, in _selection_selected
item_widget = item_child.get_param_client_widget()
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/treenode_qstditem.py", line 94, in get_param_client_widget
self._context, self.raw_param_name
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/param_client_widget.py", line 116, in init
self.param_client.get_parameters(param_names),
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/param_api.py", line 89, in get_parameters
for name, value in zip(names, get_params_response.values)
File "/home/intel/workspace/ros2_other_ws/build/rqt_reconfigure/src/rqt_reconfigure/param_api.py", line 89, in
for name, value in zip(names, get_params_response.values)
File "/home/intel/workspace/ros2_ws/install/rclpy/lib/python3.6/site-packages/rclpy/parameter.py", line 121, in from_parameter_msg
return cls(param_msg.name, type
, value)
File "/home/intel/workspace/ros2_ws/install/rclpy/lib/python3.6/site-packages/rclpy/parameter.py", line 132, in init
raise ValueError("Type '{}' and value '{}' do not agree".format(type
, value))
ValueError: Type 'Type.INTEGER_ARRAY' and value 'array('q', [640, 480])' do not agree
[INFO] [PluginContainerWidget]: Connection to node=/realsense failed:
Type 'Type.INTEGER_ARRAY' and value 'array('q', [640, 480])' do not agree
[ERROR] [rqt_reconfigure]: Connection to node=/realsense failed:
Type 'Type.INTEGER_ARRAY' and value 'array('q', [640, 480])' do not agree

On the other hand, I was trying to get/set parameters by ros2 param. Everything works well.

$ros2 param set my_node my_param [640,480]
Set parameter successful
$ros2 param get my_node my_param
Integer values are: array('q', [640, 480])

@gonzodepedro gonzodepedro self-assigned this Aug 14, 2019
@gonzodepedro
Copy link
Collaborator

Created #56 and ros2/rclpy#424

@dirk-thomas
Copy link
Contributor

What is the status if this?

@gonzodepedro
Copy link
Collaborator

It is in my backlog to work on. I created issues #56 and ros2/rclpy#424 which together will solve this issue. I still need to created PR to fix those. I'm expecting to make progress on those next week.

@valioiv
Copy link

valioiv commented Oct 28, 2019

@gonzodepedro ,
the array issue in the constructor seems fixed and merged now:
ros2/rclpy#444

@cottsay cottsay changed the title [ROS2]Cannot get or set parameters with the type of PARAMETER_INTEGER_ARRAY Cannot get or set parameters with the type of PARAMETER_INTEGER_ARRAY Jun 12, 2020
@cottsay cottsay added the ros2 Specific to ROS 2 only label Jun 12, 2020
@christianrauch
Copy link

This should be solved by #108. Please check and close.

@xhuan28 xhuan28 closed this as completed Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ros2 Specific to ROS 2 only
Projects
None yet
Development

No branches or pull requests

6 participants