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

dbcooper's profile - activity

2015-01-14 08:42:26 -0500 received badge  Famous Question (source)
2015-01-14 08:42:26 -0500 received badge  Notable Question (source)
2015-01-14 08:42:26 -0500 received badge  Popular Question (source)
2014-05-27 23:13:50 -0500 received badge  Enthusiast
2014-05-23 19:09:26 -0500 received badge  Editor (source)
2014-05-23 15:33:33 -0500 asked a question Adding a static camera to a world in gazebo ros hydro

I am trying to include a static camera model to a kitchen world and save them using rosbag. However when i launch the world file, the camera doesn't seem to be loaded as there are no rostopics for that camera nor I can see the camera in gazebo simulator. I am using ROS hydro on Ubuntu 12.04.

<?xml version="1.0" ?>
<sdf version="1.4">
  <world name="default">
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <include>
      <uri>model://ground_plane</uri>
    </include>
    <!-- Kitchen environment -->
    <include>
      <uri>model://kitchen_dining</uri>
    </include> 
    <!--Camera -->
    <model name="camera_box">
      <link name="camera_link">
        <gravity>false</false>
        <pose>0.05 0.05 0.05 0 0 0</pose>
        <inertial>
          <mass>0.1</mass>
        </inertial>
        <visual name="camera_visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>
        <sensor name="wall_camera" type="camera">
          <camera>
            <horizontal_fov>1.047</horizontal_fov>
            <image>
              <width>640</width>
              <height>480</height>
              <format>R8G8B8</format>
            </image>
            <clip>
              <near>0.1</near>
              <far>100</far>
            </clip>
          </camera>
          <always_on>1</always_on>
          <update_rate>30</update_rate>
          <visualize>true</visualize>
          <plugin filename="libgazebo_ros_camera.so" name="camera_en_ros">
            <robotNamespace>wall</robotNamespace>
            <cameraName>wall_camera</cameraName>
            <imageTopicName>raw_image</imageTopicName>
            <cameraInfoTopicName>info_image</cameraInfoTopicName>
            <FrameName>cameraImage</FrameName>
            <Cy>0</Cy>
            <Cx>0</Cx>
            <updateRate>30.0</updateRate>
          </plugin>
        </sensor>
      </link>
    </model>

    <!-- Own physics settings to speed up simulation -->
    <physics type='ode'>
      <max_step_size>0.01</max_step_size>
      <real_time_factor>1</real_time_factor>
      <real_time_update_rate>100</real_time_update_rate>
      <gravity>0 0 -9.8</gravity>
    </physics>
  </world>
</sdf>

I also looked at the camera available in the gui tag, but I don't if there is any way to save those images. What am I doing wrong, please help me with it.

I also tried adding camera model using the include tag, but if i put a tutlebot_gazebo in it too, an error comes that "Sensors failed to initialize when loading model[mobile_base]." Is it that the cameras are generated to the same rostopic /camera/rgb/image_raw ?? If so, how can i get the images of the camera into a new rostopic ?

<include>
    <uri>model://camera</uri>
    <pose>-21 -11 12 0 0.44 0.35</pose>
    <name>camera2</name>
</include>

So how do i get a rostopic for the include camera part ?? I think this will solve all my problems