stereo_image_proc pointcloud isn't visible

asked 2020-05-11 13:06:20 -0500

Samykolon gravatar image

Hey guys,

I'm currently simulating some stuff using the Heron USV Simulator. https://github.com/heron/heron_simulator

Task for me now was to add a stereo camera to it and then somehow retrieve a pointcloud of the water unterground of it. For this I decided to use the package stereo_img_proc.

So far so good. I set up the camera in one of the xacro files like this:

<link name="${namespace}camera_link"> <collision> <origin xyz="0.1 0 -0.2" rpy="0 0.4 0"/> <geometry> <box size="${camera_link} ${camera_link} ${camera_link}"/> </geometry> </collision>

  <visual>
    <origin xyz="0.1 0 -0.2" rpy="0 0.4 0"/>
    <geometry>
      <box size="${camera_link} ${camera_link} ${camera_link}"/>
    </geometry>
    <material name="red"/>
  </visual>

  <inertial>
    <mass value="1e-5" />
    <origin xyz="0.1 0 -0.2" rpy="0 0.4 0"/>
    <inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
  </inertial>
</link>  

<joint name="camera_joint" type="fixed">    
  <origin xyz="0 0 -0.2" rpy="0 0.4 0"/>
  <parent link="${namespace}base_link"/>
  <child link="${namespace}camera_link"/>
</joint>



<gazebo reference="${namespace}camera_link">
  <sensor name="${namespace}camera" type="multicamera">
    <update_rate>20</update_rate>
    <camera name="left">
      <horizontal_fov>1.3962634</horizontal_fov>
    <image>
      <width>50</width>
      <height>50</height>
      <format>R8G8B8</format>
    </image>
    <clip>
      <near>1</near>
      <far>70</far>
    </clip>        
  </camera>
  <camera name="right">
    <pose>0 -0.15 0 0 0 0</pose>
    <horizontal_fov>1.3962634</horizontal_fov>
    <image>
      <width>50</width>
      <height>50</height>
      <format>R8G8B8</format>
    </image>
    <clip>
      <near>1</near>
      <far>70</far>
    </clip>               
  </camera>
    <plugin name="${namespace}cameracontroller" filename="libgazebo_ros_multicamera.so">
      <baseline>0.2</baseline>
      <alwaysOn>true</alwaysOn>
      <updateRate>1.0</updateRate>
      <cameraName>${namespace}camera</cameraName>
      <leftCamera>${namespace}left</leftCamera>
      <rightCamera>${namespace}right</rightCamera>          
      <frameName>${namespace}base_link</frameName>
      <distortionK1>0.00000001</distortionK1>
      <distortionK2>0.00000001</distortionK2>
      <distortionK3>0.00000001</distortionK3>
      <distortionT1>0.00000001</distortionT1>
      <distortionT2>0.00000001</distortionT2>
      <hackBaseline>0</hackBaseline>
    </plugin>
  </sensor>
</gazebo>

This works fine - if I run the simulator I see a red box which is a placeholder for my camera. Then I tried to reconfigure stereo_image_proc like the official documentation said - this also works very fine. I get the output of the left and right camera and also an perfectly nice disparity image which is needed for the creation of a pointcloud.

Then I tried to visualize the pointcloud in RVIZ. And I just can make it visible. I tried everything. I added a Pointcloud2 and then chose the topic of stereo_image_proc which in my case is /camera/points2. RVIZ says the topic is ok, I see that RVIZ retrieves messages from it and it also says that the transformation is ok.

I also tried visualizing the pointcloud using pcl and a viewer. But still just a black screen - no points.

I also tried saving the pointcloud to a .ply file using the pcl_ply library and open up the ply file in meshlab - there are just no points only the warning that there are no coordinates.

Im sitting on this ... (more)

edit retag flag offensive close merge delete