Ask Your Question
0

depth_image_proc subscriber

asked 2018-05-17 13:46:39 -0500

updated 2018-05-21 09:33:30 -0500

I am trying to use the depth_image_proc node and am unsure how to connect it to my network. I have no experience with a nodelet and cannot seem to remap the topics correctly. Below is my output rqt_graph. image description

I wish to connect to topics published from the matlab global node and cannot subscribe correctly.

Here is my launch file:

<launch>
    <group ns="cloud_gen">
<!-- This launch file uses the depth_image_proc node to transform a color image and a depth image
    into an xyzrgb point cloud for use with the Navigation Stack -->

<!-- This file is to be used with the Intel Realsense node rs_rgbd.launch and the MATLAB code titles
     realsense_lane_detect.m outputting the processed images-->

         <arg name="rgb_camera_info"     value="/camera/color/camera_info"/>
         <arg name="rgb_rimg_ect"        value="/processed_color"/>  <!--Rectified color image-->
         <arg name="depReg_imgrect"      value="/processed_depth"/>  <!--Rectified depth image-->
         <arg name="out_cloud"           value="/white_lines"/>

        <!-- Nodelet manager for this pipeline -->
        <node pkg="nodelet" type="nodelet" args="manager"
            name="standalone_nodelet" output="screen"/>

        <!-- Construct point cloud of the rgb and depth topics -->
        <node pkg="nodelet" type="nodelet" name="depth_image_proc"
            args="load depth_image_proc/point_cloud_xyzrgb standalone_nodelet" output="screen">
            <remap from="rgb/camera_info"               to="/camera/color/camera_info" />
            <remap from="rgb/image_rect_color"          to="$(arg rgb_rimg_ect)"/>
            <remap from="depth_registered/image_rect"   to="$(arg depReg_imgrect)"/>
            <remap from="depth_registered/points"       to="$(arg out_cloud)"/>
        </node>
    </group>
</launch>

Any help is appreciated!

Edit 1: Below is the output of rosnode info on that MATLAB node.

rosnode info /matlab_global_node_59233 
    --------------------------------------------------------------------------------
    Node [/matlab_global_node_59233]
    Publications: 
     * /processed_color [sensor_msgs/Image]
     * /processed_depth [sensor_msgs/Image]
     * /rosout [rosgraph_msgs/Log]

    Subscriptions: 
     * /camera/depth_registered/points [sensor_msgs/PointCloud2]

    Services: None


    contacting node http://whitelines:42372/ ...
    Pid: 21599
    Connections:
     * topic: /rosout
        * to: /rosout
        * direction: outbound
        * transport: TCPROS
     * topic: /camera/depth_registered/points
        * to: /camera/realsense2_camera_manager (http://whitelines:44751/)
        * direction: inbound
        * transport: TCPROS
edit retag flag offensive close merge delete

Comments

Hello cmfuhrman, could you please elaborate more what you are trying to do? Which node needs to be connected to which? Which node needs to be connected to MATLAB node? Is it realsense->depth_image_proc->matlab?

dljubic gravatar imagedljubic ( 2018-05-18 15:25:08 -0500 )edit

I am taking the point cloud from the RealSense node and processing in MATLAB. I want to send the processed depth image and the processed rgb image back to the depth_image_proc node. I would be going RealSense-->MATLAB-->depth_image_proc. I am unsure why I cannot get the topics properly remapped.

cmfuhrman gravatar imagecmfuhrman ( 2018-05-18 16:07:56 -0500 )edit

I wand the depth_image_proc to subsribe to the following: "/camera/color/camera_info" "/processed_color" "/processed_depth" through remapping.

cmfuhrman gravatar imagecmfuhrman ( 2018-05-18 16:09:53 -0500 )edit

Thanks for the explanation! I have actually tried running your launch script with some .bag files and it worked right away. My depth_image_proc node subscribes to all the topics from the .bag and produces pointcloud visible in rviz. Could you please provide rosnode info of your MATLAB node?

dljubic gravatar imagedljubic ( 2018-05-19 10:30:23 -0500 )edit

Sorry to take so long - did not have access to the camera. Please see edit 1.

cmfuhrman gravatar imagecmfuhrman ( 2018-05-21 09:33:55 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-05-23 08:36:26 -0500

This launch file is actually working correctly. I did not know that depth_image_proc would not subscribe to any topics until its output (/white_lines in this case) has been subscribed. This solves my problem!

edit flag offensive delete link more

Comments

Great that you figured out what was wrong! That behavior is usually called lazy subscribing i.e. it does not subscribe to the input topic unless there is at least one subscriber to the output topic.

dljubic gravatar imagedljubic ( 2018-05-23 14:37:06 -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

2 followers

Stats

Asked: 2018-05-17 13:46:39 -0500

Seen: 323 times

Last updated: May 23 '18