0
$\begingroup$

I am trying to correctly orient the pointcloud data coming from a Depth camera sensor Gazebo model into the Rviz, but it's not working.

Camera Model:

<gazebo reference="camera_link_1">
        <material>Gazebo/Red</material>
        <sensor name="camera" type="depth">
            <pose>0 0 0 0 0 0 </pose>
            <visualize>true</visualize>
            <update_rate>30</update_rate>
            <camera>
                <horizontal_fov>1.089</horizontal_fov>
                <image>
                    <format>B8G8R8</format>
                    <width>640</width>
                    <height>480</height>
                </image>
                <clip>
                    <near>0.05</near>
                    <far>5.0</far>
                </clip>
                 <noise>
                   <type>gaussian</type>
          <!-- Noise is sampled independently per pixel on each frame.
               That pixel's noise value is added to each of its color
               channels, which at that point lie in the range [0,1]. -->
                   <mean>0.0</mean>
                   <stddev>0.035</stddev>
                </noise>
              </camera>
    <plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">
        <baseline>0.2</baseline>
        <alwaysOn>true</alwaysOn>
        <!-- Keep this zero, update_rate in the parent <sensor> tag
          will control the frame rate. -->
        <updateRate>0.0</updateRate>
        <cameraName>ur5_1/</cameraName>
        <imageTopicName>/ur5/depth/image_raw_1</imageTopicName>
        <cameraInfoTopicName>/ur5/depth/camera_info_1</cameraInfoTopicName>
        <depthImageTopicName>/ur5/depth/image_raw_1</depthImageTopicName>
        <depthImageInfoTopicName>/ur5/depth/camera_info_1</depthImageInfoTopicName>
        <pointCloudTopicName>/ur5/depth/points_1</pointCloudTopicName>
        <frameName>camera_link_1</frameName>
        <min_depth>0.1</min_depth>
        <max_depth>50.0</max_depth>
        <pointCloudCutoff>0.05</pointCloudCutoff>
        <distortionK1>0</distortionK1>
        <distortionK2>0</distortionK2>
        <distortionK3>0</distortionK3>
        <distortionT1>0</distortionT1>
        <distortionT2>0</distortionT2>
        <CxPrime>0</CxPrime>
        <Cx>0</Cx>
        <Cy>0</Cy>
        <focalLength>0</focalLength>
        <hackBaseline>0</hackBaseline>
      </plugin>
    </sensor>
  </gazebo>
    <joint name="camera_world_joint" type="fixed">
    <parent link="world" />
    <child link = "camera_link_1" />
    <origin xyz="0.9 -0.079916 2.00" rpy="0.0 1.20 3.14" />
  </joint>

enter image description here

enter image description here

I would really appreciate some help/guidance on this issue.

$\endgroup$

2 Answers 2

1
$\begingroup$

In ros, the convention for camera-like devices is to orient the "optical frame" so that +x points right, +y points down, and the +z points forward (toward the scene.)

One method to get the correct TF tree is to add a fixed joint from the camera_frame to the camera_optical_frame; this joint bends the z-axis from "up" to "forward". The usual rpy used for a joint is "-1.570796 0 -1.570796".

$\endgroup$
0
$\begingroup$

I am not able to comment, so i am writing in the answer section. Can you try to change the frame (from base link to __camera link)in rviz and check the orientation again?

$\endgroup$
4
  • $\begingroup$ I already tried that but the problem remains same. $\endgroup$ Commented Dec 15, 2023 at 14:23
  • $\begingroup$ what is the error in rviz under camera tab. It shows yellow $\endgroup$
    – Hem92j
    Commented Dec 15, 2023 at 16:00
  • $\begingroup$ Its camera Warning but it is not related to orientation of point cloud. $\endgroup$ Commented Dec 15, 2023 at 16:14
  • $\begingroup$ is it possible to add urdf file or link to github repo? $\endgroup$
    – Hem92j
    Commented Dec 15, 2023 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.