Home | Tutorials | Wiki | Issues
Ask Your Question
0

ROS furte gazebo_ros_camera does not publish topics

asked 2012-10-18 10:58:34 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

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

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

<group if="$(arg use_sim_time)"> </group>

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

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

<!-- 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
            -urdf
            -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>
</launch>

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

<robot xmlns:controller="&lt;a href=" http:=""
playerstage.sourceforge.net="" gazebo="" xmlschema=""
#controller"="">http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:xacro="http://www.ros.org/wiki/xacro" name="HummingBird">

<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"/> </material>

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

<inertial>
  <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" />  
</inertial>

<collision>
  <geometry>
    <box size="${body_size} ${body_size} ${body_size}"/>
  </geometry>
</collision>
</link>

<gazebo reference="base_link"> <sensor name="camera" type="camera"
always_on="1" update_rate="30" visualize="true"> <camera> <horizontal_fov
angle="1.57079633"/> <image width="640" height="480" format="R8G8B8"/>
<clip near="0.1" far="100"/> </camera> <plugin name="camera_plugin"
filename="libgazebo_ros_camera.so"> <alwayson>true</alwayson>
<imagetopicname>image_raw</imagetopicname>
<camerainfotopicname>camera_info</camerainfotopicname>
<updaterate>30.0</updaterate> <cameraname>overhead_camera</cameraname>
<framename>overhead_camera_frame</framename> <cxprime>320.5</cxprime>
<cx>320.5</cx> <cy>240.5</cy> <hackbaseline>0</hackbaseline>
<focallength>320.000101</focallength> <distortionk1&gt;0.0<
distortionk1&gt;="" <distortionk2&gt;0.0<="" distortionk2&gt;=""
<distortionk3&gt;0.0<="" distortionk3&gt;="" <distortiont1&gt;0.0<=""
distortiont1&gt;="" <distortiont2&gt;0.0<="" distortiont2&gt;="" <=""
plugin=""> </sensor> </gazebo> </robot>

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 ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-18 12:31:47 -0500

SL Remy gravatar image

updated 2013-05-08 15:38:42 -0500

I'm using groovy, and this is a partial solution, but there is data on

rosrun gazebo gztopic view /gazebo/default/camera/link/camera/image

after running gazebo with this following world file

<?xml version="1.0" ?>
<sdf version="1.3">
  <world name="default">
    <physics type="ode">
      <gravity>0 0 -9.8</gravity>
      <ode>
        <solver>
          <type>quick</type>
          <dt>0.001</dt>
          <iters>40</iters>
          <sor>1.0</sor>
        </solver>
        <constraints>
          <cfm>0.0</cfm>
          <erp>0.2</erp>
          <contact_max_correcting_vel>100.0</contact_max_correcting_vel>
          <contact_surface_layer>0.0</contact_surface_layer>
        </constraints>
      </ode>
    </physics>
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <include>
      <uri>model://create</uri>
      <pose>0 0 0.5 0 0 0</pose>
    </include>

    <include>
      <uri>model://camera</uri>
      <pose>0 0 1 0 0 0</pose>
    </include>
  </world>
</sdf>

I'm still working on getting the ROS topic published.. the process exists, but I'm hoping there's another way. It should be possible to include the camera model from the database and then add the ROS plugin (since all users of cameras will not be ROS users).

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2012-10-18 10:58:34 -0500

Seen: 631 times

Last updated: May 08 '13