Rosanswers logo

Good evening,

I'm a little bit confused about the new configuration of the sensor controller. Now they are embedded in plugin structure. I'd like to run a camera device on gazebo ROS fuerte (Ubuntu 12.04).

My simple launch file is

    <arg name="paused" default="true"/>
  <arg name="use_sim_time" default="false"/>
  <arg name="gui" default="true"/>

  <!-- set use_sim_time flag -->
  <group if="$(arg use_sim_time)">
    <param name="/use_sim_time" value="true" />

  <!-- start empty world -->
  <group if="$(arg paused)">
      <node name="gazebo" pkg="gazebo" type="gazebo" args="-u $(find gazebo_worlds)/worlds/empty.world" respawn="false" output="screen"/>

  <!-- start gui -->
  <group if="$(arg gui)">
    <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>

    <!-- send the erratic robot XML to param server -->
    <param name="robot_description" command="$(find xacro)/xacro.py './camera.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <node name="spawn_robot" pkg="gazebo" type="spawn_model"
          args="-param robot_description
                -z 0.1
                -model robot_description"
          respawn="false" output="screen" />

    <!-- start robot state publisher -->
    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen" >
        <param name="publish_frequency" type="double" value="50.0" />

<!--    <node pkg="fake_localization" type="fake_localization" name="fake_localization" respawn="true" output="screen" >-->
<!--        <param name="odom_frame_id" value="odom"/>-->
<!--    </node>-->

where 'camera.xacro' file (I know that is deprecated but it is trivial to convert it in urdf ) is

<?xml version="1.0"?>

<robot  xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"

<xacro:property name="id" value="0" />
<xacro:property name="PI"       value="3.141592653589793" />
<xacro:property name="HALF_PI"  value="1.570796326794897" />

<xacro:property name="body_size"  value="0.080" />
<xacro:property name="body_mass"  value="0.300" />
  <material name="body_color">
    <color rgba="1.0 0.0 0.0 1.0"/>

  <gazebo reference="base_link">
   <link name="base_link">
        <box size="${body_size} ${body_size} ${body_size}"/>
      <origin xyz="0 0 0" rpy="0 0 0"/>

      <origin xyz="0 0 0" rpy="0 0 0"/>
      <mass value="${body_mass}" />
      <inertia ixx="1e-5"  ixy="1e-10"  ixz="1e-10" iyy="1e-5" iyz="1e-10" izz="1e-5" />  

        <box size="${body_size} ${body_size} ${body_size}"/>


<gazebo reference="base_link">
      <sensor name='camera' type='camera' always_on='1' update_rate='30' visualize='true'>
          <horizontal_fov angle='1.57079633'/>
          <image width='640' height='480' format='R8G8B8'/>
          <clip near='0.1' far='100'/>
        <plugin name="camera_plugin" filename="libgazebo_ros_camera.so">

The real problem is that the launch file is correct and everything works. The problem is when I want to show the image (I assume that the topic name for the camera is image_raw or camera/image_raw) but any kind of this topic exist (I checked also with rostopic list).

Does anyone try the same plugin? The name is gazebo_ros_camera. If it is possible, paste your code.

Thanks in advance,


Originally posted by Neostek on ROS Answers with karma: 156 on 2012-10-18

Post score: 0


1 Answer 1


Rosanswers logo

I already tried it but without success. Thanks anyway for your answer. The problem is exactly the same. The point is the launch file loads the right xacro file but it seems it 'skips' the plugin tag.

After some modifications, it seems that if I create a .model file it is able to load the plugin, if I create a .xacro (or urdf) one it does not. Did someone try it? It seems there is no more compatibility with URDF, also if I read some posts where the compatibility is said to be ensured.

Originally posted by Neostek with karma: 156 on 2012-10-18

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

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