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

topic remapping in synchronised message_filters

asked 2018-05-04 10:24:58 -0600

Christian Rauch gravatar image

I am trying to synchronise a compressed depth image and its camera info:

image_transport::SubscriberFilter sub_image(it, "image", 10);
message_filters::Subscriber<sensor_msgs::CameraInfo> sub_info(n, "camera_info", 10);
message_filters::Synchronizer<ApproxSync> sync(ApproxSync(100), sub_info, sub_image);

The original topics are:

  • /camera/depth/image_rect_raw/compressedDepth (to be mapped to: image)
  • /camera/depth/camera_info (to be mapped to: camera_info)

Only the compressed depth has been logged.

I am using the arguments image:=/camera/depth/image_rect_raw _image_transport:=compressedDepth camera_info:=/camera/depth/camera_info for the executable, which are supposed to remap the topics and select the image transport.

However, rqt's Node Graph shows that the node is subscribing to /image/compressedDepth, i.e. it is ignoring the topic remapping for image but applies the image transport extension of the topic before the remapping.

The synchronisation works, when using the full topic names and only the argument _image_transport:=compressedDepth:

image_transport::SubscriberFilter sub_image(it, "/camera/depth/image_rect_raw", 10);
message_filters::Subscriber<sensor_msgs::CameraInfo> sub_info(n, "/camera/depth/camera_info", 10);
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-05-06 11:34:49 -0600

Christian Rauch gravatar image

A workaround is to manually remap the topic via ros::names::remap(<topic>):

image_transport::SubscriberFilter sub_image(it, ros::names::remap("image"), 10);
message_filters::Subscriber<sensor_msgs::CameraInfo> sub_info(n, ros::names::remap("camera_info"), 10);
edit flag offensive delete link more
1

answered 2018-05-04 12:18:50 -0600

ahendrix gravatar image

No remapping lookup is done on the base_topic for image transport plugins before the transport type is appended: https://github.com/ros-perception/ima... (I'm not sure if this lookup is done elsewhere or not).

If you think this is a bug, you should report is on the image_transport bug tracker: https://github.com/ros-perception/ima...

edit flag offensive delete link more

Comments

Thanks for pointing to the relevant parts. There is already a bug report at: https://github.com/ros-perception/ima...

Christian Rauch gravatar image Christian Rauch  ( 2018-05-06 09:42:36 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2018-05-04 10:24:58 -0600

Seen: 591 times

Last updated: May 06 '18