# Add camera to gazebo model iris.sdf

**URL:** <https://discuss.px4.io/t/add-camera-to-gazebo-model-iris-sdf/23233>\
**Category:** Uncategorized\
**Created:** [July 9, 2021, 4:08pm UTC](https://discuss.px4.io/t/add-camera-to-gazebo-model-iris-sdf/23233 "2021-07-09T16:08:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FedeUnibo](https://discuss.px4.io/user_avatar/discuss.px4.io/fedeunibo/32/8216_2.png) [@FedeUnibo](https://discuss.px4.io/u/FedeUnibo)\
**Post date:** [July 9, 2021, 4:08pm UTC](https://discuss.px4.io/t/add-camera-to-gazebo-model-iris-sdf/23233/1 "2021-07-09T16:08:05Z")

</div>

hi everyone,  
i’m trying to modify the /PX4-Autopilot/Tools/sitl\_gazebo/models/iris/iris.sdf in order to add a camera to the model. In the end of the iris.sdf.jinja file i added the following:

```auto
<!-- CAMERA -->
<!-- link -->
    <link name='camera_link'>
      <pose frame=''>-0.15 0 0.15 0 1.3 0</pose>

      <visual name='camera_visual'>
        <pose frame=''>0 0 0 0 0 0</pose>
        <geometry>
          <box>
            <size>3.95 0.95 0.95</size>
          </box>
        </geometry>
      </visual>

      <inertial>
        <pose frame=''>0 0 0 0 0 0</pose>
        <mass>0.015</mass>
        <inertia>
          <ixx>1e-05</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>1e-05</iyy>
          <iyz>0</iyz>
          <izz>1e-05</izz>
        </inertia>
      </inertial>

      <sensor type="camera" name="camera1">
        <update_rate>30.0</update_rate>
        <camera name="head">
          <horizontal_fov>1.3962634</horizontal_fov>
          <image>
            <width>800</width>
            <height>800</height>
            <format>R8G8B8</format>
          </image>
          <clip>
            <near>0.02</near>
            <far>300</far>
          </clip>
          <noise>
            <type>gaussian</type>
            <mean>0.0</mean>
            <stddev>0.007</stddev>
          </noise>
        </camera>
        <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
          <alwaysOn>true</alwaysOn>
          <updateRate>0.0</updateRate>
          <cameraName>iris/camera</cameraName>
          <imageTopicName>image_raw</imageTopicName>
          <cameraInfoTopicName>camera_info</cameraInfoTopicName>
          <frameName>/camera_link</frameName>
          <hackBaseline>0.07</hackBaseline>
          <distortionK1>0.0</distortionK1>
          <distortionK2>0.0</distortionK2>
          <distortionK3>0.0</distortionK3>
          <distortionT1>0.0</distortionT1>
          <distortionT2>0.0</distortionT2>
        </plugin>
      </sensor>
    </link>

```

i also delete the iris.sdf file before ‘make\_px4\_sitl gazebo’ such that the changes are overwritten. The compilation gives no problem, when gazebo starts i can see the ‘camera link’ in the model tree but there is no ‘image\_raw’ topic in ros2… i’m doing something wrong?? thanks.

---

<div class="post-metadata">

**Author:** ![Mohamed\_Ahmed](https://discuss.px4.io/user_avatar/discuss.px4.io/mohamed_ahmed/32/7556_2.png) [@Mohamed\_Ahmed](https://discuss.px4.io/u/Mohamed_Ahmed)\
**Post date:** [July 12, 2021, 3:24pm UTC](https://discuss.px4.io/t/add-camera-to-gazebo-model-iris-sdf/23233/2 "2021-07-12T15:24:55Z")

</div>

You check [my repo](https://github.com/mohamedsayed18/Drone_simulation/tree/main/src/basics/models/iris_fpv_cam). We used the iris\_fpv\_cam model but edited the orientation of the camera.  
Note: I’m using ros1

---

<div class="post-metadata">

**Author:** ![mg-felix](https://discuss.px4.io/user_avatar/discuss.px4.io/mg-felix/32/11217_2.png) [@mg-felix](https://discuss.px4.io/u/mg-felix)\
**Post date:** [October 4, 2022, 10:34am UTC](https://discuss.px4.io/t/add-camera-to-gazebo-model-iris-sdf/23233/3 "2022-10-04T10:34:56Z")

</div>

You should try to check the published topics by running rostopic list. There should be a topic there with image\_raw, maybe not with that exact name, but something similar.
