Ask Your Question

Nodes not connecting through remap in launch file

asked 2019-03-26 09:52:26 -0500

THordijk gravatar image

updated 2019-03-27 04:36:08 -0500

Hello I am using ROS kinetic with ensenso/ros_driver and akio/mask_rcnn_ros, both the master branch. Running on Ubuntu 16.04 kernel version 4.15.0-46-generic.

I am using an Nvidia RTX 2080 ti with cuda 418.39

I am trying to connect the ensenso_camera_node to the mask_rcnn_node using a launch file in which I remap the input of the model to the output of the camera.

    <remap from="~input" to="/rectified/left/image"/>  
    <arg name="configuratie" value="$(find ensenso_camera)/configs/configuratie.json"/>
    <node pkg="ensenso_camera" type="ensenso_camera_node" name="ensenso_camera_node">
    <param name="settings" value="$(arg configuratie)"/>
    <node pkg="ensenso_camera" type="request_data" name="image_data"></node>
    <node pkg="tf" type="static_transform_publisher" name="ensenso_optical_frame" 
           args="0 0 0 0 0 0 world ensenso_optical_frame 100"/>
    <node pkg="mask_rcnn_ros" type="mask_rcnn_node" name="mask_rcnn"></node>

The nodes are started without an error, however, when I check with roswtf it states that either the input of the model is not connected, or that the camera and the model should be connected but aren't depending on the position of the remap statement in the launch file.

WARNING The following node subscriptions are unconnected:
    * /mask_rcnn:
       * /mask_rcnn/input


ERROR The following nodes should be connected but aren't:
   * /ensenso_camera_node->/mask_rcnn (/camera_image)

I am guessing that I am making a mistake in the remapping of the topics but my experience with ROS is about as much as can be seen above so I am not sure. Hopefully someone can help me out with this.

Thanks in advance!



As a reponse to the comments:

With the remap still in place the rosnode info mask_rcnn returns:

Node [/mask_rcnn]
 * /mask_rcnn/result [mask_rcnn_ros/Result]
 * /mask_rcnn/visualization [sensor_msgs/Image]
 * /rosout [rosgraph_msgs/Log]

 * /mask_rcnn/input [unknown type]

 * /mask_rcnn/get_loggers
 * /mask_rcnn/set_logger_level

contacting node http://riworackpc-System-Product-Name:45449/ ...
Pid: 7733
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS

With remap removed rosnode list returns:


rostopic list returns:

/calibrate_workspace/goal ...
edit retag flag offensive close merge delete


Maybe the mask_rcnn node is a lazy subscriber which means it only subscribes to the input topics (/rectified/left/image) when another node is subscribing to its output topic (/mask_rcnn/result, /mask_rcnn/visualization). Have you tried having a node which subscribes to its output topic?

ZeroSan gravatar image ZeroSan  ( 2019-03-27 05:02:04 -0500 )edit

I have tried to open the visualization topic in rviz, that is about it. Would a dummy node that simply requests data cause a different reaction?

THordijk gravatar image THordijk  ( 2019-03-27 05:08:22 -0500 )edit

@ZeroSan: that is a good thing to check, but looking at the source I don't believe this is the case.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-27 05:32:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-26 11:57:21 -0500

gvdhoorn gravatar image

updated 2019-03-27 05:36:38 -0500

Edit: seems the ~ does make this work, at least for me.

I don't have an Ensenso to test with, but with the Simple Publisher and Subsciber from this tutorial (edited to use the same topic names as the nodes the OP uses), the following works for me:

  <node pkg="..." type="" name="ensenso_camera_node" />
  <node pkg="..." type="" name="mask_rcnn">
    <remap from="~input" to="/rectified/left/image"/>

Output of rostopic list with this running:


which is what I would expect: the input topic no longer "exists" (as it's been completely remapped to /rectified/left/image).

Original answer:

     <remap from="~input" to="/rectified/left/image"/>

This won't work: the ~ there is typically used to refer to the private namespace of a node. Your remap tag is however not a child of any node, so this remapping doesn't make sense.

You'll want to move the remap down to where the mask_rcnn_node node is being launched:

<node pkg="mask_rcnn_ros" type="mask_rcnn_node" name="mask_rcnn">
  <remap from="input" to="/rectified/left/image" />

and drop the ~.

edit flag offensive delete link more


Thank you very much for the reply. I changed the launch file as per your instructions, however, the result that it returns remains the same. I also tried changing the topic name in the mask_rcnn_node to input without the ~ but that did not help either. Could this problem be caused elsewhere? Is it perhaps not possible to remap to an existing topic?

Could it be caused by differences in encoding types passed through the topic and expected by the subscriber? This should be uniform, I think, as I changed it as described on the original git repo, but i don't want to exclude any possible reason.

THordijk gravatar image THordijk  ( 2019-03-27 01:53:10 -0500 )edit

with your nodes running do rosnode info mask_rcnn it will list at the top what the node is subscribed to and what it's publishing.

Reamees gravatar image Reamees  ( 2019-03-27 02:30:35 -0500 )edit

@THordijk: can you show us the output of rosnode list and rostopic list if you don't add the remap?

gvdhoorn gravatar image gvdhoorn  ( 2019-03-27 04:12:37 -0500 )edit

I have managed the same, the problem that i am now running into is the encoding that the camera driver provides and what is expected by the model. So the connection issue seems resolved, I now have a new hurdle to pass. Thank you very much for the help!

THordijk gravatar image THordijk  ( 2019-03-27 06:01:30 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-03-26 08:53:47 -0500

Seen: 207 times

Last updated: Mar 27 '19