Gazebo and Rviz ROS depth camera wrong rotation [closed]

asked 2020-10-15 09:11:18 -0500

Dookei gravatar image

updated 2020-10-15 09:12:53 -0500

Hi , I am currently facing an issue that seems to be recurrent to other people but I still didn't manage to find an answer. In Gazebo I have the following camera( I have 6 of them actually, they all have the same porblem) that uses a frame from ROS. The image is displayed correctly( I checked by moving some objects in front) but with Z front as reference and not X as it should.

I also checked this other post but somehow this is not working in my case. gazebo camera frame is inconsistent with rviz + opencv convention

So here is my output:

and here is my sdf / Gazebo camera definition

<!-- FRONT CAMERA    0.420767 0.0
0.227750    -->
    <model name="front_camera">
      <pose>0.420767 0.0 0.227750  0.0 0.0 0.0</pose>
      <link name="link">
          <pose>0.01 0.025 0.025 0 0 0</pose>
        <visual name="visual">
          <pose>0.0 0.0 0.0  0.0 0.0 0.0</pose>
        <sensor name="front_camera" type="depth">
         <pose>0.0 0.0 0.0 0.0 0 0.0</pose>
          <plugin filename="" name="camera_controller">
            <pose>0.0 0.0 0.0 0.0 0.0 0.0 </pose>

    <joint name="front_camera_joint_front" type="revolute">
        <xyz>0 0 0</xyz>

I would appreciate any guidance this is currently driving me crazy.


edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Dookei
close date 2020-10-16 07:48:51.240041


ended up merging this solved my issue .

Dookei gravatar image Dookei  ( 2020-10-16 07:48:44 -0500 )edit

Which is not a correct solution, as now your PointClouds violate REP-103 camera frame conventions. See also the answer by William in the Q&A you link: you should setup the TF frame for your optical camera frame correctly.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-16 10:52:47 -0500 )edit

Hi I know is not correct, but the thing is if I try to use pointcloud_to_laser this wont work. Either way this is just for the simulation When using the real cameras this wont be used no longer. I also find it annoying that gazebo uses another convention than ROS. And why is the plugin incorrect ? Is it not suppose to be a bridge between Gazebo and ROS?

Dookei gravatar image Dookei  ( 2020-10-16 11:26:15 -0500 )edit