Adding camera to iris drone in gazebo simulation and publish images to ROS topic


I am trying to add a camera to the iris drone to my gazebo simulation. I tried using many models (iris_fpv_cam, iris_downward_depth_camera, iris_stereo_camera …) by changing px4 launch files’ vehicle argument. But i keep getting:

Error: Unknown model 'iris_fpv_cam'
ERROR [px4] Startup script returned with return value: 256

I also tried to modify iris.sdf and iris.xacro files as described here. And I get the following errors:

Error [] Required attribute[name] in element[collision] is not specified in SDF.
Error [] Error reading element <collision>
Error [] Error reading element <link>
Error [] Error reading element <model>
Error [] Unable to read element <sdf>
Error:   Could not find the 'robot' element in the xml file
         at line 81 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp
Error [] Unable to call parseURDF on robot model
Error [] parse as old deprecated model file failed.

Can someone please assist me on how to add a downward camera attached to my drones?

Thank you


I have the same problem. Did you find a solution?

Hi @nazakarim I am also facing the same issue. Did you manage to fixed it ?

if you want to use iris_fpv_cam, keep the vehicle argument as ‘iris’ and change the sdf value to iris_fpv_cam directory.

<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/iris_fpv_cam/iris_fpv_cam.sdf"/>

or add another argument so you can choose the model type (iris_fpv_cam, iris_downward_depth_camera, iris_stereo_camera …)

<arg name="model" value="iris_fpv_cam" />
<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg model)/$(arg model).sdf"/>

Thanks alot that will do it.

How to connect that “iris_fpv_cam” to “darknet ros” webcam/camera topic to get raw images to use? I would like to active yolo to detect images via “darknet ros” in px4 too which I had done it at ArduCopter drone with ros gazebo ardupilot; but how can we do the same subject in px4 ros gazebo too? thank you.

I assume you are using leggedrobotics/darknet_ros for the object detection module. All you need to do is change the camera topic inside the config file darknet_ros/config/ros.yaml as stated in Readme/basic-usage with the camera topic from iris_fpv_cam. If you aren’t sure, just run the iris fpv and then do rostopic list from the terminal to find the image topic name