ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ResizeNode subscribes and publishes camera info on the same topic

asked 2021-10-20 13:25:41 -0500

clyde gravatar image

Seems like a dumb question, but I can't find the answer.

I see that image_proc::ResizeNode subscribes to /camera_info, and then generates a new CameraInfo message with the scaled intrinsics. But it publishes this scaled camera info on the the same topic. The messages are identical except for fx, fy, cx and cy. How can a downstream node tell them apart? How does this work with image_transport?

Thanks.

edit retag flag offensive close merge delete

Comments

That doesn't sound like what should be happening.

How can a downstream node tell them apart?

it would not be able to. Or at least not in any scalable way.

Could you link to the code (as in: specific lines)? I'm assuming you're looking at the default implementation, which is hosted in a Github repository.

gvdhoorn gravatar image gvdhoorn  ( 2021-10-21 03:35:50 -0500 )edit

ROS2 version uses an image_transport::CameraPublisher and an image_transport::CameraSubscriber:

https://github.com/ros-perception/ima...

Both of these call image_transport::getCameraInfoTopic:

CameraSubscriber: https://github.com/ros-perception/ima...

CameraPublisher: https://github.com/ros-perception/ima...

image_transport::getCameraInfoTopic basically always returns "/camera_info":

https://github.com/ros-perception/ima...

This looks like a bug to me. It seems funny that this hasn't been noticed before, though.

clyde gravatar image clyde  ( 2021-10-22 13:41:47 -0500 )edit

ROS1 is different... it uses a private node handle for pub and node handle for sub. It's been a while since I've used ROS1, perhaps it's possible to distinguish between them through remapping?

https://github.com/ros-perception/ima...

clyde gravatar image clyde  ( 2021-10-22 13:47:15 -0500 )edit
1

Looks like a bug has already been reported: https://github.com/ros-perception/ima...

clyde gravatar image clyde  ( 2021-10-25 15:35:03 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-22 08:46:07 -0500

clyde gravatar image
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-10-20 13:25:41 -0500

Seen: 173 times

Last updated: May 22 '23