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">
        <sensor name="camera" type="depth">
            <pose>0 0 0 0 0 0 </pose>
          <!-- 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]. -->
    <plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">
        <!-- Keep this zero, update_rate in the parent <sensor> tag
          will control the frame rate. -->
    <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" />

enter image description here

enter image description here

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


2 Answers 2


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".


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?

  • $\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.