Rosanswers logo

Hello! I am very new to using things like Gazebo and ROS. I was wondering about how one might take a model from Gazebo (like turtlebot or quadrotor) and attach a camera to it, and see the feed?

My guess is that I have to go into the code of the model files and add camera code? But I am unfamiliar with the code or how it works. And how would I get the feed? Is there a simpler way to do this?

Can someone please guide me through this process? I have Gazebo5, and I am running Ubuntu.

Thank you!

Originally posted by utagai on ROS Answers with karma: 3 on 2015-06-06

Post score: 0


2 Answers 2


Rosanswers logo

This is more a Gazebo question than a ROS question (so I should refer you to the gazebosim.org site), but what you ask is described in one of the Gazebo tutorials, namely the Connect to ROS one.

If you've never done any of this (urdf, sdf, ROS, Gazebo, etc), I really recommend doing the ROS or (actually: and) Gazebo tutorials first (or find a book about it), and only then move on to more advanced things. Everything will seem really convoluted and incomprehensible otherwise (at least, that is what many students/people tell me is their experience).

Originally posted by gvdhoorn with karma: 86574 on 2015-06-06

This answer was ACCEPTED on the original site

Post score: 2

Original comments

Comment by utagai on 2015-06-06:
Okay never mind, I figured it out. This wasn't nearly as complicated as I thought haha, the .sdf files have a very intuitive format, and I think as a programmer it wasn't too hard to work it out.

I will try giving myself a crash course using the tutorials you have provided. Thank you!

Comment by ssaniljainn on 2021-02-25:
Hey, did u figure this out? I am in a similar situation. The problem is that the iris model that I have does not have the iris.xacro file. Just 2 files - model.sdf and model.config. I am using ROS Kinetic.


Rosanswers logo

I recommend to go through this : http://gazebosim.org/tutorials?tut=ros_gzplugins#Camera My solution is to just add the following in your iris.sdf :

<link name='cam_link'>
  <pose frame=''>-0.118317 0.002195 0.004205 -0 -0 -3.12703</pose>
    <pose frame=''>0 0 0 0 -0 0</pose>
  <sensor name='camera1' type='camera'>
    <camera name="head">
    <plugin name="camera_controller" filename="libgazebo_ros_camera.so">

Originally posted by zubair with karma: 178 on 2018-07-31

This answer was NOT ACCEPTED on the original site

Post score: 2


Your Answer

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