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

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

Comments

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

1 Answer

Sort by ยป oldest newest most voted
0

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">
            <always_on>true</always_on>
            <update_rate>10</update_rate>
            <camera name="left">
                <pose>0 0 0 0 0 0</pose>
                <horizontal_fov>${radians(front_camera_horizontal_fov)}</horizontal_fov>
                <image>
                    <width>640</width>
                    <height>480</height>
                    <format>RGB_INT8</format>
                </image>
                <clip>
                    <near>0.1</near>
                    <far>100</far>
                </clip>
            </camera>
            <camera name="right">
                <pose>0 -${front_camera_baseline} 0 0 0 0</pose>
                <horizontal_fov>${radians(front_camera_horizontal_fov)}</horizontal_fov>
                <image>
                    <width>640</width>
                    <height>480</height>
                    <format>RGB_INT8</format>
                </image>
                <clip>
                    <near>0.1</near>
                    <far>100</far>
                </clip>
            </camera>        
            <plugin name="stereo_camera_controller" filename="libgazebo_ros_multicamera.so">
                <robotNamespace>/</robotNamespace>
                <cameraName>stereocamera</cameraName>
                <alwaysOn>true</alwaysOn>
                <updateRate>10</updateRate>
                <imageTopicName>image_raw</imageTopicName>
                <cameraInfoTopicName>camera_info</cameraInfoTopicName>
                <frameName>stereo_optical</frameName>
                <hackBaseline>${front_camera_baseline}</hackBaseline>
                <distortion_k1>0.0</distortion_k1>
                <distortion_k2>0.0</distortion_k2>
                <distortion_k3>0.0</distortion_k3>
                <distortion_t1>0.0</distortion_t1>
                <distortion_t2>0.0</distortion_t2>
            </plugin>
        </sensor>
    </gazebo>
    
  • 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:

References


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

Comments

1

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
1

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 https://github.com/ros-simulation/gaz...

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 libgazebo_ros_multicamera.so for multicameras which doen't exist anymore, it has been included in libgazebo_ros_camera.so.

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

2 followers

Stats

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

Seen: 445 times

Last updated: Jun 29 '21