How to capture image using kinect camera in Gazebo? [closed]

asked 2014-07-03 02:12:48 -0500

Abhishek Jha gravatar image

Hi all, I am trying to capture images of a moving robot arm simulated in Gazebo using the kinect camera controller. A part of my model.sdf for the camera model is as follows:

<sensor name="camera_0" type="depth">
    <camera>
     <horizontal_fov>1.5</horizontal_fov>
      <image>
        <width>1024</width>
        <height>800</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>.1</near>
        <far>20</far>
      </clip>
      <save enabled="true" path="/tmp/camera"/>
    </camera>

<plugin name="kinect_camera_controller" filename="libgazebo_ros_openni_kinect.so">
      <cameraName>camera_0</cameraName>
      <alwaysOn>true</alwaysOn>
      <updateRate>10</updateRate>
      <imageTopicName>rgb/image_raw</imageTopicName>
      <depthImageTopicName>depth/image_raw</depthImageTopicName>
      <pointCloudTopicName>depth/points</pointCloudTopicName>
      <cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
      <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
      <frameName>second_camera_depth_optical_frame</frameName>
    </plugin>
    <always_on>true</always_on>
    <update_rate>20.0</update_rate>
  </sensor>

As you can see the camera is in 'always On' state.Therefore it keeps on taking images at regular intervals. I want to have control over camera in terms of being able to click images when I want to. How to do this?

Any help is greatly welcome

edit retag flag offensive reopen merge delete

Closed for the following reason Gazebo Question: The Gazebo community prefers to answer questions at: http://answers.gazebosim.org by tfoote
close date 2016-06-28 22:18:53.109226