ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Adding a camera to a model in Gazebo? (Beginner)

asked 2015-06-06 00:22:07 -0600

utagai gravatar image

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!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-06-06 07:55:35 -0600

gvdhoorn gravatar image

This is more a Gazebo question than a ROS question (so I should refer you to the 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).

edit flag offensive delete link more


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!

utagai gravatar image utagai  ( 2015-06-06 13:49:24 -0600 )edit

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.

ssaniljainn gravatar image ssaniljainn  ( 2021-02-25 05:32:56 -0600 )edit

answered 2018-07-31 16:30:26 -0600

zubair gravatar image

I recommend to go through this : 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="">
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-06-06 00:22:07 -0600

Seen: 18,735 times

Last updated: Jul 31 '18