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

disparity image is displayed but pointcloud shows only a small dot in rviz

asked 2019-04-17 05:18:45 -0500

SIU0598 gravatar image

Hi all, I am trying to get disparity image and pointclouds from VREP's two vision sensors(assembled like stereo camera) using Stereo_Image_Proc. Disparity image is successfully displayed and pointcloud topic (i-e /points2) publishes consistent data at each iteration(I mean its data contains few numbers like 197, 172,0 ,0,0,0 etc repeatedly). I don't know where am I doing mistake. I would be highly grateful if someone please solve my this problem. I have attached rqt_graph, rostopic echo /points2 and rviz display of pointcloud. Thanks

P.S I have uploaded the pics on github link text, please see there

edit retag flag offensive close merge delete


_npaul gravatar image _npaul  ( 2019-12-18 10:30:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-06-29 01:56:57 -0500

updated 2021-06-29 09:31:27 -0500

Gazebo Setup

  • I faced the exact same issue while simulating a custom stereo camera in Gazebo.
    This happens if you don't set the hackBaseline parameter.

  • Following is the Gazebo plugin I had used:

    <!-- SENSOR PLUGIN -->
    <gazebo reference="left_stereo_camera">
        <sensor type="multicamera" name="stereocamera">
            <camera name="left">
                <pose>0 0 0 0 0 0</pose>
            <camera name="right">
                <pose>0 -${front_camera_baseline} 0 0 0 0</pose>
            <plugin name="stereo_camera_controller" filename="">
  • If hackBaseline is set to 0.00:

    Here you can see the dot in RViz at the centre of the optical frame.

  • If hackBaseline is set to 0.06:


Note: Please let me know if this solution doesn't work out for you. If in case it does, feel free to upvote my answer.

edit flag offensive delete link more



Hello, I've got exactly the same issue.
I've set the baseline correctly but I still have only 1point in rviz.
Do you have any other hint ?

Acwok gravatar image Acwok  ( 2022-05-04 10:55:30 -0500 )edit

Have you spaced the stereo cameras according to your baseline requirement?

LSD gravatar image LSD  ( 2022-05-05 15:33:31 -0500 )edit

Hi @LSD, thank you for your quick reply. I finally found the issue. It seems that with the ros2 version of gazebo_ros_pkg the tags <hackBaseline> and <frameName> have been renamed respectively <hack_baseline> and <frame_name>see the code here

As the <frameName> tag wasn't read/recognized, the only point I had in rviz wasn't placed in my camera_link_optical frame but in the highest parent link of my URDF, that is to say base_footprint. After renaming the tag to <frame_name>, this point was placed at the origin of the camera_link_optical frame. Then I renamed the <hackBaseline> tag and all the points appeared.

The Gazebo documentation really sucks...
They even refer to a for multicameras which doen't exist anymore, it has been included in

Acwok gravatar image Acwok  ( 2022-05-06 03:11:23 -0500 )edit

I'm glad that you have found the solution!

There is a dedicated Wiki to the syntactical changes from ROS1 to ROS2 here.

Since you have faced issues regarding the migration of the camera plugin, I suggest going through the ROS2 Migration changes for the Camera plugin.

LSD gravatar image LSD  ( 2022-05-06 03:33:21 -0500 )edit

Question Tools



Asked: 2019-04-17 05:18:45 -0500

Seen: 370 times

Last updated: Jun 29 '21