Skip to content

camera_info_manager_py fails on using set_camera_info service #380

@jfrancis71

Description

@jfrancis71

If I use the set_camera_info service the CameraInfoManager fails with:

File "/root/ros2_ws/build/stereo_demo/stereo_demo/stereo_split_node.py", line 64, in
rclpy.spin(stereo_node)
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/init.py", line 247, in spin
executor.spin_once()
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 839, in spin_once
self._spin_once_impl(timeout_sec)
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 834, in _spin_once_impl
raise handler.exception()
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/task.py", line 269, in call
self._handler.send(None)
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 518, in handler
await call_coroutine()
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 457, in _execute
response = await await_or_execute(srv.callback, request, srv.srv_type.Response())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ros/jazzy/lib/python3.12/site-packages/rclpy/executors.py", line 111, in await_or_execute
return callback(*args)
^^^^^^^^^^^^^^^
TypeError: CameraInfoManager.setCameraInfo() takes 2 positional arguments but 3 were given
[ros2run]: Process exited with failure 1

It looks like the implementation of the service (setCameraInfo) only takes the request parameter, when presumably it should take both request and response. This is the case for both rolling and jazzy.

I notice there is a pull request #377 which seems to deal with this issue. This pull request also includes a fix to some yaml/numpy issues which I also found to be a problem.

The pull request originates from https://github.com/furbrain/image_common. I have done a clone of this and colcon build the camera_info_manager_py and it looks good to me. I can use the set_camera_info service and correctly persist this in a yaml file.

I am using ROS2 Jazzy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions